i'm working with my sign up module. I'm going to encrypt the password that i'm going to enter during sign up module using sha1() method in php and store it in mysql database. During the log in process, how can I get the original string of the encrypted password characters in the database. I mean, what method should i'm going to use?
Asked
Active
Viewed 1,065 times
0
-
`SHA...` is a _hashing_ and not _encryption_ algorithm. See [this](http://stackoverflow.com/questions/4948322/fundamental-difference-between-hashing-and-encryption-algorithms). – Boris the Spider Sep 21 '14 at 07:41
1 Answers
2
You cannot get the original string from a hash, that's the very point of hashing a password in the first place: a hacker who got the hash cannot retrieve the password either.
When the user tries to log in, you hash his typed in password and compare the hash with that stored in your DB. If they match, the passwords are considered to be the same.

DarkDust
- 90,870
- 19
- 190
- 224