All resources
Daily Learning · Security Engineering: A Guide to Building Dependable Distributed Systems

How one repeated random number broke the PlayStation 3

Wednesday, 29 July 2026
How one repeated random number broke the PlayStation 3

🎯 You'll understand how digital signatures work, why they need a fresh random number each time, and how reusing that number let hackers pull Sony's secret master key out of thin air.

Let's start with a puzzle. In December 2010, a group of hackers called fail0verflow walked on stage and announced they had stolen the most protected secret inside the PlayStation 3: its master signing key.

Here's the strange part. Sony's math was excellent. Their cryptography was world-class, textbook-correct, and truly unbreakable on paper.

And yet they lost everything — permanently.

To understand how, we need to build up the idea piece by piece. Let's go slowly.


Step 1: Why the PS3 checked signatures at all

Sony had a simple goal: only Sony-approved code should run on the console.

If any random program could boot on a PS3, people would run pirated games, cheat online, or install rival software. So Sony added a gatekeeper.

Program tries to run
        │
        ▼
   Is it signed by Sony? ──── No ──► Refuse to boot
        │
        Yes
        ▼
   Run the program

The console refuses to run anything unless it carries a valid signature from Sony.

What is a digital signature?

A digital signature is a small piece of proof, attached to a file, that says "the real owner of a secret key approved this exact file."

Think of a wax seal on a royal letter. Anyone can see the seal, but only the king owns the stamp that makes it. You can verify the seal without owning the stamp.

That's the key idea: verifying is public, but creating a signature needs a private secret.


Step 2: The two keys behind a signature

Signatures use a pair of keys that belong together.

What is a public/private key pair?

  • A private key is a secret number only the owner has. It's used to create signatures.
  • A public key is a matching number everyone can see. It's used to check signatures.
PRIVATE KEY (secret)  ──►  makes signatures
PUBLIC KEY  (shared)  ──►  checks signatures

Sony kept its private key locked in a vault. It put the matching public key inside every PS3. So each console could check signatures, but no console could create them.

That's why this is safe in theory: even if you crack open a PS3 and read every chip, you only find the public key. You still can't sign anything.


Step 3: The specific math Sony used — ECDSA

Sony didn't invent their own scheme. They used a real, respected algorithm.

What is ECDSA?

ECDSA stands for Elliptic Curve Digital Signature Algorithm. It's a well-tested, widely-used way to make digital signatures using a branch of math called elliptic curves.

You don't need the deep math. Just know this: ECDSA is genuinely strong. Guessing Sony's private key by brute force would take longer than the age of the universe.

Sony picked strong crypto. That part was not the mistake.

Step 4: The hidden ingredient — the nonce

Here's where it gets interesting. Every time ECDSA creates a signature, it needs one extra secret ingredient: a fresh random number called k, the nonce.

What is a nonce?

A nonce is a "number used once." It's a throwaway random number mixed into a single operation, then never reused.

Think of it like a fresh, random spice added to each dish. It changes the flavor of every signature so no two look alike — even for the same file.

An ECDSA signature is actually a pair of numbers, often written (r, s):

signature = (r, s)

r  ← comes from the random nonce k
s  ← mixes together: the nonce k, the message, and the private key

The absolute, non-negotiable rule of ECDSA is:

k must be unique and unpredictable for every single signature.

If you follow that rule, the private key stays hidden inside s forever. The math is designed so you can't untangle it.


Step 5: Sony's one fatal mistake

Sony used the same k. Every single time.

Instead of rolling a fresh random number for each signature, they reused one fixed value. Every signature they ever made shared the same nonce.

That single shortcut quietly destroyed everything. Here's why.


Step 6: How reusing k leaks the private key

Let's see the actual mechanism. Suppose Sony signs two different messages with the same k.

Call the messages m1 and m2. Their signatures are:

Signature 1:  (r,  s1)     for message m1
Signature 2:  (r,  s2)     for message m2

Notice something already: the r values are identical. Since r comes only from k, and k is the same, both signatures start with the same r. That's the visible fingerprint of the mistake.

Now the collapse. In ECDSA, s is built like this (simplified):

s = ( hash(message) + private_key · r ) / k

Write it out for both signatures:

s1 = ( h1 + d·r ) / k
s2 = ( h2 + d·r ) / k

where h1, h2 are the hashes of the two messages, and d is the secret private key.

Watch what happens when we subtract them:

s1 - s2 = ( h1 - h2 ) / k

The d·r terms cancel out! Now we can solve for the nonce k:

k = ( h1 - h2 ) / ( s1 - s2 )

Everything on the right side is public — the two signatures and the two message hashes. So the nonce falls right out.

And once you know k, plug it back into one signature equation and solve for the private key d:

d = ( s1·k - h1 ) / r

Done. The private key is now yours.

No supercomputer. No brute force. Just two signatures and a bit of algebra. That's what fail0verflow did on stage.

What is a hash here?

A hash is a fixed-size fingerprint of a message. Feed in any file, get out a scrambled number that uniquely represents it. In the formulas above, h1 and h2 are just the fingerprints of the two signed messages, and they're computable by anyone.


Step 7: The fix was almost insultingly simple

The correct behavior was one line of discipline:

Option A — a fresh random nonce every time:

k = secure_random()   // brand new, unpredictable, per signature

Option B — derive it safely from the message itself (RFC 6979):

k = HMAC(private_key, message)

What is RFC 6979?

RFC 6979 is a published standard that says: instead of trusting a random-number generator, compute k deterministically from the private key and the message. Same message → same k, but different messages → different k, and an attacker can't predict any of them.

What is HMAC?

HMAC is a keyed hashing function — a fingerprint that also mixes in a secret. HMAC(private_key, message) produces a number that's unique per message and impossible to guess without the private key. Perfect for a nonce.

Every correct ECDSA implementation already did one of these. Sony's didn't.


Step 8: The part that made it unfixable

Now the truly brutal lesson. A normal bug gets patched. Push an update, done.

But Sony's private key was the root of trust for the entire platform.

What is a root of trust?

A root of trust is the one anchor everything else is built on. On the PS3, every console trusts Sony's public key, and that trust flows down to every game and update.

        Sony's private key  (the root)
                 │  signs
                 ▼
        System software / games
                 │  trusted by
                 ▼
        Every PS3 in every living room

The matching public key was burned into millions of consoles already sitting in people's homes. You cannot recall it. You cannot patch a key that's physically fused into hardware you no longer control.

So once the private key leaked:

  • Every signature Sony ever made could be forged by anyone.
  • Anyone could sign their own code and every PS3 would happily run it.
  • There was no way to revoke the key without bricking the whole fleet.
One reused nonce, in one signing routine, invalidated the security of an entire platform — retroactively, permanently, for every unit ever shipped.

Step 9: The real lesson about cryptography

Here's the mindset shift. Sony's algorithm never broke. ECDSA is still trusted today. The math did exactly what it promised.

The failure was in how the math was used — the operational details around it.

Strong cryptography doesn't make a system secure. It just moves every possible failure into the places nobody watches: key management, randomness, and how the pieces are wired together.

Crypto is unforgiving in a specific way. A weak lock might let one clever thief through. But a crypto mistake often gives away everything at once — with no margin, and sometimes no way back.

Cryptography is a tool, not a solution. A perfect hammer still can't save you if you hit the wrong nail.


The core lessons

  • A signature proves origin. The private key creates signatures; the public key (which everyone has) only checks them.
  • ECDSA needs a nonce k for every signature, and it must be unique and unpredictable. This is a hard rule, not a suggestion.
  • Reuse the nonce and the math collapses. Two signatures with the same k let anyone solve for the private key with basic algebra — no brute force needed.
  • The fix is trivial: fresh random k, or derive it via RFC 6979 as k = HMAC(private_key, message). The discipline is what matters, not the difficulty.
  • You can't patch a leaked root key baked into hardware. When the trust anchor is permanent, one mistake is permanent too.
  • Strong crypto doesn't equal a secure system. The real risks live in key management, randomness, and integration — the quiet corners where nobody's looking.

Want this kind of thinking applied to your business?

Book a free 30-minute discovery call — we’ll show you your highest-value first automation, no jargon, no obligation.

Book a discovery call