What you want is a one way hash rather than encryption, decryption. You store the hashed password in the database. When you get the password at login time, you hash it and compare it to the version stored in the database. There is absolutely no way to derive the real password from the persisted version.
I did the hash for the password but now i want to encrypt some informations that i put in cookie. So i need two way encryption so i can encrypt and decrypt it
Thank you very much i will check the links