Hash any text or file with MD5, SHA-1, SHA-256, SHA-384 and SHA-512, or create an HMAC with a secret key, and compare with a published hash to verify a download.
Use password_hash() in PHP, bcrypt or Argon2 for passwords
Compare SHA-256 hashes of files you download
Avoid
Do not store passwords as plain MD5 or SHA-256
Do not treat a hash as reversible encryption; it is one-way
Example: verify a downloaded file
Many projects publish a SHA-256 hash next to the download link. Choose the file here and paste the published hash into the compare box. A match means the file is exactly as published; if it does not match, do not install it.
Key terms
Short definitions of what you meet along the way.
Hash
A fixed-length fingerprint of data that changes completely if one character changes.
HMAC
A hash computed with a secret key, proving a message came from the key holder.
Salt
A random value added to a password before hashing to defeat precomputed tables.
We use necessary cookies to run the site, and Google Analytics to measure visits only if you agree. You can change your choice at any time from “Cookie settings”. Privacy policy