Something that was not mentioned here, you must salt your hashes .. yum yum.
What salt / does.
Suppose you get someone else's database full of hashed passwords. If they had hashed without salt, then cracking passwords would be as simple as loading a large pre-hashed dataset from shit strings.
If the hash from one line matches, then you have a good chance to find out the password. Even if this is not the correct password, you can log in with it, since it gives the same hash.
Here you can poke your hashes. If you add salt (aka a predefined random string) to a password before hashing it, then you cannot just pre-hash a ton of lines
Example. No Salt: Password: ABCD is hashed at 1234EFG A large list of previously hashed strings hash hash 1234EFG, may or may not be ABCD, but it will still work.
With salt: Password: ABCD concat 0315927429 hashes in 43BCF1 Each password has a different salt, so you cannot use one hash lookup table for the pre-computer, you will need to recalculate the hashes for each password.
Recalculation will be incredibly time-consuming. Now salt does not have to be securely stored in order to add a lot of this benefit. Even if you store salt in one table, it would be incredibly difficult if someone did a hash search to try to reset one person’s password.
Another respondent: “One of the answers that is missing here explains to OP that hashing is not encryption.”
Hashes sometimes refer to "one-way encryption." This description is bad and adds to the confusion you were talking about.
source share