This post will describe for how to encrypt and decrypt the string using mcrypt.
I have written the basic class for this encryption and decryption using mcrypt. I am not saying that this is the to the point solution for encrypt the string in two way methods, but this will be usefull for encrypt/decrypt string in efficient way.