r/ProgrammerHumor • • Oct 23 '26

Meme privateKey

Post image
26k Upvotes

239 comments sorted by

View all comments

Show parent comment

1.4k

u/SpaceCore0352 Oct 23 '26

TLS certificates are special files that servers use to prove they really exist at the IP address they say they do (otherwise you get coffee shop hackers intercepting messages and pretending to be the server).

For the user's browser to verify a TLS certificate, it has a stored list of "top-level" TLS certificates that your everyday website can register their certificate with. So when you get the website's certificate, you can algorithmically prove it was verified at the top level, and therefore is legit.

Some of the top-level certificates had trivially breakable encryption key numbers that were recently discovered and removed. One of them was the number 4.

621

u/pdromeinthedome Oct 23 '26

But there is room for improvement. They could upgrade to 5.

215

u/kaurismus Oct 23 '26

I mean it's 25% better.

72

u/GRex2595 Oct 23 '26

I don't know this algorithm, but I think 5 is probably 100% worse actually.

107

u/SilasTalbot Oct 23 '26

No dude 5 is prime and 4 is not. Don't you know about encryption primes are better.

74

u/HeavyCaffeinate Oct 23 '26

That's why you gotta use a non-prime, they'll never expect it

38

u/DeusExMachina24 Oct 23 '26

Or don't encrypt the data at all. Hackers always expect encryption. Check mate.

23

u/DezXerneas Oct 23 '26

For a looooooong time, the password for one of my accounts was 123456. They stopped letting you do that about a year after I created my account. So teenage me's thought process was that a password that's not even allowed anymore should be harder to crack than any password that is.

It's the same service that emailed me the plaintext password when I was looking for it years later lmao. Wonder why they don't exist anymore.

10

u/TorchedBlack Oct 23 '26

12346? Thats the combination on my luggage!

→ More replies (1)
→ More replies (1)
→ More replies (1)

13

u/ancalime9 Oct 23 '26

Works off TV volume rules

→ More replies (1)
→ More replies (1)

32

u/fghjconner Oct 23 '26

Relavent XKCD (alt text)

31

u/easyEggplant Oct 23 '26

More relevant XKCD: https://xkcd.com/221/

20

u/Mozeliak Oct 23 '26

This is one of the weirder ones where it has been relevant in conversation since the posting, but suddenly has become headline news basically.

13 years after the original post??

→ More replies (4)

9

u/Elkku26 Oct 23 '26

There always exists a relevant XKCD, and there always exists a more relevant XKCD. One day we'll discover the most relevant XKCD, which holds all the answers to the universe.

→ More replies (1)

6

u/antiduckdude24 Oct 23 '26

To give them credit, they did figure this out. That's why their other keys were 56 66 115 155 156 230 and 237

14

u/madcow_bg Oct 23 '26

Well actually the number needs to be decomposable to 2 prime numbers, and 4 is literally the smallest possible private key... next is 6...

→ More replies (3)
→ More replies (1)

60

u/100percent_right_now Oct 23 '26 edited Oct 24 '26

for ECC everyone else uses mostly numbers between around 115 quatturovigintillion and 3.94 quinquatrigintillion

115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,936

and

3,940,200,619,639,447,921,227,904,010,014,361,380,507,973,927,046,544,666,794,829,340,424,572,177,149,721,061,141,426,625,488,491,564,080,662,799,030,681,500

for some comparison.

Of course they can use smaller numbers, but big number more better. Make brain happy.

11

u/Isoldael Oct 24 '26

Getting cookie clicker flashbacks here...

→ More replies (1)

24

u/TheeAntelope Oct 23 '26

Why not have an RNG generate 100 numbers, and then that string of 100 numbers is they key? Why would you not put something in to prevent the key number from being 1 or 2 or even under 10 digits? Why not precede them with 99 zeros first and have it always be a 100-digit number?

So many things.

66

u/SpaceCore0352 Oct 23 '26

4 preceded by 99 zeroes is still 4. These aren't text passwords, the number value is literally directly used in the encryption algorithm.

But yes, in a sane world it's not possible to confuse your test byte with a full-length 384 bit key.

64

u/MTGandP Oct 23 '26

To be clear, nobody decided to make the key be 4. That would be a terrible idea. What happened is they set it to 4 for testing purposes, and then they forgot to change it. The key was supposed to be a random 115-digit number.

→ More replies (1)

15

u/Verpous Oct 23 '26

Technically, all those things reduce entropy

8

u/Epse Oct 23 '26

You're supposed to pick a 4096 bit random number (huge, many digits). Random of course means that 4 has just as much of a chance of being picked, but the rules say that the number also can't be less than 256 . Someone made a big oops and overrode those rules, setting it to 4. A bored person just trying the first few numbers stumbled across 4 being valid

11

u/Tetha Oct 23 '26

And this will require weeks to months of patching everything, because certbundle management across many applications and languages is a clusterfuck. Especially once containers are involved.

Sorry for sounding bitter, but the PHP 9.2 vulns now go straight into this shite. At least it was just 1% of revenue for eMudhra. It could have hurt the company otherwise! Who cares about the thousands of hours we now have to spend cleaning up their crap.

7

u/Electronic_Age_3671 Oct 24 '26

Wait that's really what happened?? That's insane

→ More replies (3)