Slashdot Mirror


Factorable Keys: Twice As Many, But Half As Bad

J. Alex Halderman and Nadia Heninger write in with an update to yesterday's story on RSA key security: "Yesterday Slashdot posted that RSA keys are 99.8% secure in the real world. We've been working on this concurrently, and as it turns out, the story is a bit more complicated. Those factorable keys are generated by your router and VPN, not bankofamerica.com. The geeky details are pretty nifty: we downloaded every SSL and SSH keys on the internet in a few days, did some math on 100 million digit numbers, and ended up with 27,000 private keys. (That's 0.4% of SSL keys in current use.) We posted a long blog post summarizing our findings over at Freedom to Tinker."

40 comments

  1. So, Twice As Many? by WrongSizeGlass · · Score: 0

    I guess we could say yesterday's report was off by 100%, but let's not go crazy. 0.4% is still too many, but it's still not as bad as it could be with all the cert vendor break-ins that have gone on recently.

  2. Dont these keys change often? How would you match? by Kenja · · Score: 5, Insightful

    So how do you go about matching one of the keys that you guessed and a specific users session? What's more, how do you do that before the key changes? I can guess a password is "fishmonkeywrinkles", but without a matching account that wont do much good.

    --

    "Have you ever thought about just turning off the TV, sitting down with your kids, and hitting them?"
  3. Re:Dont these keys change often? How would you mat by Anonymous Coward · · Score: 0

    Pretty sure these guys care more about scaring people and publicizing it than having a practical use to the attack.

  4. 100-million-digit numbers by blueg3 · · Score: 1

    100-million-digit numbers? That's about what, about a 330-million-bit number? I haven't seen too many 40 MiB public keys. Even the product of two 4096-bit numbers is only three thousand digits.

    1. Re:100-million-digit numbers by blueg3 · · Score: 4, Informative

      Ah, I see. You regularly work with the product of all of the moduli gathered, which would be a fairly large number.

  5. Slashdotted. Anything new from Ars article? by Anonymous Coward · · Score: 0

    Site seems slashdotted, down or whatever.
    Was there anything new over articele from arstechnica?
    http://arstechnica.com/business/news/2012/02/crypto-shocker-four-of-every-1000-public-keys-provide-no-security.ars

  6. Why does this happen? by inglorion_on_the_net · · Score: 1

    What I would like to know is: Why does this happen? How do these bad keys get generated? Why so many of them?

    --
    Please correct me if I got my facts wrong.
    1. Re:Why does this happen? by Magada · · Score: 5, Informative

      If you have a shit pseudo entropy generator, the keys you generate will be easy to factor because they will share one common prime factor (recall that key security depends on the computational intractability of factoring large numbers). This is called a related-key attack and has (so far) been responsible only for the demise of WEP.

      As it turns out, OpenSSH/SSL has a shit PRNG which makes private keys generated with it recoverable using only the public keys, in some implementations and usage scenarios. Together, these amount to 0.4% of ALL public keys currently available on the open 'Net.

      --
      Something bad is coming when people are suddenly anxious to tell the truth.
    2. Re:Why does this happen? by Anonymous Coward · · Score: 1

      The keys are just two large prime numbers multiplied together.
      Rather than using a deterministic test to find a large prime, most times they use a probabilistic test to find a large pseudoprime number.
      http://en.wikipedia.org/wiki/Prime_number#Primality_testing_versus_primality_proving

      If you have 5 million devices generating pseudoprimes, odds are that at least two of the devices will generate a non prime number, and the two non prime numbers will share a common factor.
      So take 5 million random keys, which are 5 million random numbers, and find the GCD comparing them two at a time.
      http://en.wikipedia.org/wiki/Greatest_common_divisor#Using_Euclid.27s_algorithm

      Odds are you will find two of the random keys that share a common factor, and those two devices are now not secure.

      Based on the numbers in TFS, The odds of finding two psuedoprimes with a common factor is 0.4%, or 27,000 of the 5 million.

    3. Re:Why does this happen? by Anonymous Coward · · Score: 4, Informative

      As it turns out, OpenSSH/SSL has a shit PRNG

      AFAIK, OpenSSL gets its entropy from the operating system. If the OS has no good source of entropy, like on the embedded devices mentioned in the article, it doesn't matter what library you use to generate your keys, they will alway be predictable and therefore weak.

      The article makes no mention of keys generated on non-embedded devices being weak, so it's probably safe to assume that generating a key on a desktop or server with decent entropy sources using OpenSSL is secure.

    4. Re:Why does this happen? by Rich0 · · Score: 2

      What I'd like to know is how to tell if my key is a bad one or not. I don't mind throwing some CPU-time at the problem, but I don't see any info online for how to check your own key.

      Since I know my own private keys, perhaps an algorithm would be able to analyze how "similar" my keys are? Or, do you need to have the original primes?

    5. Re:Why does this happen? by znrt · · Score: 1

      What I'd like to know is how to tell if my key is a bad one or not. I don't mind throwing some CPU-time at the problem, but I don't see any info online for how to check your own key

      all needed info is already in the article. you just have to do what they did, but include your key in the set and check if it shares "p" with any other. if it does, generate a new one but move your mouse like crazy this time (a good moment to enjoy some flash game, maybe).

      the most stunnig part for me is still scanning the whole internets for keys. dude! maybe in near future there could be a trusted repository or service for this, dunno.

    6. Re:Why does this happen? by Magada · · Score: 1

      It gets worse. OpenSSL also retrieves uptime and mixes it with what it gets from /dev/urandom, iirc. Of course, uptime is not as random as all that, especially on embedded devices. Let's say you write a script that generates a key on first boot. That boot is going to take the exact same amount of time on all identical devices and there is precious little entropy to work with. Oops.

      --
      Something bad is coming when people are suddenly anxious to tell the truth.
  7. MEGA DUPE by EmagGeek · · Score: 0

    This was posted just 19 hours ago... it's still visible on my version of Slashdot's front page.

    1. Re:MEGA DUPE by aardvarkjoe · · Score: 1

      This was posted just 19 hours ago... it's still visible on my version of Slashdot's front page.

      Think of it as a blast from the past. There were days when every other story on /. was a dupe.

      --

      How can we continue to believe in a just universe and freedom to eat crackers if we have no ale?
    2. Re:MEGA DUPE by phantomfive · · Score: 3, Informative

      You mean this story that was actually mentioned in the summary if you had managed to finish the first sentence of the summary?

      --
      "First they came for the slanderers and i said nothing."
    3. Re:MEGA DUPE by Anonymous Coward · · Score: 0

      Now come on. There's no need to be an asshole to the GP. After all, isn't it obvious he's kinda special?

  8. Re:Dont these keys change often? How would you mat by Anonymous Coward · · Score: 0

    Or you could read the article, where they say that there's no need to panic, and criticize the New York Times for freaking out about it.

  9. Re:slashdotted by show+me+altoids · · Score: 1, Redundant

    Here's the whole article, for those who still can't get to it: New research: There's no need to panic over factorable keys--just mind your Ps and Qs By Nadia Heninger - Posted on February 15th, 2012 at 2:16 am You may have seen the preprint posted today by Lenstra et al. about entropy problems in public keys. Zakir Durumeric, Eric Wustrow, Alex Halderman, and I have been waiting to talk about some similar results. We will be publishing a full paper after the relevant manufacturers have been notified. Meanwhile, we'd like to give a more complete explanation of what's really going on. We have been able to remotely compromise about 0.4% of all the public keys used for SSL web site security. The keys we were able to compromise were generated incorrectly--using predictable "random" numbers that were sometimes repeated. There were two kinds of problems: keys that were generated with predictable randomness, and a subset of these, where the lack of randomness allows a remote attacker to efficiently factor the public key and obtain the private key. With the private key, an attacker can impersonate a web site or possibly decrypt encrypted traffic to that web site. We've developed a tool that can factor these keys and give us the private keys to all the hosts vulnerable to this attack on the Internet in only a few hours. However, there's no need to panic as this problem mainly affects various kinds of embedded devices such as routers and VPN devices, not full-blown web servers. (It's certainly not, as suggested in the New York Times, any reason to have diminished confidence in the security of web-based commerce.) Unfortunately, we've found vulnerable devices from nearly every major manufacturer and we suspect that more than 200,000 devices, representing 4.1% of the SSL keys in our dataset, were generated with poor entropy. Any weak keys found to be generated by a device suggests that the entire class of devices may be vulnerable upon further analysis. We're not going to announce every device we think is vulnerable until we've contacted their manufacturers, but the attack is fairly easy to reproduce from material already known. That's why we are working on putting up a web site that you can use to determine whether your device is immediately vulnerable. Read on for more details, and watch for our full paper soon. Don't worry, the key for your bank's web site is probably safe SSL is used to authenticate every major web site on the Internet, but in our analysis, these were not the keys that were vulnerable to the problems outlined in this blog post. So which systems are vulnerable? Almost all of the vulnerable keys were generated by and are used to secure embedded hardware devices such as routers and firewalls, not to secure popular web sites such as your bank or email provider. Only one of the factorable SSL keys was signed by a trusted certificate authority and it has already expired. There are signed certificates using repeated keys; some of them are generated by vulnerable devices, some of them are due to website owners submitting known weak keys to be signed, and for some of them we have no good explanation. Embedded devices are well known to have entropy problems. However, until now it wasn't apparent how widespread these problems were in real, Internet-connected devices. Background: key generation Websites and networked computers use public-key cryptography for authentication. The kind of authentication that we will be talking about here is a server certifying to a client that it really is the server that the client intended to connect to. An attacker who knows the private key to one of these systems would be able to impersonate the real system to a client or in many cases decrypt encrypted traffic between the client and server. The most widely used cryptosystem for this purpose is RSA. The RSA cryptosystem is intended to be based on the difficulty of factoring large numbers. An RSA public key consists of a pair of integers: an encryption exponent e and a modulus N, which is a large integer that itself is the produ

    --
    I feel sorry for people that don't drink, because when they get up in the morning, that's as good as they're gonna feel
  10. Re:slashdotted by Yvan256 · · Score: 1, Funny

    All I see is a wall of text.

  11. Re:Dont these keys change often? How would you mat by Anonymous Coward · · Score: 0

    I can guess a password is "fishmonkeywrinkles"

    Sonovabitch.
    Now I have to change my password.

  12. Re:slashdotted by WrongSizeGlass · · Score: 1, Insightful

    All I see is a wall of text.

    Apparently what you pay for to get past the 'pay wall' is the line feeds.

  13. Not a flaw in the crypto by Anonymous Coward · · Score: 2, Insightful

    FTA:

    For the system to provide security, however, it is essential that the secret prime numbers be generated randomly. The researchers discovered that in a small but significant number of cases, the random number generation system failed to work correctly.

    So it's the faulty implementations that we need to worry about. The foundation itself is still strong.

    1. Re:Not a flaw in the crypto by Anonymous Coward · · Score: 0

      So then the statistic doesn't really mean anything. There is no whatever% chance your key is secure; rather, if your implemenation is good, it's secure, and otherwise it isn't.
      Instead of the meaningless percentage a list of bad implementations should have been posted in the summary. (I'd check TFA, but it's slashdotted.)

  14. Re:Dont these keys change often? How would you mat by Anonymous Coward · · Score: 2, Funny

    Quick! Everybody log in as "Anonymous Coward" before he changes it!

  15. Debian keys by Anonymous Coward · · Score: 0

    Are the bad Debian ssh keys taken into account?
    http://digitaloffense.net/tools/debian-openssl/

    1. Re:Debian keys by Anonymous Coward · · Score: 0

      I doubt it. The flaw with Debian was a poor seed to the PRNG, not a poor PRNG. I wouldn't expect it to be any different from any other OpenSSL.

  16. Re:Dont these keys change often? How would you mat by Anonymous Coward · · Score: 2, Informative

    So how do you go about matching one of the keys that you guessed and a specific users session? What's more, how do you do that before the key changes? I can guess a password is "fishmonkeywrinkles", but without a matching account that wont do much good.

    The keys in question are the 'permanent' ones that are used to establish the (supposedly) secure user sessions. The authors are saying that it is possible to factor the RSA public key and arrive at the private key. Once you have the private key you can do do a man-in-the-middle attack and pretend to be the server.

    Furthermore, all user sessions can be recorded and decrypted after-the-fact since each session is encrypted with the (now compromised) private/public key pair. (Except if you're using SSL/TLS in ephemeral mode to provide perfect forward security--which hardly anyone does.)

    So two possible attacks are: (1) do a MITM for specific connections, and (2) record everything you can and decrypt later at your leisure.

  17. Old Debian keys? by Anonymous Coward · · Score: 0

    How many of the keys are still the old insecure Debian OpenSSL disaster keys?

  18. Seems overblown by hawguy · · Score: 2

    I think few people use the SSL keys on the home router/firewall for anything other than local administration of their firewall so it doesn't really matter if the SSL can be broken, no one is watching and no one cares.

    Even if the few people that actually used their home router/firewall to encrypt data sent over the public internet have hackable encrypted sessions, it's pretty unlikely that an attacker is watching their packets on the off chance that they have a hackable key when there are far easier and more common vulnerabilities to exploit when the attacker has access to your network packets (like firesheep style session stealing).

    1. Re:Seems overblown by ModernGeek · · Score: 1

      The biggest question I have is whether or not I need to keep my public ssh keys more private from now on.

      --
      Sig: I stole this sig.
    2. Re:Seems overblown by daid303 · · Score: 1

      You don't. Your public ssh keys are generated with a good /dev/random, these refactorable keys are not.

    3. Re:Seems overblown by timeOday · · Score: 3, Informative

      There must be small businesses using VPN features of these routers (I am not implying D-Link is the affected party by the way). Otherwise they wouldn't have found so many such keys on the open net (0.4% of all keys) - certainly there aren't that many people remotely configuring their firewalls etc. If I were using one for VPN I would watch closely for a firmware upgrade in the near future.

  19. Re:slashdotted by nschubach · · Score: 2

    I see a few spaces in there.

    --
    Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
  20. Twice as many ? by Anonymous Coward · · Score: 0

    Both research teams claim 27000 factored keys. The difference seems to be in how they count the number of active certificates.

  21. Debian screw up? by Anonymous Coward · · Score: 1

    I wonder if these keys came as the result of the massive debian packaging screwup of openssh?
    http://lists.debian.org/debian-security-announce/2008/msg00152.html

  22. Woot! by hobit · · Score: 0

    An official "Woot!" to Alex, Nadia and Michigan. Sorry you were scooped, but it sounds like you've actually identified the underlying problem.

    --
    As Nietsche famously said, "If you stare too long into the Abyss, 1d4 Tanar'ri of random type will attack you."
  23. 499/500 keys secure by Anonymous Coward · · Score: 0

    99.8%

    Isn't this the same as saying 1 of every 500 keys is not secure? Doesn't sound secure to me.

  24. Re:slashdotted by Anonymous Coward · · Score: 0

    Here's the whole article, for those who still can't get to it:
    ( Now, with line feeds. )
    New research: There's no need to panic over factorable keys--just mind your Ps and Qs By Nadia Heninger - Posted on February 15th, 2012 at 2:16 am

    You may have seen the preprint posted today by Lenstra et al. about entropy problems in public keys.
    Zakir Durumeric, Eric Wustrow, Alex Halderman, and I have been waiting to talk about some similar results. We will be publishing a full paper after the relevant manufacturers have been notified. Meanwhile, we'd like to give a more complete explanation of what's really going on.

    We have been able to remotely compromise about 0.4% of all the public keys used for SSL web site security. The keys we were able to compromise were generated incorrectly--using predictable "random" numbers that were sometimes repeated. There were two kinds of problems: keys that were generated with predictable randomness, and a subset of these, where the lack of randomness allows a remote attacker to efficiently factor the public key and obtain the private key. With the private key, an attacker can impersonate a web site or possibly decrypt encrypted traffic to that web site. We've developed a tool that can factor these keys and give us the private keys to all the hosts vulnerable to this attack on the Internet in only a few hours. However, there's no need to panic as this problem mainly affects various kinds of embedded devices such as routers and VPN devices, not full-blown web servers. (It's certainly not, as suggested in the New York Times, any reason to have diminished confidence in the security of web-based commerce.)

    Unfortunately, we've found vulnerable devices from nearly every major manufacturer and we suspect that more than 200,000 devices, representing 4.1% of the SSL keys in our dataset, were generated with poor entropy. Any weak keys found to be generated by a device suggests that the entire class of devices may be vulnerable upon further analysis. We're not going to announce every device we think is vulnerable until we've contacted their manufacturers, but the attack is fairly easy to reproduce from material already known. That's why we are working on putting up a web site that you can use to determine whether your device is immediately vulnerable. Read on for more details, and watch for our full paper soon. Don't worry, the key for your bank's web site is probably safe SSL is used to authenticate every major web site on the Internet, but in our analysis, these were not the keys that were vulnerable to the problems outlined in this blog post.

    So which systems are vulnerable? Almost all of the vulnerable keys were generated by and are used to secure embedded hardware devices such as routers and firewalls, not to secure popular web sites such as your bank or email provider. Only one of the factorable SSL keys was signed by a trusted certificate authority and it has already expired. There are signed certificates using repeated keys; some of them are generated by vulnerable devices, some of them are due to website owners submitting known weak keys to be signed, and for some of them we have no good explanation. Embedded devices are well known to have entropy problems. However, until now it wasn't apparent how widespread these problems were in real, Internet-connected devices.

    Background: key generation Websites and networked computers use public-key cryptography for authentication. The kind of authentication that we will be talking about here is a server certifying to a client that it really is the server that the client intended to connect to. An attacker who knows the private key to one of these systems would be able to impersonate the real system to a client or in many cases decrypt encrypted traffic between the client and server. The most widely used cryptosystem for this purpose is RSA. The RSA cryptosystem is intended to be based on the difficulty of factoring large numbers. An RSA public key consists of a pair of integers: an encryption expone