I require a key generation logic.

I have to applications.

one application should be able to identify the key generated by the other one and the key should not be in sequence and the key should be based on a string which i submit.

Any guys have any ideas on this it will be great help for me

Thanx in advance