r/ProgrammerHumor
•
u/David_2107
•
Oct 22 '26
•
2
Meme notInsecureJustUnlucky
/img/dd9mi2hpa2xh1.jpeg
13k
Upvotes
4.5k
u/beisenhauer Oct 22 '26
Some numbers are more random than others.
3.1k
u/AphroditesViolet Oct 22 '26 edited Oct 22 '26 •
Full context for anyone wondering how the hell this happened:
8 formerly globally trusted keys from eMudhra, a former Certificate Authority were brute forced. The keys have a maximum size of 384 bits, one of the keys was the number 4.
According to a company representative the 8 keys (which were all 1 byte or less) were created for a test, and therefore not subject to security tests. Due to a scripting error, they were significantly less secure than intended as they were supposed to be full strength keys, and then not disposed of after the test. Then, due to the set of test keys sharing a similar name with the real proven to be secure keys, the test keys were then sent to production.
The private keys in base ten are:
4, 56, 66, 115, 155, 156, 230, 237
And now the company announced they’re “voluntarily” leaving the CA industry after Google and Mozilla announced their root certificates were being removed from their stores, with IoT and other non updatable devices trusting their certificates until 2039
1.1k
u/Pim_Wagemans Oct 22 '26 •
Relevant xkcd: https://xkcd.com/221/
915
u/EndMaster0 Oct 22 '26
There were multiple keys. The longest was 3 characters. It looks like they had selected random numbers between 0 and 384 instead of 2384
237
u/bilvy Oct 22 '26
There were 8 keys each with a value under 256. It was not just bad luck
78
u/GRex2595 Oct 22 '26
Complete incompetence by that CA. Hopefully they never issue certificates again.
85
u/jhill515 Oct 22 '26
"A random number generator that always returns 1 is still a random number generator. At any point, a random bit flip could occur. So if there's a 1/2^384 probability of selecting any arbitrary unsigned number in the nominal case, there's likely still an equal probability with this Constant-1 Generator. Like a coin, just keep flipping until it lands on edge!"
- Paraphrased from xkcd What-if
69
u/Tammbiee Oct 23 '26
I just asked a RNG yesterday to generate a random number between 1 and ten million. I planned on using that number as the population of my fictional city. It gave me the number 17... I now have a small camp as a capital city.
20
u/kuros_overkill Oct 22 '26
"Chosen by fair dice roll" -
37
u/White_C4 Oct 23 '26
There was a tweet that "defended" that private key debacle saying that the probability of 4 is the same as any other number. While true, I reject that premise based on chance. This was intentional.
18
u/GreatArtificeAion Oct 22 '26
Did Guido Mista make this?
33
u/qqqrrrs_ Oct 22 '26
They also got 56, 66, 115, 155, 156, 230, 237
44
u/Havatchee Oct 22 '26
That's funny but like, if there's some arbitrary lime where the number is too small to be secure because a brute force attack will find it too soon, this becomes a recursive problem. It's like starting the week on Tuesday to avoid Mondays being shit, you just make Tuesday the new start of the week making Tuesdays shit. So at our arbitrary line we can just chop off the front of the list. But now the same range after our line is insecure because it's too easy to brute force.
14
u/my_user_name_is_2 Oct 23 '26
xkcd 221
13
u/justforkinks0131 Oct 22 '26
context?
23
u/E-Sandy Oct 23 '26
def random_number():
return 4 # Chosen by fair dice roll. Guaranteed to be random
11
u/UniversalAdaptor Oct 23 '26
This is why when I want a big random number I generate a random number between a really big number and that same number divided by ten.
34
u/seba07 Oct 22 '26
Security by stupidity. Would you include single digit numbers when bruteforcing a private key?
9
u/SysGh_st Oct 23 '26
4 is as fair as any other random number though.
https://xkcd.com/221/
8
u/jump1945 Oct 23 '26
What are the chances all the *random* number would be number below 1000
6
u/Extension_Option_122 Oct 22 '26
I am in dire need of context
16
u/amatulic Oct 23 '26
Coincidentally, the number 4 is considered unlucky in Chinese culture, sort of like the number 13 in western culture.
4
u/UnpoliteGuy Oct 22 '26
No one would dare to guess anyway
8
u/regseb Oct 22 '26 edited Oct 22 '26
2^384==386(see Bitwise XOR (^))And so, it is normal for all the numbers (4, 56, 66, 115, 155, 156, 230, and 237) to be between 0 and 386.
3
u/apt-maintenance Oct 22 '26
Git pull apikey.env
3
u/miguescout Oct 22 '26
relevant xkcd
3
u/-Redstoneboi- Oct 23 '26 edited Oct 23 '26
sigh it's so ridiculously unlikely to get such a low number that it is within the same order of magnitude as the likelihood of
ZWZmZWN0Y2FwdHVyZWRzaW1wbGVzdHBpbmV2aXNpdG9ycG90YXRvZXNib25ld2Vla3JvYWRzanda25vd25zdGFyZnJpZ2h0ZW50YXNrZGlzaHplcm9oZWF2eXJvcGVwYXJ0eXBvZW1hdG1vc3Boto work as hash collision substitutes for your exact passwords for two different sites in a row, given that bcrypt uses 192 bits for its hash.apparently the website i used generates the base64 by stringing random lowercase english words together. not that it would help or hurt your odds.
3
u/Da_Vindicator Oct 24 '26
Funny if true. Too bad it’s impossible for the audited key generation tooling and process they had to generate such a result. Literally the only way to have created “4” was to manually bypass the tools and process they alleged to have done. Then they did it 7 more times, generated values as single scalars between 0-255 ,and “whoops we didn’t catch that” yeeted them into the world for about a year.
Sometimes incompetence is just a cover for fraud.
5
u/JakubDotPy Oct 23 '26
India
8
u/realmauer01 Oct 22 '26
Choosing a number it if an infinite set of numbers will have an infinitely small chance of getting predicted, but it won't be 0.
2
u/FacuA0 Oct 23 '26
Let me doubt on the fair 2384-sided dice roll.
2
u/speeddemon266 Oct 23 '26
I choose 66642069
2
u/Suppression_Gaming Oct 23 '26
It took less than an hour
2
u/Spare_Cupcake_8671 Oct 23 '26
Can someone tell me if something similar could happen while generating encryption keys where one of the prime numbers is 5?
1
u/duxie Oct 22 '26
37, just ask AI
1
u/botle Oct 22 '26
Likely story /s
1
u/ColdCalculus Oct 22 '26
The number is 17
1
u/Pure_Material_9235 Oct 22 '26
Mistah when he becomes a programmer.
1
u/Principle-Useful Oct 22 '26
11737769034171727117262602852672529800140303899283099876144481603279397390869192913946395492159038695470678472628285
1
u/misteryk Oct 22 '26
a number between 1-256*
1
u/GirthyPigeon Oct 22 '26
Maybe start with something in the billion range instead of 0?
1
u/JagneStormskull Oct 23 '26
The number is Pi.
1
u/GodlessAristocrat Oct 23 '26
4, 56, 66, 115? That's the combination to my luggage!
1
u/DirectConversation96 Oct 23 '26
but 4 is the first composite number
1
u/fugogugo Oct 23 '26
why 0 not included?
also I swear I've never seen random number generator spew out 0
1
u/Ok_Gear8209 Oct 23 '26
Management said ship it
1
u/Roraxn Oct 23 '26
Thinkers: "So we make it more likely to be at the end of the possibilities. that way it will take a long time to brute force it."
Hackers: "We just go backwards."
Thinkers: "So we just make somewhere in the middle!"
Hackers: "We just start somewhere in the middle."
Thinkers: "We'll do all three!"
Hackers: "We've been running all three this whole time."
This is not something you can outsmart. These are very simple security methods we have in essence. The problem was always that we were too lazy to out last the heat death of the universe. We still are. But things aren't any less simple, and the tools are just getting better.
1
u/osiris_89 Oct 23 '26
Putting the P in PRNG
1
u/Misato-best-woman Oct 23 '26
I got 184,903,294,857,203,948,572,039,485,720,394,857,203,948,572,039,485,720,394,857,203,948,572,039,485,720,394,857,203,948,572,039,485,720.
1
u/DickChubbz Oct 24 '26
Unfortunately for me, my brute force strategy starts at the top and counts down
-2
u/Alpha_wolf_80 Oct 22 '26
Reminds me of https://www.theregister.com/security/2026/10/20/indian-certification-authority-emudhras-private-keys-compromised-one-of-them-was-the-number-4/5304312