encrypt the password


i need to encrypt the password and want to submit in the database so that whenever i am seeing the password it wants should be in the encrypted manner.
How can i do it?

In PHP use md5($password)

Depending on the database you’re using you could use the built in encryption.

if you’re using MySQL try this

Code:

UPDATE users SET password=md5('thepassword') WHERE user='theuser';

when your checking against a database to md5 the input aswell.

I would recommend using PHP md5() function .

You can also use base64_encode and base64_decode functions.