Lion Cipher Lab

Break PKCS#1 v1.5 with Bleichenbacher's Padding Oracle

Why it matters

PKCS#1 v1.5 RSA encryption padding is still deployed across the internet -- in TLS, in VPNs, in load balancers -- decades after Daniel Bleichenbacher showed in 1998 that a server which merely reveals whether a ciphertext was 'correctly padded' leaks enough to recover the plaintext one adaptive query at a time. In 2017 the ROBOT researchers re-found that exact oracle live in F5, Citrix, Cisco, and other production stacks, because the leak does not need to be an API that says yes/no -- a different TLS alert, a slightly different response time, or a distinguishable error message is enough. Once…

What you'll learn

Steps in this lab

  1. What Bleichenbacher's attack is, in one breath
  2. Why one leaked bit is a total break (the idea before the code)
  3. Set up a clean workspace
  4. Build the toy: a 256-bit RSA key + PKCS#1 v1.5 padding
  5. Build the one-bit padding oracle and the target ciphertext
  6. Implement Bleichenbacher's interval-narrowing attack
  7. Run it: watch the interval collapse to the secret
  8. ROBOT (2017): the oracle is rarely a literal API
  9. The defence: OAEP, and 'make the error indistinguishable'
  10. The judgment call: why this bug outlived its own paper

Open the full interactive lab →