The Register Home Page

back to article Indian certification authority eMudhra’s private keys compromised – one of them was the number ‘4’

Tragically simple private keys used by a certification authority based in India have been compromised, meaning the 60-million-plus certs it has issued can’t be trusted and necessitating a massive clean-up job. The CA of concern in this case is called eMudhra, which boasts of having issued over 60 million digital certificates to …

  1. Richard Boyce

    Simple numbers as keys

    That's deliberately insecure. So who ordered that? The CA is toast.

    1. Joe W Silver badge

      Re: Simple numbers as keys

      It's probably some stackoverflow sample code...

      1. Pete Sdev Silver badge
        Facepalm

        Re: Simple numbers as keys

        Or these days (the keys are from 2025 I believe), ChapGPT/Claude/AcmeSlopGenerator.

        It's a brilliant example of "it works" being only 1 criteria (the keypairs are valid and do work) and how being able to do something with absolutely no understanding (crypto is hard folks) is dangerous ignorance.

        I'd almost guess that someone inadvertently used a 8 bit random number instead of an 8 byte random number (though according to Scott Helme, its a 384bit keyspace not 256).

        1. Pete Sdev Silver badge
          Coat

          Re: Simple numbers as keys

          and somehow I've lost my ability to do basic maths (I need more coffee). 8 bytes is obviously 64bits. Trying to comprehend how the hell this happened has frazzled my brain apparently.

          Following Hanlon's razor, I was wondering if some did something like (in pseudo code) private_key = SecPRNG.generate(8) believing generate() parameter is in bytes, when actually it's in bits, but this doesn't fit.

        2. Blazde Silver badge

          Re: Simple numbers as keys

          It's a brilliant example of "it works" being only 1 criteria

          The frustrating thing is they didn't work. Almost immediately there was a discrepancy, but instead of stopping to understand why everyone blundered on:

          | In light of the issues with the same intermediates in Bug 1970728 [2025-06-05], please describe to the best of your current knowledge how the wrong private keys came to be used to sign those CRLs and the steps eMudhra took in order to produce the correct signatures.

          The CRL's were signed with the original private keys (which were supposed to be the correct keys with appropriate entropy) but given that this resulted in incorrect signatures, they were resigned with flawed keys.

          ( https://bugzilla.mozilla.org/show_bug.cgi?id=2083449#c11 )

          1. Pete Sdev Silver badge
            Thumb Up

            Re: Simple numbers as keys

            I meant "worked" in the context that 4 is technically a valid private key value, and given that key successfully signed certificates (presumably thousands of them), the appropriate matching public key was correctly generated.

            I've since discovered this:

            According to eMudhra, a flaw in the key generation process caused a wrap/unwrap step to produce a second set of weak keys alongside the original strong keys. The weak keys were subsequently published to browser root stores. The company said it is working to establish the root cause of the issue.

            Source: https://www.msn.com/en-in/news/other/emudhra-share-price-hits-20-lower-circuit-after-researcher-flags-weak-keys-can-the-stock-recover-what-lies-ahead/ar-AA2fJ9Fa

            1. You aint sin me, roit Silver badge

              Re: Simple numbers as keys

              That explanation sounds difficult to believe...

              "We generated strong keys, we wrapped the strong keys using our proven, certified wrap/unwrap function, but in doing so actually substituted weak keys, we then distributed the weak keys, deleting the strong keys from our system and replacing them with the weak keys"?

              Probably more like:

              "We asked AI to streamline the key generation process... and never checked the code it produced, or the keys it subsequently generated. But you have to admit, those single byte private keys really speed up certificate generation!"

              1. PB90210 Silver badge

                Re: Simple numbers as keys

                "Now we need a strong key. Any suggestions?"

                "How about '4'. No one would expect us to use that"

                "Sounds OK. Any objections? No. Job closed"

            2. OhForF'

              Re: Simple numbers as keys

              >4 is technically a valid private key value<

              As private keys are supposed to be prime number 4 is technically an invalid private key. Literally the lowest number you can come up with that is not a prime number.

              1. doublelayer Silver badge

                Re: Simple numbers as keys

                You have confused a couple key types. These are ECC keys, which require only one number and do not require that it be prime. It must be in the field of the curve in use, but primeness is not required. RSA keys are where prime numbers are required*, and 4 could technically work there as well because you need two of them, so since 2 is prime, 2*2 makes a RSA key that does work.

                * Technically, RSA keys work with any two numbers, prime or not. It's just that, if they're not prime, then it's broken. Or if they're prime but too small. Or if they're the same and therefore the square root of the public. Also if they're too close together because that makes it too easy to identify and factor. So for all of those reasons, 4 is not acceptable in RSA either, but it can do the calculations.

                1. Blazde Silver badge

                  Re: Simple numbers as keys

                  This has been going around in my head.. we know 4, and the others, are bad keys for all those reasons you mentioned. It's not just that they're low entropy or "technically as random as any other number but a bit lol". They fail fundamental checks. And yet 17 months passed and no one - on the white hat side at least - did those simple checks on the publicly available keys, until this Wayne guy. Everyone, worldwide, just trusted the process.

                  I don't think eMudhra is right to shift blame to everyone else, and I'm not doing either (I mean, I sure as hell didn't check them).

                  But it's a scathing indictment of any process that relies on public scrutiny. Open source software. Some of the subtler blockchain stuff. Corporate records. Court records. Political disclosures. Mathematical proofs. Wikipedia articles. Other obvious stuff I can't even think up right now. Obviously some of this is widely acknowledged to be imperfect (anyone spending 5 minutes on Wikipedia knows that) but I still strongly suspect there's in general way too much optimism that 'someone else' is keeping it honest when it in fact no one is.

              2. Eric 9001 Bronze badge
                Headmaster

                Re: Simple numbers as keys

                1 is lower and is not prime number?

              3. Pete Sdev Silver badge

                Re: Simple numbers as keys

                These were eliptic curve keys, as is very clearly stated in the article.

                Unbelievable that your comment got 3 upvotes. SMH..

    2. Dr Dan Holdsworth
      Pirate

      Re: Simple numbers as keys

      Working with an Indian outsourcer some years ago, I noted a difference between how we in Britain define a person who knows what they are doing with how India defines this. We look for deep understanding of how a system works, they look for "Person has followed instructions to letter several times".

      In other words, competent in some Indian outfits merely means "Follows a recipe accurately", it doesn't denote deep understanding. Obviously there are folks with deep understanding of things in India, but there are a lot of gormless instruction-followers. I think we are looking at a gormless instruction-follower and a flawed set of instructions here.

      1. Michael Strorm Silver badge

        Re: Simple numbers as keys

        > "Obviously there are folks with deep understanding of things in India, but there are a lot of gormless instruction-followers."

        As has been noted by others, there are likely plenty of talented Indians, but anyone half-decent will know they can do better working for almost anyone else- or themselves- than for the shitty consultancy middlemen who pay peanuts while charging customers through the nose.

      2. Excused Boots Silver badge

        Re: Simple numbers as keys

        I used to refer to this as the ‘press button A’ issue. The procedure is to press button A, then button B and finally C, and everyone follows it; but nobody actually understands what buttons A, B and C actually do, what happens behind the scenes?

        In an earlier post, someone referred to possibly a blind following of a StackExchange post. I’m tempted to think this might well be it, a post of SE goes through the process using deliberately simple keys, because it made it easier to explain the process. Alas this has been followed ‘to the letter’, and hence......

        1. Mishak Silver badge

          Even worse

          When the procedure fails to include the "Before pressing A" step.

          For example (and I'm sure I've mentioned this before) I used to work at a place that got a job experience worker to program EPROMs on their production line for a week. After a couple of days every unit was failing in test*. Investigation showed that the EPROMs were blank (EPROMs programmed on day N were used on day N+1). They tried to blame the work experience guy, until I pointed out that he was following the process he had been taught perfectly - they had forgotten to show the "Load the master into the programmer at the start of the day" step.

          * Testing was done after sealing the units, but that's another story.

          1. FirstTangoInParis Silver badge

            Re: Even worse

            > When the procedure fails to include the "Before pressing A" step.

            When cooking ready meals. “Cook on full power for 4 minutes”. Check. “”Half way through ….” Too late.

            1. EveryTime

              Re: Even worse

              I prefer the bomb squad directions, which makes the point even more clearly.

              Cut the green wire... only after cutting the blue wire.

              (Acknowledging that the joke, and pretty every movie time bomb plot device, makes no technical sense.)

      3. M.V. Lipvig Silver badge

        Re: Simple numbers as keys

        That's what happens when you grant 4 year degrees to people who attend a seminar as part of their on-the-job employment, in order to get around a customer's "contractor must hold a 4 year degree in computer engineering/programming" requirement.

  2. Fruit and Nutcase Silver badge
    Coat

    Come in Number 4

    Your time is up.

    Of course it couldn't have been Number 6

    1. Ken Shabby Silver badge
      Black Helicopters

      Re: Come in Number 4

      I am not a number, I am a free man!

    2. Claptrap314 Silver badge

      Re: Come in Number 4

      Who is Number 1?

      1. Anonymous Coward
        Anonymous Coward

        Re: Come in Number 4

        At number 1... it's the Bee Gees with "Massachusetts"!

        Unless you meant this week, in which case it's apparently "Patient Zero" by Taylor Swift.

      2. Maximus Decimus Meridius

        Re: Come in Number 4

        You are, Number 6

    3. Empire of the Pussycat

      Re: Come in Number 4

      It was number 2.

      1. adrianww

        Re: Come in Number 4

        Yep, sounds like the whole situation is just one giant number 2.

        I mean one or two screwed up private keys looks like a mistake but more than that? Methinks eMudhra are rather lacking in the technical competence, or indeed the general having some kind of clue, department.

      2. Fruit and Nutcase Silver badge

        Re: Come in Number 4

        @Empire of the Pussycat

        At Number 1, "Mississippi" by the group "Pussycat"

        https://en.wikipedia.org/wiki/Mississippi_(Pussycat_song)

        1. David 132 Silver badge
          Thumb Up

          Re: Come in Number 4

          Ah, a forgotten gem of 60s/70s Nederbeat. It's in my collection, along with "The Life I Live" by Q65, "Let's Dance" by Cats, and of course "Never Marry A Railroad Man" by Shocking Blue.

          1. Anonymous Coward
            Anonymous Coward

            Re: Come in Number 4

            You have good taste sir

    4. Insert sadsack pun here

      Re: Come in Number 4

      I'm not a number "4"! I'm a "3", man!

      1. Anonymous Coward
        Anonymous Coward

        Re: Come in Number 4

        Beats being a "number two" at any rate.

      2. TimMaher Silver badge
        Coat

        Re: Come in Number 4

        You are Number Six.

        1. furrydingbat

          Re: Come in Number 4

          That's numberwang!

      3. C R Mudgeon Silver badge

        Re: Come in Number 4

        5 is right out!

    5. Albert Coates Bronze badge
      Holmes

      Re: Come in Number 4

      The Sign of the Four, a Sherlock Holmes mystery ------------->

    6. J. Cook
      Joke

      Re: Come in Number 4

      number 6... or 7?

      1. Excused Boots Silver badge

        Re: Come in Number 4

        'Come in number 96, your time is up'.

        Oh hang on we don’t have that many rowboats

        ‘Are you in trouble number 69’?

        1. Anonymous Coward
          Anonymous Coward

          Re: Come in Number 4

          Er... sorry, but it's meant to be numbers "9" and "6".

          If you think about what "69" and "96" look like upside down, you'll see why it doesn't work that way.

          Sorry!

  3. Fruit and Nutcase Silver badge
    Joke

    Indian certification authority eMudhra

    Bunch of Cowboys

    1. simonlb Silver badge
      Joke

      Re: Indian certification authority eMudhra

      Is their name now eMud-rah?

    2. elsergiovolador Silver badge

      Re: Indian certification authority eMudhra

      From Spaghetti Western

      1. Fruit and Nutcase Silver badge
        Mushroom

        Re: Indian certification authority eMudhra

        Spaghetti Vindaloo?

        1. Anonymous Coward
          Anonymous Coward

          Re: Indian certification authority eMudhra

          Yes, and don’t forget the Chinese curry sauce

  4. Mostly Irrelevant Bronze badge

    That's comically incompetent.

    1. Ianab

      Even Spaceballs had a more secure code, it was 4 digits.

      1. bemusedHorseman
        Trollface

        "If it's good enough for my luggage, it's good enough for a certificate authority!"

      2. Pete Sdev Silver badge
        Coffee/keyboard

        The Spaceballs code is indeed almost 10 bits, which is indeed more secure than eMudhra's 8.

        Maybe we need a new meme.

        Dark Helmet: What's the secret key?

        Colonel Sandurz: 4

        Dark Helmet: 4? That's the stupidest key I've ever heard in my life! That's the kinda thing an idiot would use for a signing certificate.

        eMudhra: 4? That's amazing! I've got the same key for my signing certificate!

        1. Wellyboot

          4 is only 3 bits

          you don't need 8 bits until you reach 155 in that list!

      3. robinb

        Spaceballs was better still, that one had five digits.

      4. Toastan Buttar
        Go

        They're gonna have to go right to Ludicrous Security!

    2. RM Myers Silver badge
      WTF?

      That's comically incompetent.

      Some how incompetent just doesn't seem sufficient to describe this, comically or not. I'm not sure the English language has an appropriate word.

      1. Anonymous Coward
        Anonymous Coward

        Re: That's comically incompetent.

        It does:.

        "Politician"

      2. Christoph

        Re: That's comically incompetent.

        Ludicrously, farcically incompetent.

  5. Bill Gray Silver badge

    Obviously, they were using the xkcd-approved random number generator for their private keys.

    1. Michael Strorm Silver badge

      That was the first thing I thought of too. It's almost too weirdly coincidental...

    2. SVD_NL Silver badge

      Finally a proper implementation of RFC 1149.5!

    3. The Travelling Dangleberries

      AI again?

      Or, more plausibly the full set of xkcd web comics was fed into the LLM that eMudhra used to create its key generation procedure.

      1. Michael Strorm Silver badge

        Re: AI again?

        You say that in a manner that suggests you're suggesting that seriously, rather than as the outlandish joke it would normally be taken as.

        Sad to say that, as ludicrous as that possibility *should* sound, I'm very much inclined to agree that it's quite a plausible explanation. And one which would be utterly damning were it to turn out to be true.

  6. rgjnk
    Devil

    I'd like to say I'm surprised

    But I'll be honest, I'm really not.

  7. Pulled Tea Bronze badge
    Joke

    wah, 死

    Wah, sure the Chinese don't like one, as they say… die for sure.

    1. breakfast Silver badge

      Re: wah, 死

      Finally my love of C-Dramas allows me to understand a joke on the Reg forums. No learning is wasted.

  8. Bebu sa Ware Silver badge
    Coat

    And where do you off-shore critical business [cryptographic] functions ?

    — Randomly choose an integer between 1 and a gazillion.

    — I'll have 4.

    Good isn't it.

    It's not that 4 is any less random than a zillion + 1 but it is near an edge where all attacks commence and it will be used where it should be fairly large.

    1. Yet Another Anonymous coward Silver badge

      Re: And where do you off-shore critical business [cryptographic] functions ?

      So nobody would think of using it, hence it's the most secure number

      1. Havin_it

        Re: And where do you off-shore critical business [cryptographic] functions ?

        I mean, sounds like it held up for a year and a half, so ...

        Now we know the half-life of security through obscurity, I guess.

    2. Elongated Muskrat Silver badge

      Re: And where do you off-shore critical business [cryptographic] functions ?

      Got it, your random number is half a gazillion.

  9. Uh, Mike Bronze badge

    Don't Be Surprised

    Four is a perfectly fine random number.

    I rolled it on a fair die six years ago.

    1. 42656e4d203239

      Re: Don't Be Surprised

      My d4s roll 4s a lot - well probably not a lot, if I bothered to add them up, but about 25% of the time - certainly a lot when compared to, say, the d20s.

      The DM would claim they roll them too often but he would, wouldn't he?

  10. Anonymous Coward
    Anonymous Coward

    responsibility of browser makers

    Before allowing a CA to their list of accepted CAs, browser makers used to scrutinize the CA. Have they stopped doing that ? How did this monkey CA slipped in ?

    1. hx

      Re: responsibility of browser makers

      The CA/Browser cartel has been too busy shortening certificate lifetime to care about anything else.

      1. Wellyboot

        Re: responsibility of browser makers

        the safe lifetime of this one is microseconds

  11. Voice of Salinity

    It'll be a very predictable response that the new passwords will be several orders of magnitude more secure: 1111, 2222, 1234, 6789...

  12. KalF

    You still need to guess the value

    Ok, I'm not going to tell you my private key, but its a number between 3 and 5. Have you got your quantum computer handy?

    1. Michael Strorm Silver badge

      You never said it was an integer...

      Technically, there are an infinite number of, er... numbers between three and five.

      1. Albert Coates Bronze badge

        Re: You never said it was an integer...

        A subset of Aleph-Null, then.

        1. Yet Another Anonymous coward Silver badge

          Re: You never said it was an integer...

          Was interested and looking up ZF set theory to see if a subset of Aleph-Null is smaller than Aleph-Null

          Now brian hurt......

          1. collinsl Silver badge

            Re: You never said it was an integer...

            Now brian hurt......

            Who is Brian and how have you hurt him?

  13. Paul 195
    Mushroom

    Impressive....

    They have an impressive line up of logos on their home page, and boast of recommendations from the likes of Gartner and IDC. The red faces should not just be limited to their cert generation process, but to everyone who said "Looks good to me" and moved on.

    I'm still wondering how you end up with "4" as a private key. You'd have to hand craft your certs as I don't think ssh-keygen would even let you do that. I can only assume these were certs generated for some kind of internal testing that ended up in production.

    1. cookiecutter Silver badge

      Re: Impressive....

      gartner said the Metaverse was the future... generally shutting with their logo on it should be avoided

    2. IGotOut Silver badge

      Re: Impressive....

      "recommendations from the likes of Gartner and IDC"

      Ah, High standing recommendations for senior manglement, bloody massive red flags for everyone else.

  14. xanadu42
    Devil

    My Private Key is 42...

    because it IS the Answer

    1. xyz Silver badge

      Re: My Private Key is 42...

      Finally... I was shocked that I had to scroll this far down the comments to find this...what's the world coming to?

  15. upsidedowncreature

    There's always an XKCD

    https://xkcd.com/221/

    1. Jim Mitchell

      Re: There's always an XKCD

      https://xkcd.com/3314/

      There is a new XKCD just for this.

      1. Claptrap314 Silver badge

        Re: There's always an XKCD

        It takes something special to earn your own XKCD, that's for certain.

    2. M.V. Lipvig Silver badge

      Re: There's always an XKCD

      I always read that as XKFC for some reason. Deep fried pigeon, anyone?

  16. druck Silver badge

    Cut and paste

    Stackoverflow obviously wasn't available so they cut and pasted the key generation code from the next best place.

    https://xkcd.com/221/

    @upsidedowncreature

    SNAP!

    1. Doctor Syntax Silver badge

      Re: Cut and paste

      Both of you were 8 hours late to the party.

      1. TimMaher Silver badge
        Coat

        Re: 8 hours late

        4 hours shirley?

  17. may_i Silver badge

    Consequences?

    Given that eMudhra have proven themselves to be wholly incompetent, there should be large financial penalties against them to ensure that they never, ever repeat this.

    1. nobody who matters Silver badge

      Re: Consequences?

      "......there should be large financial penalties against them to ensure that they never, ever repeat this".

      I would recommend nobody uses their outfit (or any other that employs anyone who has worked for them) for providing certificates ever again. Any other type of financial penalty is likely to amount to little more than something that can be written off as a cost of doing business.

    2. Kurgan Silver badge

      Re: Consequences?

      There will be none.

    3. Spazturtle Silver badge

      Re: Consequences?

      Er being bad at your job isn't a crime, so what would they be fined for?

      They have already been dropped from most trusted CA lists so they will be going bust anyway.

      1. may_i Silver badge

        Re: Consequences?

        How about false advertising, fraud, professional misrepresentation, failure of due diligence, just to start with.

        This isn't "an innocent mistake", it's a company which was supposed to be trustworthy enough to function as a Certificate Authority exposing many people and companies to risk as a result of their incompetence and lack of safeguards.

      2. ShadowDragon8685

        Re: Consequences?

        There's being bad at your job, and there's being criminally negligent at your job.

        A really bad cook makes food that nobody likes to eat.

        A criminally negligent cook makes people medically sick. They can kill people.

  18. Voice of Salinity

    Are CAs immutable?

    I tried deleting the eMudhra CA certs from my browser and they reappeared - it's getting it from Linux.

    I looked at deleting/blocking it in Linux, but distro updates may add the CA back if it issues new certs so I now have to script checks to ensure it's not snuck back in.

    eMudhra certs can be added inside my browser when updated, not system-wide and regardless that they're blocked in the OS, so I have to check that periodically too.

    Given the potential impact of a dodgy CA I'm astounded how difficult it is to block a CA who, in my opinion, are too stupid to be on the internet.

    How bad does the breach of trust need to be for a CA to be distrusted and removed? Particularly when the CA operates under the authority of a foreign government.

    1. SVD_NL Silver badge

      Re: Are CAs immutable?

      You can use /etc/ca-certificates.conf on most distributions (check the manpage for ca-certificates or update-ca-certificates for your distribution).

      Prefix certs you want to disallow with an exclamation mark (!), if this file is updated, you should be presented with the option to diff the files. (that may be skipped if you update with the -y argument, but that's not a great idea to begin with)

    2. hmv

      Re: Are CAs immutable?

      There's a work-around for this towards the end of https://emudhra.we-have-a-problem.com.

    3. may_i Silver badge

      Re: Are CAs immutable?

      On Debian, an updated ca-certificates package was ready to install when I turned the computer on this morning.

      There are still certs from eMudhra in the store, but they are not compromised ones.

  19. JimmyPage Silver badge
    Flame

    Hang on a cotton picking moment

    I can't sign up for a fucking shitty newsletter without having ti invent a password that has 28 characters, none repeated, a special character and both cases.

    And these clowns ("experts") can get away with s number ?

    Colour me incandescent

  20. SVD_NL Silver badge

    No one can force me to have a secure website!!!

    A very interesting related video: No one can force me to have a secure website!!! | suckerpinch | YouTube, it goes into great detail how you can do really stupid things with cryptography in order to make https wildly insecure.

    1. Anonymous Coward
      Anonymous Coward

      Re: No one can force me to have a secure website!!!

      Proof that you can guard against accidents, but not against malice.

  21. Doctor Syntax Silver badge

    It raises a serious question.

    How do you determine whether a single allegedly random number is indeed randomly chosen? There are statistical tests for a large sample but not for a sample of one. Should we demand that, say quarter to three quarters of the bits be set and reject any that the random number generator produces that don't match those criteria? If we do that, then the result is less random, not more.

    1. Brewster's Angle Grinder Silver badge

      Randomness is such an elusive concept

      It stops being random the moment you chose it.

      1. Brewster's Angle Grinder Silver badge

        Re: Randomness is such an elusive concept

        (But, given the length of these numbers, you can break them down into bits, bytes, or bigger chunks, and see if they pass statistical tests for randomness. You'd then want to check it against a dictionary of known keys.)

    2. You aint sin me, roit Silver badge

      You use a certified random number generator to get you 48 random bytes (for a 384 bit key).

      To span as much of the potential key space as possible, you ensure that the most significant byte is not zero - just set the most significant bit to 1. That's your private key - keep it safe!

      You then multiply* the generator point by the private key to get the public key.

      Job's a good 'un.

      Gets more complicated if you want to support different key lengths - you need to generate 64 random bytes for a 512 bit key!

      The security of elliptic curve cryptography is guaranteed by the difficulty of deriving the private key even if I tell you the start point, the properties of the curve, and the end point. If I want to brute force it, the search space is 2^384 possible keys and without a working quantum computer I won't be able to do it. However, if I have reason to believe that the private key is restricted to the range 1 .. 255 then I've already cracked it by the time you've read this sentence...

      * Multiplication in an elliptic curve sense, essentially pushing a point around the elliptic curve each time you add to it.

      1. ibmalone

        To span as much of the potential key space as possible, you ensure that the most significant byte is not zero - just set the most significant bit to 1

        So a 383 bit key?

        1. Anonymous Coward
          Anonymous Coward

          Halving the key space in a single stroke. LOL.

        2. Elongated Muskrat Silver badge

          IKR, and then apparently generating tanother 16 bytes of randomness after the first 48 is the hard bit.

          Sorry, buddy, we're all out of entropy today, come back tomorrow and we might have some more in.

  22. robinb

    Easy to guess?

    "Those are vastly inadequate keys, because they’re easy to guess,"

    I'm quite sure I never would have guessed *that*, though.

    1. Dan 55 Silver badge

      Re: Easy to guess?

      I have a cunning plan, my lord...

    2. david 12 Silver badge

      Re: Easy to guess?

      Apparently the keys are easy to find when values are close to zero.

      I don't understand the encryption, so I don't know if that's because computing the hash table is trivial when most of the bytes are zero, or if it's just that the decryption algorithm (which is O[sqrt(n)] instead of O[n]), is normally started at zero.

      1. SCP

        Re: Easy to guess?

        Apparently the keys are easy to find when values are close to zero.

        It would certainly seem to make it more likely that someone could accidently stumble across them - for instance using the low value as a test case and noticing it produces a clash with a published public key.

        I recall that some cryptographic functions have known weak keys and part of the normal key generation process is to check that the 'randomly generated key' is not a weak key*. I am surprised that the eMudhra key generation process did not automatically check for weak keys. (Though trom the snippets I have read so far it might be a case that some deliberately weak keys might have been introduced to the system [bad idea] and later stages of the verification and acceptance process did not/could not check whether the certificate being presented was derived from a weak key.)

        Hopefully eMudhra will be transparent in the investigation of what went wrong and all CA's will carefully** look at their own processes to make sure a similar mistake can't occur again.

        * It is a while since I studied the topic - I can't recall if it was related/similar to Carmichael numbers and the Fermat's Little Theorem prime test.

        ** Not just put out a memo to the effect - "Security is our highest priority, lessons will be learned."

    3. Elongated Muskrat Silver badge

      Re: Easy to guess?

      Security by obscurity. Works every time, unitl it doesn't, eh?

      1. Anonymous Coward
        Anonymous Coward

        Re: Easy to guess?

        It's like saving top secret documents on a personal server at home, with default admin passwords, to save having to use 2MFA to access emails when you want to know the US President's minute by minute itenerary for the next 2 weeks.

  23. elsergiovolador Silver badge

    Plain sight

    That was totally not exploited for ages. Totally.

  24. wimton@yahoo.com

    Alternative CA

    How about "Honest Achmed's Used Cars and Certificates" as the new CA?

    1. Stevie Silver badge

      Re: Alternative CA

      These days more like Honest Dmitry's Server Collective.

      1. Anonymous Coward
        Anonymous Coward

        Re: Alternative CA

        Honest Donald's Golden Numbers Crypto Services and Golf Store?

        (Offering both sorts of crypto, of course, but neither of which are actually any good…)

  25. bewilder

    The Downstream Ramifications...

    ...could be potentially huge, given that a large number of Western governments (in particular UK) off-shore huge swathes of their systems integration, deployment and build to giant contractors sourcing a lot of their engineering in India.

    What's the betting that certificates signed using eMudhra certs somewhere in the chain are scattered everywhere across critical infrastructure, for things like mTLS etc..?

    In my experience, compliance teams will talk a good game and profess to provide assurance around the mitigation of risks such as this, but in reality when a large SI is pushing towards a deadline, everything is literally bent, tortured and shaped to fit some nonsense project or programme plan. The due diligence value effectively drops to zero.

    This is a truly epic cl*sterf*ck, and eMudhra won't be the only ones.

    1. Anonymous Coward
      Anonymous Coward

      Re: The Downstream Ramifications...

      "when a large SI is pushing towards a deadline"

      Works for both System Integration and Super Intelligence. (Or, for that matter, any project where the deadline is considered more important than the quality of the work.)

      1. bewilder

        Re: The Downstream Ramifications...

        Well quite, good spot. Same point applies, lack of due diligence whilst using any kind of "software factory" is likely to end in tears.

      2. Kurgan Silver badge

        Re: The Downstream Ramifications...

        any project where the deadline is considered more important than the quality

        Every project in the world, probably. But a special mention goes to any old Soviet project, that had to be completed in time for some political event. Or, nowadays, Trump's America.

        1. bewilder

          Re: The Downstream Ramifications...

          We shall run the tests on Reactor Number 4 this evening…it’s always the 4’s eh?

  26. You aint sin me, roit Silver badge

    Back up plan...

    "Three hundred and eighty-four bits? Fuck that I'll never remember all those. Let's make it 4. Better write it down on this post-it so we don't forget!"

    1. Richard Tobin

      Re: Back up plan...

      Well, 4 *is* a 384-bit number. It's just that 383 of them are zero.

    2. elsergiovolador Silver badge

      Re: Back up plan...

      I have 4 limbs, so 4 it is. Wait. Is my head a limb too? Oh.

  27. Ensign Nemo

    What algorithm was this?

    I thought public key infrastructure relied on the public key being the multiple of a pair of private prime numbers. How is the private key just one value?

    What sort of private key is this even meant to be?

    1. Liam Proven (Written by Reg staff) Silver badge
      Trollface

      Re: What algorithm was this?

      Well, it is the multiple of a pair of prime numbers.

      2 is a prime number. It's 2*2.

      And it looks like nobody spotted that the key was 4 for _ages_ so arguably it _used_ to be private. :-D

      1. Ensign Nemo

        Re: What algorithm was this?

        That's true for the key of 4, and even 115 (23 x 5), but 56, 66, 156, 230?

        And even if it was a key of 4, that's the _public_ key because it's the product of the two _private_ primes.

        1. KarMann

          Re: What algorithm was this?

          The products of 4, 3, 5, and 3 prime numbers respectively, so they must be even stronger!

    2. Dan 55 Silver badge

      Re: What algorithm was this?

      It's a private key way before it's time, it works perfectly fine close to the heat death of the universe where entropy is in scarce supply.

    3. doublelayer Silver badge

      Re: What algorithm was this?

      The two prime numbers approach is RSA keys. These are ECC (elliptic curve cryptography) keys. In principle, any integer that's in the field of the chosen curve is a valid private key, and then you compute the public key from that. In practice, 4 is only valid in the sense that you can do the mathematics on it, not that you should.

      Think of that as an RSA (two primes) key where P (one of the primes) is 5. The key will work. It won't be good. In both cases, you can find out whether people did that by brute-forcing the easy numbers, limited only by when you feel like stopping.

  28. Tejodo
    Coat

    What a hopeless, 3-bit operation...

  29. Compromising_Positions

    The number four brought to you by Sesame Street!

    1,2,3,4,5,6,7,8,9,10,11,12! The Number 4!

    https://www.youtube.com/shorts/fexjY6HI0FQ

  30. herbdogu

    When P-384 is interpreted as 'pick an integer between 1 and 384'.

    4!

    1. Havin_it

      It's worse than that:

      "Pick 3, 8 or 4."

  31. Brian T

    But aren't CAs supposed to be audited?

    Like, annually, by some organisation that audits the CA to ETSI or WebTrust... and isn't part of that audit a check on the way that signing processes and cert generation, etc. etc. are carried out (with sampling)? I'm a bit out of date as I am a happy retired greybeard, but I recall such audits on Belgian and Dutch CAs being a) thorough, and b) failure and dumping of CA was an option.I guess the Comodo hack gave them a warning. And yes, that was around 15 years or more ago.

    plus ca change

  32. DS999 Silver badge
    Holmes

    Tell me you used AI to implement your software

    Without telling me. That's exactly the sort of mistake that would happen if you gave an inadequate prompt to a crappy AI, and only checked that the code ran and that the certificates it generated were valid.

    The only mystery is how you word your prompt so that instead of randomly generating a 256 bit AES key it randomly generates an AES key using 256 different numbers from 0 to 255.

  33. That Badger
    FAIL

    Jugaad

    You don't want Jugaad applied to Sir-tificates...

    Someone just lost a lot, if not all, of their of Izzat after being found out.

  34. Anonymous Coward
    Anonymous Coward

    OK everyone, listen up

    Which one of you guys can only count to 4?

  35. John_Ericsson

    What if I never let my employees see the private key, instead I used code to generate the keys and for it to go straight into the "HSM" without eyes seeing it.

    Would this increase the security?

    I am aware I am probably demonstrating my ignorance of keys etc.

    1. doublelayer Silver badge

      That is almost always what happens since showing keys to humans doesn't do much (let's see, that's two really long strings of digits ending in an odd number*, guess that looks fine). The question is the quality of the code that generates the keys. I don't know what happened to make this very bad key get generated, but it was either bad code or someone deliberately trying to create bad keys for reasons unknown. Someone copying the key without permission would also be a problem, but that would be a problem even if the key was itself strong. In fact, if someone was deliberately trying to do that to sell a copy of the key, it would make sense for them to create a good key before copying it so that it wouldn't get revoked until someone knew it was being abused.

      * Example of RSA keys, not ECC keys, but you get the idea. In fact, manual inspection would make it obvious that this private key is definitely not a valid one, so maybe that would have helped. The problem is that nobody expects to be able to identify a bad key by sight because they have to be ridiculously broken for that to be possible, and if you thought that would happen then the computer could also identify that with one if statement, so nobody tries it.

    2. Eric 9001 Bronze badge
      Black Helicopters

      I would expect most "HSM"'s to be worse than writing a bash script that uses openssl (or preferably gnuTLS really) to randomly generate root certificates.

      After all, hardware engineers are even worse at security than software engineers.

      Some "HSM" collecting the key and then not printing anything about the key clearly worsens security - as we've found out, nobody notices that the private key is 0 prefixed 4, as they can't check it (a "HSM" should refuse to work and return an error if a key is too low entropy, but those hardware engineers…).

      It would have marginally improved security in this case if someone knew the basics of how cryptography worked and viewed the private key - as they would have seen that the key is trivially bruteforcible.

  36. Richard Pennington 1
    Facepalm

    Government backdoor?

    This is what happens if the Government mandates a covert backdoor. Because, of course, the Government can be trusted, and the Bad Guys will never find it.

    1. Eric 9001 Bronze badge
      Black Helicopters

      Re: Government backdoor?

      Malice shouldn't always be assumed in cases that can be explained by incompetence.

      Many governments aren't so dumb to require a key you can bruteforce by hand (although they often require things slightly less dumb).

      The government would do something like demand the private keys be provided and then leak them.

      In this case, the private keys of a trusted CA aren't useful alone - although for any MiTM'd TLS connection, for clients that trust the CA, the connection will successfully succeed with no error and the target won't notice, unless they check the certificate chain and notice that the CA is different from the one that the site uses (almost nobody does this).

      I've read about governments making CA's sign malicious TLS certs for MiTM use.

  37. TrevorH

    Exit, stage left

    https://emudhra.com/en/press-release/emudhra-to-exit-global-ssl-tls-certificate-business

    1. Anonymous Coward
      Anonymous Coward

      Re: Exit, stage left

      If only the powers that be would impose a $1,000 fine... per cert signed with these keys. (From the article, that's 60 million +.)

      To quote eMudhra's post you so helpfully linked to:

      "There were no end entity certificates issued out of the affected CA’s. Its infrastructure was not compromised and no data was breached."

      That you KNOW of. Given the private key was trivial, anyone could have created any certificates and signed them with that key, and they wouldn't know, as it didn't happen on their systems. Which would allow anyone to impersonate any site (Gmail, a bank, government websites...), using a certificate trusted by most browsers.

  38. Anonymous Coward
    Anonymous Coward

    School kids

    "Pick a number between 1 and 10"

    4

    "Thanks. That's our new secret number that underpins a big chunk of security on the internet."

  39. dwrolfe

    Not 42?

    I mean seriously...

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon