In my experience, I've found it to be most valuable when troubleshooting network issues on a network you don't manage or have any insight into.
For example, I used to work at an MSSP that sold managed IPS devices that customers would put in their network. If there was a connectivity issue to something you know is up, traceroute was typically the first tool in the arsenal.
Would it be feasible to run a crawler that connects to all HTTPS ips on the internet and tries to bruteforce the key with a time budget of a couple of seconds?
Alternatively make browsers brute force keys when connecting via HTTPs, maybe distributing the work by checking a registry of keys that were already tried by some other user with the same browser?
"They are publicly available and signed by trusted root certificates (the certificates are logged in CT)"
This is exactly why google's paranoidcrypto tool can capture them via CCADB/CT. Because only private,untrusted certificate authorities remain outside of CT.
Nah, that's not really the case and not what I wanted to imply.
Computationally, "bruteforce" always wins for a larger number of keys, as you just have to generate all keys once and do a binary lookup in a list. (You can, however, also precompute parts of BSGS.) It's more a tradeoff between how large your blocklist is versus how many keys you want to cover.
Right now, I'm doing keys with 8 bit values via "bruteforce" (aka blocklist). I may switch to BSGS and do 16 bit. Going to 32 bit would, as far as my initial tests go, be too slow. At least for badkeys, where I want to be able to scan a large number of keys fast.
I can't pretend to understand all of this, but can anyone enlighten me as to what the motivation would be to us such as low number as the ECDSA private key? Was it just a cock-up or is there some benefit in terms of speed etc?
A bug in a one-off Python script running outside of the HSM truncated the ECDSA private key to a single byte.
Handling the unwrapped key material outside of the HSM was apparently in violation of their CPS, but nobody would have noticed if it wasn't for that bug.
I can see why they made the decision to exit the CA business afterwards - that is exactly the kind of thing that you do not do as a CA.
Description: Given that the script was a one off meant for export of key pairs, the approved wrap/unwrap deviation from the normal eMudhra KGC was executed with a custom python key‑handling script created by the PKI Operations team. After the wrapped key was returned, the script read the unwrapped private key’s value out of the module (in host side memory) and re‑created a key object from that host‑side value. For the ECDSA objects, a single line in that read‑back truncated the private value to its leading byte, so the re‑created object held a scalar below 256; this re‑created object (not the originally generated key) was used to produce the CSR and was certified. For the RSA objects, the same pattern did not truncate the key (integrity intact), but during re‑import the key material was handled within the volatile memory of the Python process on the ceremony host. A re‑import performed from host process memory is not consistent with the CPS §6.2.6 and the RSA objects are therefore treated as not meeting that requirement.
I’m a complete noob, “Baby Step Giant Step algorithm” is the best algorithm the crack the public key starting by the easiest values first? Wikipedia is a bit unclear.
Imagine if I have a private key, value 123,123, that produces the output of "hi." You have to go through every number, starting from 0, to compute it and try to figure out what my key is. That means 123,123 attempts before you get in.
A private key value of 1 produces "egg," value 2 produces "salt," value 3 produces "blue." You do this for the first 10 values, and have used up 10 attempts.
You also find that you can reduce [my unknown private key] by [10] and see outputs. So you adjust my key [123,123] by 10 and get [123,113] which produces "igloo," and you keep doing that, going by 10s.
After 12,312 decreases, going by 10s, you get the output "blue." Since you already computed the first ten values, you know that "blue" is key 3.
So, thanks to decreasing by 10, 12,312 times, and getting the value that key 3 gave you, you can calculate that (10*12,312)+3=123,123, my private key, in far fewer computes.
If you have enough memory to calculate 1,000 baby steps before taking your giant steps, you can make your giant steps be 1,000 digits long each, rather than 10 in my example, and so on and so forth, to speed it up even more.
There's a chance some dev did this as a joke of sorts (referring to the comic) and somehow it landed in prod. So it might not even be a coincidence. But we might never find out.
Yeah, in this particular case I agree. Although "some dev did this as a joke of sorts and somehow it landed in prod" is still true, some years ago I added a get_pseudo_random_number function that returns 4 to at least one application currently running in production, I'm sure I'm not alone :)
can anyone explain to me why the priv key was not a prime? I thought it was a "requirement" to be a prime - though i guess the actual math don't break without a prime
Clearly none. If he had used AI, well AI would have immediately suggested the baby step giant step algorithm without needing to talk to a human expert (Henninger). And 2025-era AI probably could implement it in a few tries.
Fun read, but it's a quite extensive backstory to an achievement the author didn't actually have?
Feels like a blog post of an elite athlete "How I almost won the Olympics" where they describe the training and the test results and their qualification successes and then how they got a cold the evening before the finals, so, no gold. But almost!!1 (Or maybe more appropriately, before going to the Olympics they decided to focus on their law degree instead so never went. But almost!!1)
And the "almost" in question is that he almost copied the functionality that he saw in google's "paranoid_crypto" a better tool doing the same sort of thing... So he almost took credit for someone else's scanner results. The whole thing reads pretty out there.
A bit self-aggrandizing. Should've been a more humble "How I didn't find the eMudhra d=4 Private Key" as a post mortem, rather than click bait and name dropping.
Reminded me of a story I read long ago, where inventor of ping was "jealous" (jokingly) that he didn't think of traceroute.
Traceroute is a weird tool. In all my years it’s only helped me a single-digit number of times but it was invaluable when it did so.
The best one was getting to ask Shaw if they’d turned their router off and then back on again.
In my experience, I've found it to be most valuable when troubleshooting network issues on a network you don't manage or have any insight into.
For example, I used to work at an MSSP that sold managed IPS devices that customers would put in their network. If there was a connectivity issue to something you know is up, traceroute was typically the first tool in the arsenal.
Would it be feasible to run a crawler that connects to all HTTPS ips on the internet and tries to bruteforce the key with a time budget of a couple of seconds?
Alternatively make browsers brute force keys when connecting via HTTPs, maybe distributing the work by checking a registry of keys that were already tried by some other user with the same browser?
Certificate Transparency makes the crawling unnecessary unless you want to look for keys that are not issued by standard CAs that browsers trust.
Intermediate certificates are not in the browsers’ trust stores.
"They are publicly available and signed by trusted root certificates (the certificates are logged in CT)" This is exactly why google's paranoidcrypto tool can capture them via CCADB/CT. Because only private,untrusted certificate authorities remain outside of CT.
They're in CCADB, so that's an easy source.
The known ones are in CT though AFAIK?
Per the article, the Baby Step Giant Step algorithm is more efficient than bruteforce for small keys.
Nah, that's not really the case and not what I wanted to imply.
Computationally, "bruteforce" always wins for a larger number of keys, as you just have to generate all keys once and do a binary lookup in a list. (You can, however, also precompute parts of BSGS.) It's more a tradeoff between how large your blocklist is versus how many keys you want to cover.
Right now, I'm doing keys with 8 bit values via "bruteforce" (aka blocklist). I may switch to BSGS and do 16 bit. Going to 32 bit would, as far as my initial tests go, be too slow. At least for badkeys, where I want to be able to scan a large number of keys fast.
Ah, what I meant to say was comparing bruteforce-without-lookup to BSGS-with-precomputation - which I suppose was comparing apples to oranges
I can't pretend to understand all of this, but can anyone enlighten me as to what the motivation would be to us such as low number as the ECDSA private key? Was it just a cock-up or is there some benefit in terms of speed etc?
You can read eMudhra's incident report here, where they cover how it happened: https://bugzilla.mozilla.org/show_bug.cgi?id=2083449#c82
But the tl;dr is, it was a cock-up due to bad processes, a bug in a script and ignoring some red flags later on.
Thanks!
A bug in a one-off Python script running outside of the HSM truncated the ECDSA private key to a single byte.
Handling the unwrapped key material outside of the HSM was apparently in violation of their CPS, but nobody would have noticed if it wasn't for that bug.
I can see why they made the decision to exit the CA business afterwards - that is exactly the kind of thing that you do not do as a CA.
> Contributing Factor 1: Host‑side ceremony script error.
Description: Given that the script was a one off meant for export of key pairs, the approved wrap/unwrap deviation from the normal eMudhra KGC was executed with a custom python key‑handling script created by the PKI Operations team. After the wrapped key was returned, the script read the unwrapped private key’s value out of the module (in host side memory) and re‑created a key object from that host‑side value. For the ECDSA objects, a single line in that read‑back truncated the private value to its leading byte, so the re‑created object held a scalar below 256; this re‑created object (not the originally generated key) was used to produce the CSR and was certified. For the RSA objects, the same pattern did not truncate the key (integrity intact), but during re‑import the key material was handled within the volatile memory of the Python process on the ceremony host. A re‑import performed from host process memory is not consistent with the CPS §6.2.6 and the RSA objects are therefore treated as not meeting that requirement.
Cock-up is the technical term
Laziness.
Gross incompetence.
It was just a cock-up!
Somebody trying to be funny https://xkcd.com/221/
I’m a complete noob, “Baby Step Giant Step algorithm” is the best algorithm the crack the public key starting by the easiest values first? Wikipedia is a bit unclear.
Imagine if I have a private key, value 123,123, that produces the output of "hi." You have to go through every number, starting from 0, to compute it and try to figure out what my key is. That means 123,123 attempts before you get in.
A private key value of 1 produces "egg," value 2 produces "salt," value 3 produces "blue." You do this for the first 10 values, and have used up 10 attempts.
You also find that you can reduce [my unknown private key] by [10] and see outputs. So you adjust my key [123,123] by 10 and get [123,113] which produces "igloo," and you keep doing that, going by 10s.
After 12,312 decreases, going by 10s, you get the output "blue." Since you already computed the first ten values, you know that "blue" is key 3.
So, thanks to decreasing by 10, 12,312 times, and getting the value that key 3 gave you, you can calculate that (10*12,312)+3=123,123, my private key, in far fewer computes.
If you have enough memory to calculate 1,000 baby steps before taking your giant steps, you can make your giant steps be 1,000 digits long each, rather than 10 in my example, and so on and so forth, to speed it up even more.
Pardon my ignorance but, how do I reduce (your unknown private key) if I don't know what (your private unknown key) is?
Still blows my mind how close to the bone this xkcd got too: https://www.xkcd.com/221/
There's a chance some dev did this as a joke of sorts (referring to the comic) and somehow it landed in prod. So it might not even be a coincidence. But we might never find out.
There were 8 affected keys and only one was d=4, all were single-byte values. Very much looks like a byte-truncated value.
That’s also what the post mortem said, they crushed the high-order bytes of “quality” keys.
Yeah, in this particular case I agree. Although "some dev did this as a joke of sorts and somehow it landed in prod" is still true, some years ago I added a get_pseudo_random_number function that returns 4 to at least one application currently running in production, I'm sure I'm not alone :)
I've built one as well. Mine is a joke about the lack of uniqueness guarantees in UUIDv8. I don't believe anyone uses mine though.
https://github.com/robalexdev/uuidv8-xkcd-221
Also referenced by fail0verflow when the algebraically recovered the PS3 master private key.
As Sony used the same k for each signature.
https://youtu.be/LP1t_pzxKyE?t=236
wasn't something like that also what led to HDCP and AACS being effectively hard-broken?
Something similar I think algebraically derived from multiple faulty keys.
https://www.cypherpunks.ca/~iang/pubs/hdcp-drm01.pdf
> https://www.xkcd.com/221/
Also Dilbert:
* https://fridayfun.net/dilbert-2001-10-25
can anyone explain to me why the priv key was not a prime? I thought it was a "requirement" to be a prime - though i guess the actual math don't break without a prime
You're thinking of RSA, where the RSA public key n is the product of two primes p and q. There is no such requirement for ECDSA.
The question then is how much did you use AI during this time period?
Clearly none. If he had used AI, well AI would have immediately suggested the baby step giant step algorithm without needing to talk to a human expert (Henninger). And 2025-era AI probably could implement it in a few tries.
How I almost read the article
Fun read, but it's a quite extensive backstory to an achievement the author didn't actually have?
Feels like a blog post of an elite athlete "How I almost won the Olympics" where they describe the training and the test results and their qualification successes and then how they got a cold the evening before the finals, so, no gold. But almost!!1 (Or maybe more appropriately, before going to the Olympics they decided to focus on their law degree instead so never went. But almost!!1)
And the "almost" in question is that he almost copied the functionality that he saw in google's "paranoid_crypto" a better tool doing the same sort of thing... So he almost took credit for someone else's scanner results. The whole thing reads pretty out there.
Yh, but "fun read" so ...?
Seems like a reasonable hook to talk about the person's 'badkeys' work and clue people in on the whole situation.
A bit self-aggrandizing. Should've been a more humble "How I didn't find the eMudhra d=4 Private Key" as a post mortem, rather than click bait and name dropping.