Hash Notes — A Hashing & Cryptography Field Guide

A field guide to

Hashing & Cryptography

A personal reference for turning data into fingerprints, secrets, and proofs — what hash functions guarantee, how to shorten a string to fit a limit, how to store passwords, how to sign and encrypt. Every diagram runs real SHA-256, HMAC, and AES in your browser, so you can poke at the actual outputs.

Which tool do I need?

I want to…UseRead
Shorten a long string to a fixed-length key (e.g. under 40 chars)SHA-256 → first 16 bytes → hex (32) or Base64url (22)Shortening Strings
Store user passwordsArgon2id or bcrypt (salt built in)Salting & Passwords
Store API keys / reset tokens I issuedSHA-256 of the random tokenHMAC & Tokens
Prove a webhook / cookie / URL came from meHMAC-SHA256 + constant-time compareHMAC & Tokens
Check a file wasn't corrupted or changedSHA-256 (CRC32C/xxHash if no attacker)Integrity & Dedup
Spread keys across servers or bucketsMurmurHash/xxHash + consistent hashingSharding & Bloom Filters
Keep data secret but get it back laterAES-256-GCM, key in a KMSSymmetric Encryption
Let anyone verify I signed somethingEd25519 / ECDSA signaturePublic-Key Crypto
Send bytes through a text-only channelBase64url or hex (not security!)Hash vs Encrypt vs Encode

Fundamentals

Practical Hashing

Passwords & Authentication

Cryptography