Live SHA-256, the avalanche effect, and why salts matter.
Type anything — it's hashed as you type11 bytes in → always 32 bytes out
SHA-256256 bits · 64 hex characters
hashing…
SHA-1deprecated160 bits · broken: Google produced two different PDFs with the same SHA-1 in 2017 (“SHAttered”)
hashing…
Salting: same password, different hashes
Alice and Bob both chose the password
Generating salts…
Why salts defeat rainbow tablesA rainbow table is a giant precomputed list of “password → hash”. It only works if everyone's hash is computed the same way. Adding a random salt per user means the attacker's table is useless: they'd need a separate table for every salt, which is far more work than just guessing.
Why real systems use slow hashesSHA-256 is built to be fast — a single GPU can try billions of guesses per second. Password storage should use deliberately slow, tunable algorithms: bcrypt (adjustable cost factor), scrypt and Argon2id (also memory-hard, which cripples GPU cracking). They salt automatically, too.
Hashing ≠ encryptionEncryption is two-way: with the key you get the original back. Hashing is one-way: there is no key, and you verify a password by hashing the attempt and comparing. Hashes are also used to check file integrity — if one byte of a download changes, its SHA-256 changes completely.