What hashing is used for
A hash function turns any input into a fixed length string called a digest. The same input always produces the same digest, but you cannot work backwards from the digest to the original text.
Where hashes are used
- Verifying that a download was not corrupted
- Storing passwords in a hashed form
- Checking whether two files are identical
SHA versus MD5
SHA-256 and SHA-512 are modern and considered secure. MD5 and SHA-1 are outdated for security purposes because collisions have been found, but they are still useful as quick checksums.
Frequently asked questions
Is hashing the same as encryption?
No. Encryption is reversible with a key. Hashing is one way.
Which hash should I use?
Use SHA-256 for most purposes. Avoid MD5 and SHA-1 for anything security related.
Is my text sent to a server?
No, hashing runs in your browser using the Web Crypto API.