r/OutOfTheLoop • • Oct 23 '26

Answered What's up with 4?

I know it's related to this PHP vulnerability fallout, and the memes are hilarious, but what does 4 have to do with it?

229 Upvotes

66 comments sorted by

•

u/AutoModerator Oct 23 '26

Friendly reminder that all top level comments must:

  1. start with "Answer: ", including the space after the colon (or "Question: " if you have an on-topic follow up question to ask),
  2. attempt to answer the question, and
  3. be unbiased

Please review Rule 4 and this post before making a top level comment:

http://redd.it/b1hct4/

Join the OOTL Discord for further discussion: https://discord.gg/ejDF4mdjnh

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

252

u/ClockworkLexivore Oct 23 '26

Answer: It's not related to the PHP vulnerability, but your confusion is understandable. It's been a busy week for the poor souls in IT.

Separate from the PHP issue, there was a certificate issue. When you visit websites your browser checks that website's certificate to make sure it's the real website and not some imposter. Those certificates are handed out by certificate authorities - companies whose whole job is to be trustworthy and vouch for other stuff on the internet.

One of those certificate authorities (eMudhra) messed up bad. Certificate creation involves a private key value that's a number hundreds of bits in size (so, 100+ digits long) and they were caught using keys like..."4". Or "115". eMudhra has said it was a combination of bugs and human error, but a lot of things would have to go wrong for that hilariously bad of a problem to happen.

Keys that small are easily broken, and if you break the keys of a certificate authority you can pretend to be them and trick anybody who trusts them, which is...most everybody. There's been a lot of work in the last few days with people scrambling around their systems to blacklist eMudhra so that they don't trust the wrong certificates.

(For extra humor, '4' as a random number has a history in the tech world; see this XKCD for an example. So it's extra funny that they actually used '4' in their screwup.)

20

u/Geoclasm Oct 23 '26

Cool, thanks! And yeah, I was familiar with that XKCD so I guess it does kind of sync up like some kind of cosmic universal coincidence.

40

u/Airowird Oct 23 '26

4 is also the lowest non-prime number!

I know this specific security issue is not related to prime factoring, but it's still funny that it's cryptography's worst nightmare.

1

u/HappensTense Oct 23 '26

Technically, 1 (or 0 depending on definition) is the lowest non-prime natural number!

17

u/JohnPaulDavyJones Oct 23 '26

0 isn’t a member of the naturals, and the convention has been to specifically exclude 1 from the primes for probably sixty years now. But if you were only taught the canonical definition of primality in school, I do understand how you could come to that conclusion about 1.

Including either 0 or 1 either breaks core concepts (like the classic sieve of Eratosthenes that every undergrad math major learns in their treatment of primes) or forces others to be reworded to intentionally exclude 1 (the Fundamental Theorem of Arithmetic, vis-a-vis prime factorization sets).

I took a seminar on number theory when I was in grad school, and you wouldn’t believe how much consternation the application of the canonical definition of primality to 1 creates. If you’ve taken an abstract algebra class then you’ve encountered the concept of a unit (e.g. the multiplicative unit or the additive unit of a field/greater order structure), and you’ve been shown that 1 is the multiplicative unit of the natural numbers, and 0 is the additive unit. In the modern conversation about primes, this is the special class that these two numbers get; we just label them “units”, which have quasi-prime properties but are not included with the primes, and we go on with the day.

11

u/HappensTense Oct 23 '26 edited Oct 23 '26

I was always taught that it's personal taste whether to include 0 as a member of the naturals, and that it's a matter of convention for individual mathematicians to specify. (Hence why you see "non-negative integer" used so much, as it's less ambigious.) There are good reasons to include 0 as a natural:

  1. Following the standard Peano axioms, you have 0 as the root element with the successor functions.
  2. It allows you to have an additive identity, which is real handy.

Likewise, I said 1 and 0 are not primes, so I don't get why I'm being corrected here.

2

u/Senrabekim Oct 25 '26

I tend to use an idea of three sets for the non-negative integers: composites, primes, and identities. Its just really nice to be able to shove 0 and 1 into their own little box instead of trying to shoehorn them elsewhere or have them hanging.

10

u/Airowird Oct 23 '26

Not to mathematicians.

1 is neither prime nor non-prime. Because you can't factor 1 into prime numbers, yet it isn't dividable by exactly 2 integers. Mostly, it is excluded because it messes up so many definitions otherwise.

So 4 is the lowest non-prime. And 2 is the lowest prime, on top of being the only even one!

2

u/HappensTense Oct 23 '26

It's non-prime, it's just not composite. The trichotomy is unit/prime/composite, not unit/prime/non-prime.

That's also why I said technically.

2

u/Airowird Oct 23 '26

I've never heard of unit/composite, but it's been 20y and not in english, so maybe the nomenclature has changed since then.

1

u/Kryptochef Oct 24 '26

Of course 1 is non-prime. You'd usually not call it composite though, which is a word that precisely exists for this reason.

1

u/Airowird Oct 24 '26

It's strange, because 15y ago nobody ever mentioned composites in math classes.

We just got taught that 1 is a weird case and is excluded it from either side. The definitions we were taught simply didn't allow for 1 to be included anyway.

To me, it's always just been not prime and not non-prime at once. Just like we exclude 0 from being either positive or negative.

2

u/Kryptochef Oct 25 '26

Yeah but 0 is still a non-negative number. It is quite usual in (professional) mathematics that something being non-X really just means it is not X, and if there are weird special cases you make up a new word for a more precise opposite.

(Also, 1 does uniquely factor into prime numbers - it is, in a sense, the empty product, so has each prime factor 0 times. This might sound strange but is a perfectly good way of looking at things that makes a lot of definitions easier, so very much accepted in maths.)

0

u/vicky_molokh Oct 23 '26

Why does this feel like breaking the law of excluded middle and a bunch of other similar rules of logic?

1

u/scalyblue Oct 27 '26

In before the “1 isn’t prime” club

1

u/Unstopapple Nov 02 '26

it cant be because of the Fundamental theorem of arithmetic.

28

u/dominatrixyummy Oct 23 '26

Answer: It’s separate to the php vulnerability. An Indian certificate authority (CA) got caught using _extraordinarily_ weak private keys for signing TLS certificates. This CA was trusted by all major operating systems and browsers.

Typically these keys are made up of numbers that are hundreds of digits long. This CA had keys made using the number “4”, among other very small numbers.

TLS certificates are how computers secure data over the internet. It is also used to verify a domain belongs to who it claims to.

Because their key was so weak, it took less than 1 second for a basic GPU to crack it. This meant an attacker who did this would be able to create a TLS certificate for any domain, and it would be trusted by browsers and other software as if it were 100% legitimate.

And by any domain, I mean any. Banks, government portals, app stores, APIs, software packages. Once they do this, there would also need to either intercept traffic from your device with network tampering, or trick you into going to their fake website.

12

u/Geoclasm Oct 23 '26

Holy shit what a fucking week lol. Who cares about AI when we're about to ruin ourselves with this kind of nonsense.

3

u/composedofidiot Oct 23 '26 edited Oct 23 '26

One of the ai subs is using the emudhra incident as part of the evidence that agent swarms have been unleashed and the internet has a day to live (edit - yes it's silly)

My bet is 3 months.

16

u/Uhstrology Oct 23 '26 edited Oct 23 '26 • Bravo

Yeah thats not what happened though. To quote Hank Green:

Open AI trained a bunch of super effective hacker bots to act like the only thing that mattered in the world was winning a hacking challenge and then gave them hacker tools, removing anti-hacking guardrails, put them in a perpetual hacking story, and let them do just... Whatever, completely unsupervised, for weeks. And then when the bots did a bunch of hacking they were like "Ah, man, I guess sometimes they go crazy, the AIs broke containment!"

The internet isnt going down because of rogue ais. This isn't cyberpunk.

3

u/composedofidiot Oct 23 '26

Yeah, theyre dystopic worldbuilding. Rogue ai sounds more exciting than reward hacking.

The internet could go down because ai capabilities are being used to find vulnerabilities and generate attacks at scale - and the barriers for entry for humans are getting lower all the time.

5

u/spaceprinceps Oct 23 '26

Trust Hank to summarise such a complex story into such an efficient paragraphs worth, also more people need to know this they think all AI is badly misaligned rather than the above

392

u/PGSylphir Oct 23 '26

answer: The short and sweet is that eMudhra, a Certificate authority, got cracked in milisseconds due to a bunch of their cryptographic keys being all very low numbers, one of them being 4.

"Oh but what does that mean"... well... usually a cryptographic key have a bit over 100 DIGITS. That length is so that breaking those keys take thousands if not millions of years. Effectively making it near impossible to break with current technology.

eMudhra's keys were under 3 digits, this can be broken in milisseconds by even a home computer.

212

u/LoudestHoward Oct 23 '26

"You guys are stupid, they'll be looking for lots of digits"

52

u/chupathingy99 Oct 23 '26

12345? That's amazing, that's the same combination I have on my luggage!

3

u/AzsaRaccoon Oct 29 '26

12345? That's the stupidest combination I've ever heard! That's what an idiot would have on his luggage!

9

u/fatguyfromqueens Oct 23 '26

I am curious as to how that happened. I mean I assumed provate keys are randomly generated by software. A human had to deliberately choose 4. Do we know more?

17

u/PGSylphir Oct 23 '26

We don't really know, but the idea floating around that I also think to be likely is that whoever programmed the key randomizer simply rolled a number between 1 and 384, not a 384 bit number. Either by incompetence or genuine accident that wasn't checked and caught (which, fair, is also incompetence)

12

u/grawity Oct 23 '26

Unlikely, as they used an off the shelf HSM to do the key generation, a generally well regarded model. You don't tell the HSM to roll the raw numbers out of a range, it's pre-programmed as a product to deal with keys specifically, so you tell it that you want an EC P-384 key or an RSA 2048 key and it knows what's needed for that algorithm (whether it needs to generate one number or two, prime or not necessarily, etc).

What they did unusually though, according to what they've hinted at, is that they exported the key out of the HSM into a regular PC and then imported it back. Which is not something one normally does with HSM-stored keys, to begin with - it pretty much defeats the purpose of them being handled by the HSM.

So it seems that they messed up the export/import procedure likely by accident (it was mentioned as "wrap/unwrap" in their own story), but the question is why they were doing that export/import in the first place. "Oops, we accidentally crashed the customer's car during the 'drag race' step of their oil change" type of thing.

7

u/MarkFluffalo Oct 25 '26

4 is literally the smallest composite number as well

43

u/Beckphillips Oct 23 '26

From what i heard, not "one of them" being four - that's the only number.

108

u/PGSylphir Oct 23 '26

Multiple keys, one of them was 4. IIRC it was 7 keys at 3 digits or shorter.

EDIT: Checked. 8 Keys all under the value 237.

58

u/composedofidiot Oct 23 '26 • Bravo

4, 56, 66, 115, 155, 156, 230, 237.

60

u/ericph9 Oct 23 '26

I was really hoping for 4, 8, 15, 16, 23, 42

9

u/IntergalacticZombie Oct 23 '26

Hurley has left the chat.

3

u/wahnsin Oct 23 '26

listen, at this point I'm glad for any sequence that isn't 6 7

2

u/composedofidiot Oct 23 '26

More of them might be, there's hope. The emudhra ones werent discovered for over a year

1

u/touchet29 Oct 23 '26

So glad I'm not the only one

10

u/Bardfinn You can call me "Betty" Oct 23 '26

Yes. 8 keys, all of them having all bits set to 0 except for the least significant byte.

9

u/D1v1s10n Oct 23 '26

Someone must’ve missunderstood 256 bits as a number between 0 and 256 lol

6

u/Sability Oct 23 '26 • Popcorn

I heard the key was meant to be 2386 bits, and all numbers are under 386...

4

u/lonelyroom-eklaghor Oct 23 '26 edited Oct 23 '26

They were literally generating random numbers under a byte... like they weren't even trying to pretend the higher limit was 386, but rather 255

3

u/shaggy237 Oct 23 '26

237 represent

6

u/Nine_Gates Oct 23 '26

Like in Digital Fortress where the password to stop the bad guy's doomsday algorithm is just the number 3?

5

u/meredyy Oct 23 '26

shouldn't private keys also be prime numbers?

16

u/grawity Oct 23 '26 edited Oct 23 '26

Specifically only the RSA algorithm (admittedly, the most popular asym. algorithm for many years) uses math centered around prime numbers as keys, and many memes have assumed these were RSA keys as well, but no, these specific ones were ECDSA (elliptic curve) keys which use entirely different math behind the scenes, the private key is an x/y coordinate rather than a pair of primes.

Most CAs these days have about as many EC certificates as they have RSA (if not more), so the choice on its own isn't anything unusual.

EC has much shorter keys as well, eMudhra's EC P-384 (with keys of indeed around 110 decimal digits) is actually considered stronger than RSA-2048 (~610 digits), since every possible value - not just spread-out specific numbers - makes a technically-valid key.

5

u/PGSylphir Oct 23 '26

Not necessarily. Cryptography has a lot of prime number shenanigans indeed, but this isn't one of them.

2

u/frogjg2003 Oct 23 '26

Prime numbers only matter when it comes to factoring. If your cryptography doesn't depend on factoring, you don't need prime numbers.

-4

u/hmmstdvent Oct 23 '26 edited Oct 23 '26

It takes a lot more than thousands or millions of years to guess cryptographic keys.

3blue1brown video on 256 bit security

1

u/aaronhowser1 Oct 25 '26

The point is that it takes a long ass time. It taking even longer than the huge amount of time they gave doesn't really change much

1

u/hmmstdvent Oct 25 '26

I know, I thought an illustration of exactly how long might be interesting for some people.

30

u/jmaaron84 Oct 23 '26

Answer: it actually doesn't have to do with the PHP vulnerability. It's actually far worse. Private keys for an Indian cert authority were compromised. One of those keys was literally just the number 4.

https://www.theregister.com/security/2026/10/20/indian-certification-authority-emudhras-private-keys-compromised-one-of-them-was-the-number-4/5304312

8

u/TheOwlMarble Oct 23 '26 edited Oct 23 '26

answer: Not PHP.

Basically, all server traffic on the Internet relies on certificates, which are proof that the server you're talking to is are who they say they are. Certificate trust is setup like a pyramid and flows down.

At the top of the pyramid are Certificate Authorities (CA). They use real world means to prove themselves and then use their digital certificates to validate other servers, so those other servers don't have to physically present their certificates to the world and get the luxury of remaining digital-only. Those approved servers can then sign for other servers they trust, and down the pyramid you go. It's very common to see a hierarchy of CA > Company > Program > Server.

In order for these certificates to be secure and Internet traffic trusted, they need to be kept secure and very hard to guess, which means they need to be enormous numbers.

Well... An Indian CA turned out to very much not be using big numbers.

One of them was just 4. Not 4 googol or something. 4.

Realistically, brute force attacks tend to count up and can try billions of numbers a second, so if the answer is 4, that's an instant crack. That then allows impersonation. Someone else could claim that this CA had signed off on them being legit, and therefore you should trust their totally-not-malware downloads.

5

u/Danny-Fr Oct 23 '26

Answer: if you were hung up on 6,7... Be ready to have another integer ruin your online life.

You know the "s" in "https". That stands for Secure. That's when your browser does NOT come up with a warning when you try to access a website.

You can't just wish an "s". You need to earn it by proving your ownership with real details, to a company that will sell you a certificate.

The proof of that certificate is a digital signature your browser is gonna check. That signature is supposed to be a LONG and COMPLEX. As in hundred of characters.

The reason is: this signature is the digital proof that your website is legit. If someone knows it, they can impersonate your, say, banking website.

Well there's this company in India that's been found to deliver a signatures that was just... '4'. That's it. Just the number 4.

More problem: 5, 6, 7... Are also apparently on the table, all the way up to "wait for quantum in order to guess it", all the way down to "4".

Understandably, some people aren't taking the news very well.

2

u/htmlcoderexe wow such flair Oct 26 '26

your browser does NOT come up with a warning

hell i remember when IE would specifically warn you that a website is using https (explaining what that means)