Oakener Net Notes
oakener menu › L7_application

L7_application · a hands-on crash course · about 40 minutes

How the little padlock works

Every HTTPS page you open uses seven ideas at once. Learn them one at a time, in this order. Each stop gives you one sentence to remember, an everyday comparison, and a live experiment running real cryptography in your browser.

  1. STOP 1 ✓Hashes & MD5Fingerprints for data
  2. STOP 2 ✓AESOne key locks and unlocks
  3. STOP 3 ✓RSAA public and a private key
  4. STOP 4 ✓CertificatesA passport for websites
  5. STOP 5 ✓SSL / TLSThe handshake that ties it together
  6. STOP 6 ✓Cipher suitesThe recipe both sides agree on
  7. STOP 7 ✓Chain & your dataCookies, payloads, temp files
0 of 7 stops learned
1

Building block · Integrity

Hashes, and why MD5 is retired

A hash turns any data into a short fingerprint. Change one letter and the fingerprint changes completely, so anyone can tell if data was altered.

Think of it like

A fingerprint. It identifies a person without containing the person. You can't rebuild someone from their fingerprint, and two people should never share one.

MD5 is a fingerprint scanner that attackers learned to fool: since 2004 they can make two different files with the same MD5 fingerprint.

Remember

  • MD5 (128-bit) and SHA-1 (160-bit) are broken. Never use them for security.
  • SHA-256 and SHA-384 are what TLS and certificates use today.
  • MD5 is still fine for spotting accidental file corruption.
  • For passwords use a slow hash: Argon2id, scrypt or bcrypt.

Try it · the avalanche effect

Change one character in either box
2

Building block · Secrecy

AES: one key to lock and unlock

AES is a symmetric cipher: the same secret key encrypts and decrypts. It's very fast, so it encrypts every byte of your HTTPS traffic.

Think of it like

A lockbox with one key, and you and your friend each hold a copy. Fast and strong, but it raises a question: how do you hand your friend a copy of the key without someone copying it on the way? Stop 3 answers that.

Remember

  • Key sizes: 128, 192 or 256 bits. Blocks are always 128 bits.
  • The mode matters as much as the key:
ModeVerdict
GCMUse it encrypts and detects tampering
CBCLegacy padding-oracle attacks
ECBNever identical blocks leak patterns

Try it · encrypt, tamper, decrypt (AES-GCM)

Real Web Crypto, nothing leaves your browser

Press Encrypt to see the ciphertext.

Try decrypting normally, then tamper with a byte or change the password and decrypt again.

3

Building block · Identity

RSA: a public key and a private key

RSA uses a key pair. The public key can be shared with anyone; only the private key's owner can create a signature that the public key verifies.

Think of it like

A wax seal. Everyone knows what the king's seal looks like (public key), but only the king owns the ring that makes it (private key). A sealed letter proves it came from the king.

In modern TLS, RSA does exactly this: it signs to prove identity. It no longer carries the AES key; that job moved to ECDHE (stop 5).

Remember

  • Security comes from how hard it is to factor n = p × q back into p and q.
  • Use 2048-bit keys minimum, 3072-bit for long-lived keys. 1024-bit is dead.
  • RSA is ~1,000× slower than AES, so it only does the handshake, never bulk data.
  • ECDSA P-256 does the same job with smaller, faster keys.

Try it · toy RSA with tiny primes

Real RSA uses primes over 300 digits long
4

Putting blocks together · Trust

Certificates: a passport for websites

A certificate says "this public key belongs to shop.example.com", and a Certificate Authority (CA) vouches for it with an RSA or ECDSA signature over a SHA-256 hash.

Think of it like

A passport. It shows a name (the domain), a photo (the public key), an expiry date, and the stamp of a government you trust (the CA). Your browser is the border officer: it checks each detail before letting you in.

Remember

  • Format: X.509, usually a PEM file starting -----BEGIN CERTIFICATE-----.
  • Chain: root CA (built into your device) → intermediate CA → your site's cert.
  • Browsers match the hostname against the SAN field.
  • The server must send its cert and the intermediates.

Try it · be the browser

Pick a situation and see what the browser decides
5

The protocol · Everything at once

SSL / TLS and the handshake

TLS is the protocol that runs the show. In one handshake it checks the certificate, agrees on a fresh AES key, and then encrypts everything. "SSL" is its retired ancestor; people still say "SSL" out of habit.

SSL 2.01995Broken
SSL 3.01996Broken · POODLE
TLS 1.01999Deprecated · BEAST
TLS 1.12006Deprecated 2021
TLS 1.22008OK with good suites
TLS 1.32018Best choice

Try it · watch the packets fly

Next, Play all, or the ← → keys
plain text · anyone on the network can read it encrypted with AES-GCM shared secret appears
What Eve on the café Wi-Fi sees
6

The recipe · Reading the name

Cipher suites: the recipe card

A cipher suite names which algorithm does each job. Once you know stops 1 to 5, you can read one like a sentence. The colors below match the stops.

TLS_protocol ECDHEkey exchange · stop 5 _ RSAsignature · stop 3 _WITH_ AES_128_GCMencryption · stop 2 _ SHA256hash · stop 1

Try it · cipher suite decoder

Paste any suite name (IANA or OpenSSL style)
7

Beyond the handshake · Trust and your data

The certificate chain, cookies and temp files

Trust flows down the chain, from a root your device already trusts to the site's own certificate. TLS then protects cookies and payloads only while they travel. On disk they are plain again.

Think of it like

The chain: the government (root) authorizes a passport office (intermediate), which issues your passport (end-entity certificate). The border officer trusts the government, so the passport is accepted.

Your data: TLS is an armored truck. Money is safe inside it, but once it's unloaded into an unlocked drawer (the disk, a temp file, a log), the truck can't help.

Remember

  • Root signs itself and lives in your device's trust store. Intermediate and end-entity certificates are sent by the server.
  • The end-entity (leaf, "public") certificate is public on purpose. Its private key must never leave the server.
  • Mark session cookies Secure; HttpOnly; SameSite.
  • Data at rest needs its own protection: Cache-Control: no-store, file permissions, disk encryption.

Try it · walk the chain

Click a certificate, then run the check
↓ signs ↓ signs
Five checks, from the leaf up to the root.

    Try it · what can an eavesdropper see?

    Someone on the same café Wi-Fi logs everything

    Try it · build a safe cookie

    Tick the flags and watch which attacks get blocked

    Check yourself

    Seven questions, one per stop

    Score: 0 / 7

    Cheat sheet

    The whole story in eight cards

    Hash · SHA-256Fingerprint that reveals any change. MD5 and SHA-1 are broken.
    AES-GCMOne shared key encrypts all the traffic and catches tampering.
    RSA / ECDSAPrivate key signs, public key verifies. Proves who you're talking to.
    CertificateCA-signed passport binding a domain to its public key.
    TLS 1.3Handshake: check the cert, agree a fresh key with ECDHE, then encrypt.
    Cipher suiteThe recipe: key exchange + signature + cipher + hash.
    Chain of trustRoot (in your device) → intermediate → leaf. Server sends the last two.
    Data at restTLS stops at the endpoints. Secure cookie flags, no-store caching and disk encryption cover the rest.