By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,967 Members | 1,684 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,967 IT Pros & Developers. It's quick & easy.

How to insert a value by encrypting and should be able to get this by decrypting

P: n/a
Hi All,
I want to insert my password into the mysql database by encrypting it
so that I can also retrieve the password. Before I was using sha1()
for encrypting password,but it is an one way method.
I want to use a function that can be decrypted . Please help me.

Thanks
Amar

Feb 12 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Rik
On Mon, 12 Feb 2007 12:14:51 +0100, Amar <gh**********@gmail.comwrote:
Hi All,
I want to insert my password into the mysql database by encrypting it
so that I can also retrieve the password. Before I was using sha1()
for encrypting password,but it is an one way method.
I want to use a function that can be decrypted . Please help me.
DES_ENCRYPT() / DES_DECRYPT() in MySQL, or look at mcrypt in PHP:
<http://nl3.php.net/manual/en/ref.mcrypt.php>

--
Rik Wasmus
Feb 12 '07 #2

P: n/a
..oO(Amar)
>I want to insert my password into the mysql database by encrypting it
so that I can also retrieve the password. Before I was using sha1()
for encrypting password,but it is an one way method.
That's how it's supposed to be. Passwords should never be stored in a
decryptable way. If a script can decrypt them, an attacker can do that
as well.

Storing just a (salted) password hash is fine. If a user forgets his
password then he should get a new one.

Micha
Feb 12 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.