Hash & Encryption Algorithms Cheat Sheet

Hash and encryption cheat sheet: output length, security status and best-use cases for MD5, SHA-1, SHA-256, SHA-3, HMAC, password hashing (bcrypt/scrypt/Argon2) and AES/RSA/ECC.

AlgorithmTypeOutput / LengthSecurityBest use
MD5Hash128 bitBrokenFile checksums (non-security only)
SHA-1Hash160 bitCollided, deprecatedLegacy compatibility, Git objects
SHA-224Hash (SHA-2)224 bitSecureRarely used SHA-2 variant
SHA-256Hash (SHA-2)256 bitSecureCertificates, blockchain, signatures (most common)
SHA-384Hash (SHA-2)384 bitSecureHigher security requirements
SHA-512Hash (SHA-2)512 bitSecureHigher security requirements
SHA-3Hash (Keccak)224/256/384/512 bitSecureStandardized alternative to SHA-2
RIPEMD-160Hash160 bitMostly secureBitcoin address generation
HMACMACFollows base hashSecure (needs key)API signing, webhook verification
bcryptPassword hashing60 charsSecure (tunable cost)Password storage (widely supported)
scryptPassword hashingVariableSecure (memory-hard)ASIC-resistant password storage
Argon2Password hashingVariableSecure (modern default)Preferred for new projects
PBKDF2Password hashingVariableSecure (iterations)Scenarios needing compatibility
AESSymmetric encryption128/192/256 bitSecureData encryption (prefer GCM mode)
RSAAsymmetric encryption2048/4096 bitSecure (long keys)Key exchange, digital signatures
ECCAsymmetric encryption256 bit and upSecure (short keys)Mobile and TLS, high efficiency
TOTPOne-time password6-8 digitsSecure (short-lived)Two-factor authentication
CRC32Checksum32 bitNot cryptographicTransfer integrity checks
Base64Encoding (not crypto)VariableNot cryptographicBinary to text transport

Frequently Asked Questions

Is MD5 still safe to use?

Not for any security purpose: MD5 collisions can be crafted deliberately, allowing forged signatures and certificates. It is acceptable only for non-adversarial integrity checks (e.g. verifying a download). For security, use SHA-256 or stronger.

Which algorithm should I use to store passwords?

Always use a dedicated password-hashing function, in this order of preference: Argon2 (modern default) > scrypt > bcrypt > PBKDF2. Never store passwords with fast hashes like MD5, SHA-1 or SHA-256, even salted, because they are cheap to brute-force on GPUs. Let a mature library handle salting and the cost parameter.

What is the difference between hashing and encryption?

Hashing is one-way: any input maps to a fixed-length digest that cannot be reversed, used for integrity checks and password storage. Encryption is two-way: a key turns plaintext into ciphertext and back, used to keep data confidential in transit or at rest. Base64 is merely an encoding and is neither.

Should I choose SHA-256 or SHA-3?

Default to SHA-256: it has the best performance, ecosystem support and hardware acceleration. SHA-3 uses a completely different internal construction, making it a good diversification fallback if SHA-2 is ever weakened. Both are currently considered secure.