why you want to create your own encryption/decryption code? why don't you use what is already available... like md5?
md5 is a one way hash, which cannot be decrypted. I've used a custom AES encryption class for a while. You can also use mcrypt, and some other functions to properly encrypt and decrypt data. What exactly do you need to encrypt? There may be specific guidelines as to what alogrythms should be used.