Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Hashing is a one-way process that turns any input into a fixed-length value, or digest, used to verify integrity, store passwords safely, and identify files without revealing the original data.

What Is Hashing?
Hashing is the process of passing data of any size through a hash function to produce a short, fixed-length output called a hash, digest, or fingerprint. The same input always produces the same hash, but even a one-character change produces a completely different one, and there is no key that turns a hash back into the original data. That makes hashing ideal for checking that something has not changed, and for storing secrets you only ever need to compare.
For example, the SHA-256 hash of a 4 GB disk image is still just 64 hexadecimal characters. If a single bit of the image changes, the hash changes beyond recognition.
Not every hash function is suitable for security. Checksums such as CRC32 detect accidental corruption but are trivial to manipulate. A cryptographic hash function must offer:
| Algorithm | Output size | Status |
|---|---|---|
| MD5 | 128 bits | Broken; practical collisions since 2004 |
| SHA-1 | 160 bits | Broken; the SHAttered collision was published in 2017 |
| SHA-256 / SHA-512 (SHA-2) | 256 / 512 bits | Secure and the most widely used |
| SHA-3 | 224–512 bits | Secure; standardised by NIST as FIPS 202 in 2015 |
| BLAKE2 / BLAKE3 | Variable | Secure and very fast in software |
Broken algorithms cause real harm. The Flame espionage malware, discovered in 2012, used an MD5 collision to forge a code-signing certificate that chained to Microsoft, allowing it to spread across local networks by posing as a Windows Update. If MD5 or SHA-1 still underpins signatures or certificates in your environment, replace them.
General-purpose hashes like SHA-256 are designed to be fast, and that is exactly wrong for passwords. A single modern GPU running hashcat can test billions of SHA-256 guesses per second. In 2012 around 6.5 million LinkedIn password hashes, stored as unsalted SHA-1, were posted online and cracked in bulk; in 2016 it emerged that the breach involved far more accounts.
Password hashing needs three things:
A pepper—a secret value held outside the database, for example in a hardware security module—adds protection if only the database is stolen.
Windows shows what happens when hashes are not salted. NTLM hashes can be reused directly in pass-the-hash attacks (MITRE ATT&CK T1550.002), so the hash effectively becomes the password. Weak password storage is a common finding in our web application security services.
A plain hash proves data has not changed only if the hash itself comes from a trusted source. To authenticate a message between two parties, use an HMAC (defined in RFC 2104), which combines a secret key with the hash. APIs use HMAC to sign requests and webhooks, and JWTs signed with HS256 rely on HMAC-SHA256. Never build your own construction by simply concatenating a key and a message, as this is vulnerable to length extension attacks with SHA-2.
Encryption is designed to be reversed by whoever holds the key; hashing is designed never to be reversed. Encoding schemes such as Base64 are neither—they simply change representation and offer no security at all.
Not mathematically, because a hash function discards information and has no key. Attackers instead guess inputs, hash them, and compare the results, using wordlists, rules, and rainbow tables. That works well against short or common passwords and unsalted fast hashes, which is why salted, slow algorithms such as Argon2id or bcrypt are essential for password storage.
MD5 should not be used where an attacker could benefit from creating collisions, such as signatures, certificates, or verifying files from untrusted sources. It still appears in non-security roles like deduplication or quick change detection, and in legacy forensic workflows alongside SHA-256. For any new system, choose SHA-256 or another modern algorithm instead.
A salt is a random value generated for each password and stored alongside its hash. It ensures that two users with the same password get different hashes. A pepper is a single secret value applied to all passwords but stored separately from the database, such as in a hardware security module, so a stolen database alone is not enough to start cracking.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.