Evergreen concept
GuideHashing vs Encryption for Beginners
Hashing is one-way fingerprinting; encryption is reversible with a key — when to use SHA-256 checksums vs encrypting data, and why MD5 isn’t for passwords.
Hashing and encryption both scramble data. They solve different problems.
At a glance
| Hashing | Encryption | |
|---|---|---|
| Direction | One-way | Reversible with key |
| Output | Fixed-length digest | Ciphertext (often similar size) |
| Goal | Integrity / fingerprint | Confidentiality |
| Example tools | SHA-256, MD5 | Libraries / OS crypto (not these free hash UIs) |
Use hashing when
- You want to verify a file didn’t change (checksum)
- You need a fingerprint of a string for non-secret lookups
- You’re learning how digests look
Use encryption when
- You must recover the original data later
- You’re protecting data at rest or in transit with proper keys
Password storage
Never “encrypt” passwords with a reversible scheme if a one-way password hash is required — and never use MD5/SHA alone for password storage. Generate strong secrets with Password Generator / Diceware; hash them server-side with a modern KDF.
Related
Frequently Asked Questions
Can I decrypt a SHA-256 hash?
No. Hashes are one-way. You can only guess inputs and compare digests.
Should I store passwords as SHA-256?
No. Use a password hash designed for that job (Argon2, bcrypt, scrypt) with salt — not raw SHA/MD5.