How to create a simple encryption algorithm in java?
===

Guys can anyone guide me on how to create an algorithm for encryption/decryption in Java?  I need to make a client - server chat on which text needs to be encrypted by generating a key. On the receiver side the receiver receives text message with decrypt key to open the complete message.I have no idea. Will be grateful if anyone can provide me a sample or tutorial on this. 