r/ProgrammerHumor • • Oct 25 '26

Meme somethingSomethingBitsInAPrivateKey

Post image
3.0k Upvotes

32 comments sorted by

132

u/max_465 Oct 25 '26

Did I miss an incident? I see a lot of about 4 as a private key recently.

96

u/SchizophrenicKitten Oct 25 '26 • Popcorn

72

u/max_465 Oct 25 '26

Thank you. What a cock up. I think I will go back to pulling the covers over my head.

29

u/Interesting-Crab-693 Oct 26 '26

Remember this before you sleep:

0x00000...00004

Good night :)

20

u/Skusci Oct 25 '26

No no wait, this is only the first one.

4

u/max_465 Oct 25 '26

😱😱😱😱😱😱

14

u/Tyfyter2002 Oct 25 '26

Apparently a company was actually using it

32

u/gabedamien Oct 25 '26

> a company

Not just "a company", a certificate authority. Meaning literally any device anywhere on the internet could have been compromised, if it hit up that CA.

30

u/willow-kitty Oct 25 '26

Actually, it's worse than randomly hitting that CA- you could be compromised if you trust that CA.

It's normal to have the public keys for all the root CAs installed on your machine so it can validate trust chains locally, and each certificate indicates with its trust chain which public keys to validate against. So, if you have the corresponding public key for eMudhra's 4 in your root CAs keystore, any cert signed with that private key will be automatically trusted.

Every OS vendor had a collective OH FUCK moment and put out updates to yeet those keys out of their trust stores, invalidating all certs signed with them (legitimately and otherwise), but if you can't update for some reason (liiiiiiiiiiiike, say, for an IoT device) you may just be vulnerable forever.

8

u/Areshian Oct 25 '26

And basically everyone trusted that CA

6

u/willow-kitty Oct 25 '26

Yep! You'd almost have to - it was a root CA. If you didn't, all of the certs they issued would give you TLS errors.

2

u/Loading_M_ Oct 26 '26

To be fair, a well designed IoT device shouldn't have a full list of TLS root CAs, just the one(s) it actually needs. Ideally, you can actually use a private CA for most operations. This would prevent CA compromise from affecting your device, since the CAs aren't involved.

On a more realistic note, well designed IoT devices are rarer than unicorns.

1

u/thirdegree Violet security clearance Oct 26 '26

This would prevent CA compromise from affecting your device, since the CAs aren't involved.

Well it would also put a giant target on the back of the private CA who would probably in theory have less experience and care than a big root ca. I'm not sure that trade-off is worth it (though it might be idk)

1

u/Loading_M_ Oct 26 '26

The private CA would be run by the manufacturer themselves, so it's not at any more risk. Whatever update mechanism is in place would be equally at risk, so this just combines the CA and other supply chain attacks into a single risk.

Alternatively, it could be run by one of the big root CAs, but as a separate root certificate.

This is all assuming a well run, designed and operated IoT manufacturer, which probably doesn't exist.

1

u/thirdegree Violet security clearance Oct 26 '26

Ya that's a fair point

This is all assuming a well run, designed and operated IoT manufacturer, which probably doesn't exist.

And that's an extra fair point lol. The s in IoT is for security after all

1

u/Mechakoopa Oct 26 '26

"Thankfully" it was an intermediary, not the root, so it's a bit easier to revoke, but the trust chain issue remains the same.

1

u/SirRHellsing 29d ago

Ok I think that's why Cineplex told me to reset my password

9

u/Cootshk Oct 26 '26

That’s because it was a private key recently

37

u/GoaFan77 Oct 26 '26

As a certificate private key, no.

For the number of critical CVE's this week, yes!

8

u/mmcmonster Oct 25 '26

I miss Peter Capaldi’s grumpy but kind Doctor. 😑

25

u/Digital_001 Oct 25 '26

Technically that's just a one bit private key

24

u/willow-kitty Oct 25 '26

It's at least 3 bits long (0b100), but it might be zero bits of entropy if it's always 4.

I've heard a theory that the random number generator was misconfigured and generating values up to 384 instead of 2^384, which would suggest between 8 and 9 bits of entropy.

Still dreadful ofc.

7

u/Loading_M_ Oct 26 '26

The more likely theory is that the random generation stopped after 1 byte (all keys are less than 256). This is easier to do, since the random source might need to be read one byte at a time, so they could have messed up the loop for reading 48 bytes and only read one.

Still really bad, obviously.

For an interesting comparison, Let's Encrypt, the free public CA, runs some kind of cracking process on every certificate it issues. If the private key is cracked, they revoke the certificate. If you attempted to use this private key, your cert likely wouldn't even be issued, since they start the cracking process before actually issuing the cert.

2

u/willow-kitty Oct 26 '26

Oh, I could see that, like if they were overwriting the same byte in memory repeatedly (or just read one and moved on.)

4

u/Digital_001 Oct 25 '26

Only one of the bits is a 1 - that's what I was referring to

1

u/the_horse_gamer Oct 26 '26

the term here is "pop count"

2

u/Smalltalker-80 Oct 25 '26

4 ex-wives seems a lot.

1

u/ashkanahmadi Oct 27 '26

I’m sure someone with 4 ex wives would refer to women as females!!

1

u/Admirable_Hour5169 Oct 26 '26

"Fun fact: 4 is pronounced 'shi' in Japanese, which is the exact same word as 'death'."