Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 01 · Security · Think Like an Attacker · about 21 min to read

Play it as a journeyTutor comes with a plan

Crypto done wrong: nonces, oracles and timing

Cryptography Foundations
Cryptography Foundations · Open board

The five tools of cryptography. This lesson is about the ways a correct tool still fails when it is used wrongly.

Before you start. Cryptography Foundations gave you encryption with a key, the hash, HMAC and the signature, and showed AES-GCM refusing to decrypt a changed message. Authentication showed passwords stored with a salt and a slow function, and a tag compared with a safe compare. The key that has to change (secrets and key management) showed a 12-byte nonce sitting in front of an encrypted file. This lesson explains what that nonce is for and what happens without it.

Lesson 18 of 39 in Security

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • December 2010: one number used twice
  • A nonce: a number you must use only once
  • A CSPRNG: random numbers an attacker cannot guess
  • A padding oracle: an error message that leaks the secret
  • A timing attack: a comparison that leaks how far you got
  • A KDF: one secret in, the right keys out
  • 1. Nonce reuse with AES-CTR
  • 2. The same mistake in a signature: ECDSA with a repeated k
  • 3. Weak randomness
  • 4. A padding oracle, one block
  • 5. Timing, counted and measured
  • Trade-offs and where this lives

Terms it explains: nonce, CSPRNG, padding, oracle, padding oracle, timing attack, constant-time compare, KDF, Common mistakes, 256 - 2, AES-GCM, asymmetric / public-key, certificate, cryptographic hash, Diffie-Hellman, digest, digital signature, ECB penguin, forward secrecy, HMAC, key distribution, KMS/HSM, RSA / ECC, symmetric encryption.

Review Security