well.... you are not in the right direction at all
md5() and crypt() is producing a one way hash
if you want to encode/decode you have to use the functions under the Mcrypt function group in www.php.net
don't be confused that crypt() uses DES like mechanisms to create hashes, they are still hashes, not encryption function.
I'll try to give you a simple example:
Encryption/Decryption algorithms (eg. DES, TwoFish, Rijndael etc):
original text = "this is my text" > encryption produces: 23AB340BD3498F3 > decryption produces: "this is my text"
Hashes (eg. md5, md4, tiger, RipeMD, SHA):
original text = "this is my text" > hash produces: 23AB340BD3498F3
(there is no turning back!!)
People use md5 to store passwords not data. The idea is that someone enters a password and the server instead of the original password stores the md5 hash of the password. So if ANYone attempts to steal passwords s/he will fail because all s/he will find is hashed passwords. Only the user knows the original password which if it is hashed it will produce what the server has stored.
So read about the functions in the Mcrypt function group and amongst the various encryption block methods you will find, I would suggest you to use the simple CBC mode ( mcrypt_cbc() ). I would also recommend you not to choose DES. Choose Rijndael, Twofish, Blowfish or 3DES at worst.