Isn't it just as likely as getting any other number though? Like guessing is less likely as the range increases but getting any number should be just as likely as any other number in the range right?
Maybe I'm misunderstanding though, or just missed the joke altogether
Technically it's just as likely as any other exact number, but you could ask, for example, what is the probability of N out of the 48 bytes being zeros. The mean is around 2, they had 47. The probability of even half of the bytes being zeros is mindbogglingly small.
I'm not talking about a specific key, I'm talking about whole classes of them. If you get a 4 it's practically guaranteed you fucked up and didn't just randomly get a 4. The chance is small enough to not even be worth considering.
Nah, if you get anything smaller than a quardrillion as you key you should immediately start looking for the bug. The chance of that happening is about 1 in 2.5*10101. Even if you generated a billion keys a second for a billion years, the chance of getting just one key below a quadrillion is around 1 in 1076. It's just never going to happen. Even if you got every expert on Earth to check your code, it's still more likely to be buggy than you actually getting a 4 with a working algorithm.
Just as with ANY other number... one in a specific range is just as possible as one in any other similar big range. If you get two or even more... than you should worry. And thats what happened here. 4 alone shouldnt worry you
Like I already said, we do 't care about specific numbers, where you'd be right. Numbers aren't equal. A very small key is easy to factor. Nobody cares whether your key is in the range of 1090-10100 or 10100-10110, which are indeed equally likely to the range 1-1010. A single 4 would be extremely worrying for something this critical.
Just because you have infinite monkeys eternally typing at typewriters doesn't mean that it must take eons for them to write Shakespeare. One of them could happen to get it right on the first try.
Ai increased hardware prices too much. Nobody can effort infinite pcs/phones/whatever digital medium for them to all write on. So it must be physical writing
Not necessarily. Infinite does not contain everything. There are infinite numbers between one and two, and none of them are 3. Of course this boils down the rule of what range are we defining for it, but monkeys randomly hitting a typewriter is not necessarily in the range of Shakespeare.
The monkey will have some sort of logic while button pushing, like buttons further on the keyboard from it's comfortable hand position will be pushed fewer, every button it pushes will probably be in a closer vicinity to the previous button it pushed, buttons at the centre will be pushed more than the sides, etc.
But of course if you say that the monkey will push buttons truly randomly like a machine and not a thinking creature, then yes there will be Shakespeare.
Well, metrics like "probably" or "fewer" don't really matter when speaking of infinity. Even if only one in a billion monkeys even type a second letter, it's still an infinite amount of them that do.
But you are right: Infinite doesn't always have the same parameters. If for example the A key was busted, an infinite number of monkeys still would never type shakespear since it's fundamentally impossible to do that.
We need to assume that each letter could theoretically be typed (no matter how improbable), including non letters and special characters like spaces, commas and so on. Only then can we also assert that in all those infinite tries, an infinite number of them will produce perfect copies of any literature.
Except that randomly hitting typewriter is in the range of shakespeare. Even if some buttons are less likely to be pressed (as long as it's a non-zero probability), in context of infinity that doesn't matter. So your analogy of number sampling is inaccurate. A more accurate example would be: if you sequentially sample numbers 1 and 2 infinite times, is it possible that at some point you get a very long and exact string of numbers? Yes, it 100% possible.
Didn’t they come to the conclusion recently that a monkey typing away forever would just infinitely spew out random garbage forever and never type Shakespeare?
The way the algorithm works you generally have a byte array and randomize each byte. They might have just not used their iterator index or something, they claimed it was a "bad algorithm" and they signed a faulty batch of certificates, but why they were rolling their own certificate generation algorithms is beyond me, the existing ssh libraries already do random properly. The trust in the chain comes from proper handling, not having better random numbers.
If we want to be technical, it looks like they either ran a random number generator that returns an 8 bit value, or they somehow truncated a bigger value to just 8 bits. This is evident based on their 7 other keys that have been discovered, all less than 256.
It's just very poor practice. Functionally, this example, its "fine".
You will understand when you've seen large functions with dozens of goto statements, the execution step skips around in a way that becomes nearly impossible to follow statically.
It also doesn't help, that everything you can do with goto's, can be done without... in a much nicer and cleaner way.
For RSA you actually start with a one in the most significant digit, generate the rest and test for a bunch of low factors and then several rounds of probabilistic checks.
ECDSA keys are just random numbers. There are few enough numbers in the key space that don’t work mathematically that you can just use rejection sampling until one works, but if you generate a random 384-bit number it has a very high likelihood of being a valid P-384 private key. Primes are sparse enough that you have to be careful how you generate them.
You could, in principle, run a bunch of statistical tests of randomness on your number and reject if it fails them, such as “it must have 48-52% 0s in its binary representation” but at that point you’re maybe getting a single stronger key but you’re systematically weakening your key generation process by rejecting mathematically valid keys.
NIST P-256 which uses ECC was suspected as "sus" and some EU and CN companies don't use it thinking its having a backdoor by NSA ( Lot of tools marks its as "sus" also, lol)
y^2 = x^3-3x+b ( mod p )
b being a constant and NSA didn't explain how they came up with the constant. The seed used to generate the curve parameters was never explained by NSA.
To this date P-256 is widely used on ECDH and ECDSA are most widely used elliptic curve cryptography standard.
Firstly these are two seperate incidents. They happened to be reported within hours of eachother.
The 4 memes comes from a set of (10?) private keys that managed to get into the main branch despite being only for testing. This renders a company which has served 60 million certificates that browsers and other services have trusted as deeply unsecure. Spoofable certificates of that type will be valid up to 2039. These private keys are mostly two digit numbers, and one of them is the number 4.
One of the root certificate authorities, you know the ones who vouch for all HTTPS trafic, used the private key of 4. Which by itself is excusable as we do expect it to happen eventually however they were then within moments found to have generated 7 more private keys all under 300
There is absolutely no way that this was the actual cause, the impossibility of getting a specific random number that many times in a row is the reason that private keys work. There must have been an error in the generator that caused unexpectedly low numbers.
A Servic for Certificates created extremely weak certificates (think of it like a password wich is "esad83647hsgs73847..." but they just did "4" wich is easily to be found out which creates a big issue because if you can find out a certificate you can to pretend to be the holder of this certificate.
1.6k
u/tiny_simulacrum Oct 23 '26 •
Don't worry, eMudhra learned their lesson. Now they run it between 1384 and 2384 .
598
u/eruciform Oct 23 '26 •
857
u/film_composer Oct 23 '26
Just because you have infinite monkeys eternally typing at typewriters doesn't mean that it must take eons for them to write Shakespeare. One of them could happen to get it right on the first try.
225
u/BlueTexBird Oct 23 '26
Wasn't the story that they accidentally ran an RNG from 1 to 384 instead of 1 to 2^384? Lmao
119
u/setibeings Oct 23 '26 edited Oct 23 '26 •
If we want to be technical, it looks like they either ran a random number generator that returns an 8 bit value, or they somehow truncated a bigger value to just 8 bits. This is evident based on their 7 other keys that have been discovered, all less than 256.
https://arstechnica.com/security/2026/10/the-internet-goes-on-high-alert-after-discovery-of-8-compromised-tls-certs/
Edit: or they were just lazy and wanted private keys they could memorize.
56
u/TuttoDaRifare Oct 23 '26
The probability is low, but not zero
29
u/QuantenWitzbold Oct 24 '26
Did anyone mentioned the relevant xkcd-joke yet? https://xkcd.com/221/
14
u/Last8Exile Oct 24 '26
13
u/frikilinux2 Oct 23 '26
Is there test for eliptic curves?
For RSA you actually start with a one in the most significant digit, generate the rest and test for a bunch of low factors and then several rounds of probabilistic checks.
13
u/TechcraftHD Oct 24 '26
first mistake was running it from 1 to 2384 and not from 2370 to 2384 or something
13
u/ItsOmniss Oct 24 '26
When you return "i" instead of "key"
11
u/skeld_leifsson Oct 23 '26
Ask a LLM, it will return 17
4
u/colonel_vgp Oct 24 '26
But that 4 is randomly chosen by a dice roll.
4
u/Euphorix126 Oct 24 '26
I mean, what are the odds?!
8
u/horenso05 Oct 24 '26
I have been on vacation for the last two weeks... can some explain the resent 4 and PHP memes? There was some vulnerability with 4 as a private key?
3
u/Honest_Relation4095 Oct 24 '26
4 is a random number.
2
u/Rebellion2297 Oct 24 '26
There is absolutely no way that this was the actual cause, the impossibility of getting a specific random number that many times in a row is the reason that private keys work. There must have been an error in the generator that caused unexpectedly low numbers.
3
u/Random_-account Oct 23 '26
Mine returned SYNTAX ERROR
2
u/Any-Set-1587 Oct 23 '26
isn't it 7?
1
u/KatanaDelNacht Oct 24 '26
"The closer we are to danger, the farther we are from harm."
1
u/Even_Shallot6345 19d ago
maybe it just returned our api keys
-9
u/Important_Grab3544 Oct 24 '26
Hello, I am a native AI vibe coder, what does 4 mean? I do seven figures a year.