So are the public keys fixed-length? Because if this was RSA, I believe you would have to have a pretty short public key to get that as your private key.
Yes, in this case (P-384) weโre talking about a 384-bit private key and a 384-bit public key. The 384-bit private key is supposed to be randomly generated by the client and then the 384-bit public key is generated based on the private key. The incident in question was literally the number 4 being used as the 384-bit private key:
I might have misunderstood but I believe that after a series of 4s, there came 5, 6, 7, etc. Some bug caused it to overflow, get stuck on 4, and then start iterating from there. Something like that.
Nope. This was incompetence, they generated the key wrong. I don't know how. But it was.
Think of it this way.
Suppose the key was a proper key, and someone was guessing 100 digit numbers in no particular pattern. On the 4th try, they get it right. In that scenario, is there anything at all that would convince you they didn't know the key beforehand?
The entire boiled down version is that someone used testing artifacts in production by mistake. The real keys and the test keys were similarly named and someone didn't pay attention and fucked up. The string of events that led to it was a comedy of errors, but it wasn't some weird math...it was just using test stuff in production by mistake.
It looks a bit like they generated between 1 and 256, because there are 8 known bad keys below 256. It could just be coincidence that no keys are between 256 and 384, but my gut says 256 was the accidental upper bound.
Of course, from a security perspective, every number less than a billion might as well be 2.
64-bit keys are crackable with a little effort. The baby-step giant-step algorithm has square-root complexity, so the bit-length is effectively halved.
Well the public key is represented as its x-y coordinates modulo p, where p is prime number that's 384 bits long. The generator point coordinates are also 384 bits long each, so even when you multiply by a small number like 4, the result looks like a proper public key.
edit: oops forgot to mention that they are fixed length ๐
Yes absolutely. You have to be doing things non standard or home grown. The basic open source tools for creating keys wouldn't let you just do this, so they must have been doing something funny. But once the first mistake happens it is negligence to not notice and end up releasing it as the real public keys
Last I checked, it was that they didn't care when they were generating it. It was a test cert that got loose, so when they generated it, "4" looked stupid but that was okay. After they generated it, the "4" wasn't visible.
Somewhere there is something responsible for ensuring that these keys are cryptographically secure. Maybe you can't actually see the 4 as a person looking at the cert, but something should be checking that the keys aren't being generated in any way that a 4 could randomly show up unnoticed and compromise the security. Somebody had to mess up bad for there to be no checks against these types of mistakes.
View all comments
Show parent comment
30
u/GRex2595 Oct 23 '26
So are the public keys fixed-length? Because if this was RSA, I believe you would have to have a pretty short public key to get that as your private key.