“I’ll hash the password” and “I’ll encrypt the password” are not the same thing, and confusing them causes real security mistakes. This guide explains what SHA-256 is, what properties it has, what it is really for, and why a hash is not encryption.
1. What a hash is
A hash function takes data of any size and produces a fixed-size fingerprint. A cryptographic hash function is additionally designed so that it is infeasible to reverse it or find two inputs with the same fingerprint.
2. What SHA-256 is
SHA-256 belongs to the SHA-2 family and produces a 256-bit fingerprint, shown as 64 hexadecimal characters:
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
(that is the hash of the empty string). The same input always gives the same output.
3. Properties
- One-way: there is no way to “undo” the hash to recover the input.
- Deterministic: the same input always produces the same hash.
- Avalanche effect: changing a single bit of the input completely changes the fingerprint.
- Collision-resistant: it is infeasible to find two different inputs with the same hash.
4. What it is for
- Verify integrity: you publish the SHA-256 of a download; whoever gets it recomputes it and, if it matches, the file was not altered.
- Store passwords: the hash is stored with a salt, never the plaintext password.
- Digital signatures and blockchain: the hash is a core piece.
In all these cases the fingerprint is used, not an “encryption”.
Compute the SHA-256 of a text or file — processed 100% in your browser, nothing is uploaded → open the hash generator
5. A hash is not encryption
This is the most important distinction:
| Hash (SHA-256) | Encryption | |
|---|---|---|
| Reversible? | No | Yes, with the key |
| Goal | Fingerprint / integrity | Confidentiality |
| Recover the original | Never | Yes |
A hash cannot be decrypted because it does not store the original’s information: it summarizes it into a fingerprint. If someone says “SHA-256 encrypts”, they are misusing the term.
6. SHA-256 vs SHA-1 vs MD5
- MD5 and SHA-1: have demonstrated collisions, must not be used for security.
- SHA-256: no known practical collisions, the recommended standard today.
7. Relation to other identifiers
If you also generate unique identifiers, see what is a UUID v4: it solves a different problem (uniqueness, not integrity), but both are developer tools that run 100% in your browser.
8. Summary
SHA-256 is a cryptographic hash function from the SHA-2 family that produces a 256-bit fingerprint, one-way, deterministic and with an avalanche effect. It is used to verify integrity, store passwords with a salt, and underpin signatures and blockchain. It is not encryption: it cannot be decrypted. Compared with SHA-1 and MD5, which are broken for collisions, it is the current standard. To compute one locally, use the generator.