Hash and Cipher Algorithms Cheat Sheet

Digest sizes of MD5, SHA-1, SHA-2, SHA-3 and BLAKE2, key and block sizes of AES, ChaCha20 and 3DES, password hashes and signature algorithms, with status.

Last reviewed:

AdSense Placeholder
Slot: header_reference_page
On this page

A hash turns any input into a fixed-size fingerprint and cannot be reversed; a cipher scrambles data with a key so it can be decrypted again. Digest sizes below were computed with Python's hashlib, and cipher key and IV sizes were read from OpenSSL 3.5. Try any hash with the Hash Generator.

Hash functions

Algorithm Digest (bits) Hex characters Internal block (bits) Status
CRC-32 32 8 n/a Error detection only, not a security hash
MD5 128 32 512 Broken: collisions are cheap
SHA-1 160 40 512 Broken: practical collisions since 2017; avoid
RIPEMD-160 160 40 512 Legacy (Bitcoin addresses); not for new designs
SHA-224 224 56 512 Current (SHA-2)
SHA-256 256 64 512 Current; the default choice
SHA-384 384 96 1024 Current
SHA-512 512 128 1024 Current; often faster than SHA-256 on 64-bit CPUs without SHA instructions
SHA-512/256 256 64 1024 Current; resists length extension
SHA3-256 256 64 1088 (rate) Current (Keccak)
SHA3-512 512 128 576 (rate) Current
SHAKE128 / SHAKE256 any length any 1344 / 1088 (rate) Current; extendable output
BLAKE2s up to 256 up to 64 512 Current; fast in software
BLAKE2b up to 512 up to 128 1024 Current
SM3 256 64 512 Chinese national standard

Identify a hash by its length: 32 hex characters is usually MD5, 40 is SHA-1, 64 is SHA-256 (or SHA3-256, BLAKE2s), 128 is SHA-512 (or SHA3-512, BLAKE2b). The length alone cannot separate algorithms of the same size.

Test vectors for the text abc

Algorithm Digest (hex)
CRC-32 352441c2
MD5 900150983cd24fb0d6963f7d28e17f72
SHA-1 a9993e364706816aba3e25717850c26c9cd0d89d
SHA-256 ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
SHA3-256 3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532
HMAC-SHA256, key key 9c196e32dc0175f86f4b1cb89289d6619de6bee699e4c378e68309ed97a1a6ab

Paste abc into the tools to check an implementation; verify files with the File Checksum Calculator and keyed digests with the HMAC Generator.

Symmetric ciphers

Cipher Type Key (bits) Block (bits) IV / nonce (bits) Status
AES-128 Block 128 128 128 (CBC), 96 (GCM) Current
AES-192 Block 192 128 128 (CBC), 96 (GCM) Current
AES-256 Block 256 128 128 (CBC), 96 (GCM) Current; the usual default
ChaCha20 Stream 256 n/a 96 nonce + 32-bit counter Current; pair with Poly1305
Camellia Block 128 / 192 / 256 128 128 Current; less common
ARIA Block 128 / 192 / 256 128 128 Korean standard
SM4 Block 128 128 128 Chinese national standard
Triple DES (3DES) Block 168 (112-bit strength) 64 64 Deprecated: 64-bit block
Blowfish Block 32 to 448 64 64 Legacy: 64-bit block
DES Block 56 64 64 Broken: the 56-bit key can be brute-forced
RC4 Stream 40 to 2048 n/a none Broken: banned in TLS

Modes of operation

Mode Authenticated? Notes
GCM Yes (AEAD) Default for TLS and most APIs; never reuse a nonce with the same key
ChaCha20-Poly1305 Yes (AEAD) Fast without AES hardware; same nonce rule
CCM Yes (AEAD) Constrained devices
CBC No Needs a random IV and a separate MAC; padding-oracle risk
CTR No Turns a block cipher into a stream cipher; needs a MAC
ECB No Identical blocks give identical output: never use for data

Password hashing

Algorithm Example format Tunable cost Status
Argon2id $argon2id$v=19$m=65536,t=3,p=4$... Memory, time, parallelism Recommended first choice
scrypt $scrypt$... (format varies) Memory and CPU Good
bcrypt $2b$12$ + 53 characters (60 in total) Cost factor (12 = 2^12 rounds) Good; input limited to 72 bytes
PBKDF2-HMAC-SHA256 pbkdf2_sha256$600000$... Iteration count Acceptable when FIPS is required
Plain SHA-256 / MD5 none Never: billions of guesses per second on a GPU

Always add a unique random salt (the formats above store it for you). Generate bcrypt hashes with the Bcrypt Generator.

Asymmetric algorithms

Algorithm Use Typical key Signature / output Status
RSA Signatures, key transport 2048 to 4096 bits Same size as the key Current at 2048+; 1024 is too weak
ECDSA P-256 Signatures 256 bits 64 bytes (raw r and s) Current
Ed25519 Signatures 256 bits (32-byte key) 64 bytes Current; simple and fast
X25519 Key agreement 256 bits 32-byte shared secret Current (TLS 1.3)
ECDH P-256 Key agreement 256 bits 32-byte shared secret Current
ML-KEM (Kyber) Post-quantum key agreement Parameter sets 512, 768, 1024 32-byte shared secret NIST standard (FIPS 203)
ML-DSA (Dilithium) Post-quantum signatures Parameter sets 44, 65, 87 2420, 3309 or 4627 bytes NIST standard (FIPS 204)
DSA Signatures 1024 to 3072 bits Deprecated

Create RSA or elliptic-curve key pairs with the Key Pair Generator; encrypt short text with AES in the AES Text Encryption tool.

Try these tools

See also

  • Guide How Hashing Works
    What a hash function does, the avalanche effect shown with real SHA-256 output, which algorithms are still safe, HMAC.
  • Glossary Hash
    A hash is the fixed-length fingerprint a hash function computes from any input.
  • Glossary Encryption
    Encryption is the process of scrambling data with a key so that only someone with the right key can read it.
  • Glossary Salt
    A salt is a unique random value added to a password before hashing, so that identical passwords produce different hashes.
  • Glossary HMAC
    HMAC (hash-based message authentication code) is a hash computed with a secret key.
  • Glossary Public-key cryptography
    Public-key (asymmetric) cryptography uses a pair of linked keys: a public key anyone can have, and a private key kept secret.

Frequently Asked Questions

Only against accidental corruption. Anyone who can change the file can also craft a different file with the same MD5, so use SHA-256 whenever the checksum has to prove the file was not tampered with.

AdSense Placeholder
Slot: footer_leaderboard