Encryption and certificates
Hashing, salting and key exchange
The building blocks under TLS and passwords: one-way hashes, salts, key pairs and agreeing a key in public.
A hash (SHA-256) turns any data into a fixed-size fingerprint that cannot be turned back. Systems store a password's hash, never the password. A salt, random bytes stored beside each hash, makes equal passwords hash differently, so one precomputed table cannot crack them all; slow hashes (bcrypt, scrypt, Argon2) make each guess expensive. Key exchange (Diffie-Hellman) lets two sides agree a shared key over a network others can read. Symmetric encryption uses that one shared key; asymmetric uses a public and private key pair, and a PKI is the system of certificates that vouches for whose public key is whose.
Read next
- TLS and certificates Encryption plus proof of identity: the server shows a certificate for the name, signed by a trusted authority.
- Password strength and rate limiting Why guessable passwords fall to repeated tries, and the defences that stop them.
- Certificate chain A server's certificate, signed by an issuing CA, whose certificate a root signed: the path a client follows to someone it trusts.
- VPN Packets wrapped, encrypted, in UDP to a VPN server, which unwraps them on the far side.
- Encoding and decoding Rewriting bytes as safe text by a public, keyless recipe — so it always decodes straight back and protects nothing.
- Password cracking Recovering a password offline by hashing guesses from a wordlist (optionally mangled by rules) until one matches.
- Cryptographic hash A one-way function that turns any data into a short fixed-size fingerprint, so the same bytes always give the same digest and no one can find two inputs that share one.
- Salted password storage Storing a password as a hash of the password plus a per-account random salt, so a precomputed table is useless and two accounts with the same password store different hashes.
- Data states The three places a piece of data can be: kept on a disk (at rest), travelling between machines (in transit), or held by a running program (in use). Each needs its own protection.
- Tokenisation Swapping a sensitive value for a random stand-in, the token. The real value stays in one guarded place, the vault, and every other system holds the token.