Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Encryption Security Bug

GnuPG's ElGamal Signing Keys Compromised 144

KjetilK writes "Werner Koch just sent an announcement saying that there is a severe bug in GnuPG >= 1.0.2 that makes it easy to compromise ElGamal keys used for signing. Note that such keys are not generated by GnuPG's standard setup, and should be relatively rare. Among the 850 public keys in my personal keyring, there were only one such public key (and a few subkeys). There is already a patch available to disable these keys."
This discussion has been archived. No new comments can be posted.

GnuPG's ElGamal Signing Keys Compromised

Comments Filter:
  • by doktorstop ( 725614 ) on Thursday November 27, 2003 @09:52AM (#7577027) Homepage Journal
    "Gamal" is translated in Swedish as "old". Those who came out with this name knew how soon it would become obsolete!
    • by adrianbaugh ( 696007 ) on Thursday November 27, 2003 @10:01AM (#7577063) Homepage Journal
      "Old" in cryptography is generally good. It takes time for crypto systems to prove themselves in the wild (regardless of how wonderful they might be in practice). Witness the continued popularity of 3DES. I'd much rather use a well-understood 30-year-old algorithm than some young upstart algorithm that may well still have vulnerabilities.
      • Re:Conspiracy theory (Score:4, Informative)

        by bigberk ( 547360 ) <bigberk@users.pc9.org> on Thursday November 27, 2003 @10:52AM (#7577266)
        I'd much rather use a well-understood 30-year-old algorithm than some young upstart algorithm that may well still have vulnerabilities.
        But when stuff like this happens, you have to tell the difference between a flaw in the algorithm and a flaw in the implementation. Brings to mind MS Crypto and even several OpenSSL vulnerabilities. Doesn't mean SSL is flawed, just means that the implementations screwed up somewhere.
      • From what I can tell, this is a mistake in the implementation of ElGamal signing + encryption keys, not any attack on the ElGamal algorithm per se. (And not even on encryption-only keys, only a specific type of key)

        3DES might be a very solid algorithm, but as far as I can tell none of the other symmetric cryptoalgorithms (IDEA, BlowFish, TwoFish, Rijendael aka AES, CAST etc.) have had any practical algorithm attacks. Not to mention that 3DES can't be used for signing as is described here, so it's not even
    • correction (Score:3, Interesting)

      by segment ( 695309 )
      Actually thats Gammal .. Gamal means nothing in Swedish... Debil on the other hand... or Dumbom, analfabet, olbidad... Yea those..
    • Re:Conspiracy theory (Score:2, Interesting)

      by 68k geek ( 573999 )
      "Gamal" is translated in Hebrew as "Camel". Wonder what that means... Perl ref?
    • Re:Conspiracy theory (Score:2, Informative)

      by Anonymous Coward
      It's amazing to see really ignorant (and crypto-agnostic) people posting snappy comments in prominent places and on stuff that is way beyond their reach.

      Taher El Gamal is the name of the person that came up with the algorithm behind the ElGamal keys.

      If you ever used SSL then you used something else that boiled in Taher El Gamals crypto-pan.

      But I guess that's just beyond the average Inet user these days ...
    • ElGamal in Hebrew means 'camel'. So?
  • You have... (Score:3, Funny)

    by clifgriffin ( 676199 ) on Thursday November 27, 2003 @09:55AM (#7577041) Homepage
    ..destroyed my trust in the internet and computers! :-(

    *sobs hysterically*

    blogzine | Turkey Smashing Fun [blogzine.net]
  • Since I'm too overstuffed with desserts, eaten during their making process, to try do the patching myself.
  • by quigonn ( 80360 ) on Thursday November 27, 2003 @09:57AM (#7577051) Homepage
    Fortunately, Werner Koch informed me yesterday already (I got the email at some time in the morning), so I had plenty of time to create a new key, sign it with the old one, and revoke the old one.

    Of course, this had one disadvantage: since the old key is potentially compromised, I cannot really trust in my web of trust anymore. :-/
    • by Jon_MrJR ( 568060 ) on Thursday November 27, 2003 @10:14AM (#7577120)
      from the annoucement:

      "According to the keyserver statistics, there are 848 primary ElGamal signing keys which are affected. These are a mere 0.04 percent of all primary keys on the keyservers"

      percentage of slashdot readers among those ? you'd need to specifically want ElGamal (thus know what it is [x5.net]) to prefer it to other algos..

    • Actually, it was a funny coincidence. The keyring I mentioned, is the keyring of public keys of people that are close to me in my web of trust, or that I've bumped into on mailing lists, and therefore decided to download their key to see if I can get a good path, or people who have written software I use, for the same reason. It is not the same as the 848 keys Werner quoted, that's an entirely different set...

      The one key I found belonged to a Debian developer, whose key I signed on a keysigning party this

      • And the unlucky bastard that lost a key with 150+ signatures and didn't get the official mail is ..... me.

        I actually choose this type of key because I was thinking that it was MORE secure, silly me.

        But it is quite strage that I didn't get the mail as my key is on the public servers. Well, thanks to KjetilK.
  • More information (Score:5, Informative)

    by Vario ( 120611 ) on Thursday November 27, 2003 @10:04AM (#7577074)
    You can get more information on the (german) site heise:
    http://www.heise.de/newsticker/data/pab-27.11.03-0 00/ [heise.de]

    The full advisory from Werner Koch can be found here:
    http://archives.neohapsis.com/archives/fulldisclos ure/2003-q4/2998.html [neohapsis.com]

    It seems that about 800 people are using the compromised keys.

    To check if your key is in danger you have to check the type of the key. All type 20 keys can be compromised. Here is a small shell script to check our key:

    gpg --list-keys --with-colon | awk -F: '($4 == "20") {print $0;}

    If your key is in danger you should create a new one and revoke the old one immediately.
    • Re:More information (Score:2, Informative)

      by Anonymous Coward
      Missing an apostrophe:
      gpg --list-keys --with-colon | awk -F: '($4 == "20") {print $0;}'
    • Lokigames (Score:2, Interesting)

      by Mawbid ( 3993 )

      pub:-:1024:20:92C0CB35D684EDE0:2001-01-15:::-:Loki Updates ::escESC:

      pub:-:1024:20:95440ACE31383EED:2000-11-09:::-:Mind Rover ::escESC:
      pub:-:1024:20:1D8BD41C85810B5E:2000-12-02:::-:Trib es 2 ::escESC:
      pub:-:1024:20:E08E85DAC41DB9BC:2000-11-13:::-:Loki Demos ::escESC:

      ...not that we didn't already have reason to distrust any new Loki releases :-)

  • by selderrr ( 523988 ) on Thursday November 27, 2003 @10:06AM (#7577082) Journal
    woohoo. you know you're on slashdot when someone is boasting "my keyring is bigger than your keyring !"
  • Re: (Score:2, Insightful)

    Comment removed based on user account deletion
    • The difference being that it would take MS 6 months to release a patch, and even then most sysadmins wouldn't apply it.
    • by Anonymous Coward
      Yes, it is the same thing as MS does, but not the way you put.

      MS has a huge chunk of the market share: When a security flaw is found, the majority of the computers are hit.

      If there were more diversion, we wouldn't have so many problems.
    • I'm not so sure this was an example of that. This was an experimental setting to begin with, and the fact that it is included in the base GPG code doesn't affect the people using the standard settings. As long as the experimental or rarely used code is kept separate from the rest of the program, the only problem is the extra source code you have to download and the extra binary size (if there's no option to #ifdef those sections out).

      Unless of course you choose to use the features which aren't highly te

      • Re: (Score:3, Insightful)

        Comment removed based on user account deletion
        • Have you ever heard the term "beta"? If a feature is not well-tested, then it should not be in the base code.

          So experimental drivers should not be included in the linux kernel?

          Most people don't compile their own executables. Period.

          And that's a good reason why the standard binaries should include as many features as possible, regardless of whether or not those features are experimental, so long as the inclusion of those features does not affect the program when they are not used.

          Something as impor

          • by Gemini ( 32631 ) on Thursday November 27, 2003 @01:20PM (#7577946)
            This wasn't so much experimental code as it was an experimental feature. The code worked fine. It was the algorithm itself which was exploited.


            It's the other way around. The Elgamal algorithm is fine. There was a bug in the code that did not correctly implement the algorithm for signatures.

            Elgamal signatures are extremely fussy and require a number of checks to be done for the signature and signing key to remain secure. Elgamal encryption, on the other hand, is simpler.

            Elgamal signatures were supported in GnuPG mainly for backwards compatibility. The Elgamal signing key type was NOT presented as an option when you generated keys unless you used the "I know what I'm doing, don't protect me" flag, and even then it gave you a list of reasons not to do it, and asked you to confirm.
            • OK. Now i think I understand. The signing code for Elgamel broke in GPG 1.0.2. That broke key creation because key signing is part of key creation (by default, or always?) when creating Elgamel sign+encrypt keys.

              I'd still say that signing using Elgamel keys is an experimental feature, though. And creation of Elgamel signing keys certainly is (as you said you had to use special flags).

              • OK. Now i think I understand. The signing code for Elgamel broke in GPG 1.0.2. That broke key creation because key signing is part of key creation (by default, or always?) when creating Elgamel sign+encrypt keys.

                Key signing is always a part of key creation. An OpenPGP key is made up of a primary key, followed by user IDs, each bound to the primary key with a signature, followed by subkeys, each bound to the primary key with a signature.

                Thus, the signing bug caused two problems:

                • If you make a signatu
          • Comment removed based on user account deletion
            • So experimental drivers should not be included in the linux kernel?

              Not in a released version of the kernel. Only in beta versions.

              So if someone wants to use an experimental driver, they're stuck with using an entire experimental kernel? That's ridiculous.

              As the author, you don't know if it affects the program or not. All you know is whether you believe that it affects the program. That's what beta testing is for.

              Unless your code is using random gotos that's just not true. Your experimental functio

    • If there were only 850 of those keys, then why was that "feature" included?
      There wern't 850 of those keys. The poster was stating that he has 850 total keys on his personal keyring. Only one of them was of the type we're discussing. This one person's keyring isn't an indication of how many of those types of keys exist on all keyrings worldwide.
    • by Anonymous Coward
      Wrong. This has nothing to do with complexity, but with choise. It is good that there are alternatives to choose from. If there is only one option, one bug will affect everything and everybody. So having a choise is good.

      It would have been increased complexity when all options have dependencies. One failure would be more probable and bring the whole system down.

      To answer your question: it's nice to have a choise. Now there is redundancy in the system.

      And yes, we would all have picked on MS. That is just
      • Comment removed (Score:4, Insightful)

        by account_deleted ( 4530225 ) on Thursday November 27, 2003 @12:52PM (#7577824)
        Comment removed based on user account deletion
        • I don't want to find out that the "choice" I made for a key type is something that 0.04% of people chose and that, because of its rarity, it had an undiscovered flaw.

          I see. You must have just failed to read the announcement:

          Note also that ElGamal signing keys cannot be generated without the use of a special flag to enable hidden options and even then overriding a warning message about this key type.

          I'm ssorry. You enable special hidden options and override warnings, and you've got no one to blame

        • Choice is not good in encryption. Strength is. I don't want an encryption program that lets me choose between 15 types of keys, some of which are poorly tested. I want to select the key size and that's it.
          Why should the user be allowed to select the key size? ;-)
    • by smcv ( 529383 ) on Thursday November 27, 2003 @10:32AM (#7577183) Homepage
      The fact that it was there in the first place was a workaround for stupid legal issues - at the time GnuPG development started, the author wasn't sure whether DSA signatures were patented, so he allowed El Gamal keys to be used for signatures as well as encryption. It turned out DSA signatures were OK, and the default for all recent versions is to use DSA signatures with El Gamal for encryption.

      The other available key types (RSA+RSA, DSA+El Gamal) are there for interoperability; I think the consensus seems to be that DSA+El Gamal is probably better, but RSA+RSA needs to be there because that's what the original PGP used.

      On the other hand, I agree that it sounds from the announcement as though the optimizations that caused the flaw were unwise.
      • The other available key types (RSA+RSA, DSA+El Gamal) are there for interoperability; I think the consensus seems to be that DSA+El Gamal is probably better, but RSA+RSA needs to be there because that's what the original PGP used.

        There are more combinations than RSA+RSA and DSA+Elgamal. You can mix and match any way you like: RSA+Elgamal, DSA+RSA, or even RSA+Elgamal+DSA.

        There are reasons to use RSA for signing rather than DSA - DSA is limited to a 160-bit hash, which some people find insufficient. R

      • by Olmy's Jart ( 156233 ) on Thursday November 27, 2003 @12:01PM (#7577594)
        It's more complex than that.


        The old PGP used RSA sign-and-encrypt keys. The same key was used for both encryption and signatures. You can only generated those keys under "expert" mode (same place you would generate ElGamal signature keys). Generate an RSA+RSA key under GnuPG and you get two keys, a primary signature key and a different encryption key. Both will be RSA. But the RSA+RSA was NOT what the old PGP used. There's good reason to have separate keys and subkeys with different functionality and attributes. But that wasn't in the original PGP.


        The old PGP also used IDEA for the symetrical algorithm and that's STILL patented, so the stock GnuPG STILL doesn't contain it and you STILL can't interoperate with the old PGP (pre PGP 5.0).


        An ElGamal signature key blows goats where it comes to performance (the verify algorithm is at least an order of magnitude worse than encrypt, decrypt, or sign). Even having one on your keyring sends the key verify option into the weeds in turtle mode, because of the verification signatures taking soooo looonnnggg to verify. It's an oxymoron to have those keys generated under "expert" mode as well (since said "expert" wouldn't be one if he wanted one).

    • by Gemini ( 32631 ) on Thursday November 27, 2003 @10:59AM (#7577299)
      There are historical reasons. Basically, when GnuPG was first written there were still questions about the patent status of DSA, so using Elgamal signatures was allowed. This is not against the OpenPGP standard, by the way, which does allow Elgamal signatures.

      Once the patent issued with DSA were worked out (if I recall, the US government bought it and made it free for any use without royalties), then GnuPG started using DSA like PGP. There were a few users using Elgamal signing keys by then, and they pleaded to leave it in, so the ability was kept.

      Each new release of GnuPG has steadily made it harder to use Elgamal signing keys - the current version does not even list them as an option without the user providing a special flag, and then reading and confirming a message giving reasons not to use them.
    • The Economist [economist.com] has an article [economist.com] on Internet Security. Very insightful yet brief, as usual. It even has the obligatory quotes from Bruce :). Quoting:

      Ask, for instance, Dan Geer, an expert on software security and a top executive of @Stake, a security consulting firm. In September, he led a group that wrote a report blaming Microsoft's virtual "monoculture" in operating systems for the internet's frailty. No sooner was the report published than he found himself out of a job. @Stake, which counts Microsoft am

  • Open v. Closed (Score:5, Insightful)

    by sanctimonius hypocrt ( 235536 ) on Thursday November 27, 2003 @10:28AM (#7577174) Homepage Journal
    Here's an important point. At the end of the email, Werner Koch writes:
    Thanks ====== Phong Nguyen [4] analyzed the implementation of GnuPG's cryptographic parts and found this vulnerability. He also developed actual code to mount the attack and was so kind to give me enough time to have a look at his paper and to gather a list of known type 20 keys owners. I am really sorry for this, Werner
    Open source isn't bug-free, but we thank the guy who finds the problem, take responsibility, and fix it.
    • > Open source isn't bug-free, but we thank the guy who
      > finds the problem, take responsibility, and fix it.

      we also thank the system that makes the code available to this guy so that he can submit a suggestion for a fix.
    • Re:Open v. Closed (Score:5, Insightful)

      by Anonymous Coward on Thursday November 27, 2003 @10:49AM (#7577256)
      Subtitle: Instead of suing him for being smart and violating the DMCA
      • Instead of suing him for being smart and violating the DMCA

        +43, Insightful

      • Good attempt at being clever, but seeing as GnuPG is open source, backward enginnering isn't nessasary. You can't get in trouble under the DCMA for finding holes in open source software I'm afraid..
        • Re:Open v. Closed (Score:1, Interesting)

          by Anonymous Coward
          Good attempt at being clever, but seeing as GnuPG is open source, backward enginnering isn't nessasary. You can't get in trouble under the DCMA for finding holes in open source software I'm afraid..

          The DMCA specifically allows reverse-engineering in order to create a compatible product, but people have been sued for that (DeCSS). Best Buy and others sent used the DMCA against material that isn't even copyrightable (a list of prices).

          So it's not that far out to suggest someone could be sued for finding a
        • Re:Open v. Closed (Score:1, Interesting)

          by Anonymous Coward
          You can't get in trouble under the DCMA for finding holes in open source software I'm afraid..
          You can if the software in question, "effectively limits access to a work." If you use GnuPG to protect something you hold the copyright on, then you can sue anyone who distributes GnuPG cracks.
  • by Anonymous Coward
    Does this constitute a crisis in open source? I'm always advocating open source software with my employer and one of the biggest selling points is security.

    With this news, and the whole Debian security fiasco, this argument is getting more difficult to make.

    • by ajs318 ( 655362 ) <sd_resp2@earthsho[ ]o.uk ['d.c' in gap]> on Thursday November 27, 2003 @11:32AM (#7577450)
      Well, it depends on how you look at it. Sure ..... open source stuffs up occasionally. When we have a problem, everybody knows about it and it gets fixed. Whereas with closed source, the vendor can live in denial, pretending nothing has hapened, until the problem becomes serious enough to warrant attention.

      For some reason, things get invented in different places at roughly the same time. Vide the telephone {Alexander Graham Bell, SCO and Elisha Gray, USA}; the electric light bulb {Joseph Swan, ENG and Thomas Edison, USA} and the gramophone / phonograph {Emil Berliner, DBR and Thomas Edison, USA}. There are other examples, and I'm sure other countries have their own versions of who invented what.

      Also realise that, despite what the mass media are fond of telling you, good guys actually outnumber bad guys by one hell of a margin.

      Now, if both these principles - parallel invention and criminals in the minority - are true, then not only would the probability of a particular open source software vulnerability being discovered by a good guy be greater than the probability of it being discovered by a bad guy, but it is quite likely that if a bad guy were to discover a vulnerability, then a good guy also would discover it around the same time. Well, parallel invention has been proven throughout history, and good guys really do outnumber bad.

      Never judge someone on the basis of corrected mistakes. Most people don't get things right first time, and it's better to admit to a mistake and show how you fixed it than to pretend you never make mistakes.
      • {Alexander Graham Bell, SCO and Elisha Gray, USA}

        Scots everywhere are offended that you would associate Mr. Bell with the American SCO group.
        • Ooops ..... the abbreviation for "Scotland" as used in international sporting events {being what I was trying to parody} does rather resemble an abbreviation for a rather nasty corporate piece of work, doesn't it? Maybe the whole population of Scotland should take it out on Darl McBride for abusing their abbreviation? Actually, that's rather a pleasant thought :-)
    • The argument with cryptography extends further than just: "is free software more secure than proprietry software?". I'm going to use an example from "Applied Cryptography" (Bruce Schneier):

      If I built a safe and kept the blueprints top-secret I can quite easily tell people that it is secure. However, that security relies on trust. You are trusting me that the blueprints I'm keeping secret are infact secure because I say so. I argue that isn't secure, it's obsecure. If on the other hand I were to build a
      • "PS: GnuPG is free software, not open source software.">

        I'm afraid I, and the rest of the Free Software community disagree with you [opensource.org].

        • As part of the FSF's GNU project, in order to preserve the ethical implications of the project, the preferred nomenclature is Free Software [fsf.org]
          • Thank you, Strandenko (I will echo your link).

            hacker:
            If you had taken the time to read an essay by RMS himself [fsf.org] or the general philosophy of free software, you'd know the very slight differences between the two movements - a difference which is made ever more important with software designed to protect freedom of speech by use of cryptography. I beg you to take the time to read the essay linked in mine and Stradenko's comments.
    • Does this constitute a crisis in open source?

      Crisis? What crisis?

      I'm always advocating open source software ... and one of the biggest selling points is security.

      If your definition of "security" is that bugs that allow security to be compromised can be found in software, then you may need to educate yourself before advocating your point-of-view. What are your other choices? Security holes you don't know about? That's real secure.

      "Security" is not whether bugs can be found. It is a whole range of

  • Werner says in his announcement:

    For historic reasons [3], GnuPG permits creating ElGamal keys which are usable for both encryption and signing. It is even possible to have one key (the primary one) used for both operations. This is not considered good cryptographic practice, but is permitted by the OpenPGP standard.

    I don't understand why it is 'not considered good cryptographic practice' to use the same key to sign and encrypt. Is Werner saying that this an ElGamal weakness or is it a general pub

    • by Gemini ( 32631 ) on Thursday November 27, 2003 @04:53PM (#7578798)
      I don't understand why it is 'not considered good cryptographic practice' to use the same key to sign and encrypt. Is Werner saying that this an ElGamal weakness or is it a general public-key encryption weakness? If it is not considered good cryptographic practice, then why is (was?) it in the OpenPGP standard?


      This is a general public key cryptography thing. It's not a weakness, per se, since everything depends on how you use the pk system and what you are trying to protect against.

      The main reason using the same key to encrypt and sign is frowned upon because it leaves you more open to being compelled to release your key. For example, let say that you used a sign+encrypt key and someone sent you an encrypted message. The government demands your key so they can decrypt the message. Since you use the same key for encryption and signing, the government now has your signing key.

      Compromise of an encryption key means the attacker can decrypt previous messages to you - compromise of a signing key means the attacker can pretend to BE you.

      Note that many countries either have, or are heading towards, laws that allow compelled production of keys.

      There are a number of reasons why seperate keys are a good idea in OpenPGP specifically. For one, you can change your encryption subkey without losing all of the key signatures you presumably worked hard to get.
  • One line check (Score:2, Informative)

    by peio ( 646164 )
    gpg --list-keys | awk 'BEGIN { printf("%s %s \n", "Key ID", "Email") } /^pub/ && $2 ~/G\// {keys++; print substr($2,7), $NF} END {if (keys > 0) print "You have",keys,"signatures to revoke!"; else print "You are fine :)" }'

Measure with a micrometer. Mark with chalk. Cut with an axe.

Working...