Lion Cipher Lab

Take apart UUID versions 1, 4 and 7, and measure which ones leak or can be guessed

Why it matters

UUIDs are everywhere: order numbers, document links, session records, API paths. Developers often pick one version without knowing what is inside it, and then make a security argument about it: 'nobody can guess that'. Sometimes that is true and sometimes it is badly wrong. A version 1 UUID carries the exact time it was made and, on many machines, the computer's network card address. A version 7 carries the time to the millisecond. A version 4 carries 122 random bits, if the program used a proper random source. This lab makes you take each one apart by hand, so you can read any UUID you meet…

What you'll learn

Steps in this lab

  1. What a UUID is, and the question this lab answers
  2. Set up: Python, a folder, a terminal
  3. Take one of each apart by hand
  4. What your uuid1 just told everyone: when, and which machine
  5. Measure how much of a neighbour id is really unknown
  6. Why version 4 holds: where its 122 bits come from
  7. Honest negative 1: a v4-SHAPED id is only as good as its generator
  8. Honest negative 2: version 7 cannot be guessed, but it tells time
  9. Honest negative 3: why people choose v7 anyway (measured in SQLite)
  10. Hard to guess is not access control
  11. Do it better: a short decision checklist

Open the full interactive lab →