Passwords should be stored in a database only after applying one-way encryption to the password. One-way encryption means if a hacker stole the stored encrypted password, he would have no way to reverse the encryption to get the actual password. When the legitimate account owner enters his password, the encryption algorithm is applied to produce a scrambled password, and the scrambled password is then compared to the scrambled password stored in the database. The encryption algorithm always produces the same scrambled password when given the same password, but there is no way to unscramble the encrypted password to get the original password (in less than, say, 200 years of computer crunching).Unfortunately yes. Old databases get cleaned is my understanding and are susceptible to password theft. Then they find that email and try the password.
If a hacker entered the scrambled password he stole, the encryption would be applied to the scrambled password before comparing the result to what was stored in the database. For instance, if the legitimate user's password were "a", and the encryption algorithm added 1 to the letter to "scramble" the password, the password would be stored in the database as "b". If the legitimate account holder entered his password, "a", the encryption algorithm would add 1 to the password to get "b", then that would be compared to what was stored in the database, which was "b", so the entered password after applying encryption matches what was stored in the database. If a hacker then steals the encrypted password from the database, "b", and tries to login using the encrypted password, the encryption algorithm will add 1 to the letter "b", producing "c", before comparing to what was stored in the database, which was "b", so no match.
In other words, for legitimate websites who employ even half competent web developers, if a hacker steals the database containing the scrambled passwords, there is no way for the hacker to gain access to the account.
Last edited: