GnuPG Short ID Collision Has Occurred.
kfogel writes "Asheesh Laroia now has two GPG different keys with the same short ID (70096AD1) circulating on keyservers. One of them is an older 1024-bit DSA key, the other is a newer 4096-bit RSA key. Oops. Asheesh argues that GPG's short IDs are too short to be the default anymore — collisions are too easy to create: he did it on purpose and openly, but others could do it on purpose and secretly. More discussion (and a patch by dkg) are in this bug report."
When you've got nothing on the line, you're not going to be as careful about cryptography as someone who does.
8 hex digits means 8*4= 32 bits. It has taken until now to produce a single collision in something with a 32 bit key? Wow, that's great!
And even now, it has been done by tweaking two different versions.
So, yes, it's probably time to use a larger short representation. Maybe go to base-32 or -64 instead of base 16. But the protocol is nothing short of amazing.
Prediction for end of Universe #42: Fencepost error in Quantum_bogosort.cpp
How seriously do you really take security if you let your certificate expire like this? Is g10code.com legitimate?
Having done the most basic of research, I have found out that GNUpg short collisions are everyday events. Which makes me wonder what the point of the article was.....
Prediction for end of Universe #42: Fencepost error in Quantum_bogosort.cpp
Doesn't this just make it more annoying to do searches, since that key (really a "key name") isn't unique? The encryption/decryption/signing uses the whole big key, right? So this would strike me as a client problem whose impact is limited to being able to verify a signature or decrypt something encrypted. It's seemingly more a nuisance than an actual security problem; you shouldn't be trusting keys from unknown sources, and it's easy enough to revoke and reissue keys if you end up having a conflicting index.
Eep. Well, it expired 3 days ago. But yeah.
According to Perspectives, it's been consistent for the past 176 days. Good enough for me.
There is the remote chance that several keys will have the same "short" Key ID. The "long" Key ID decreases the risk of a collision, but can be more unwieldy to use.
Considering that certain versions of the GnuPG man page actually explicitly cover this, I'd say this is a non-story. Just use the long key ID if you're worried.
This didn't happen by chance, though. He generated a script that kept generating keys until the key Id's matched an existing one.
With 32-bit short keys, there is a time complexity of 2^32. This is a preimage attack.
To make it unfeasbile to do they could go with 128-bit short keys.
Or if your bug tracker comments are top-posted....
What is this? Outlook?
I read the whole thing, hoping to figure out why I care. Looks like there's a bug in Gnu PG, if you know someone's short key you can possibly do something or other, possibly replace their key with yours in some way. Surely it wouldn't authenticate, or it should at least say the message came from someone else if you check someone's signature. Is there any actual problem here?
TL;DR, your blog sucks.
http://www.senderek.com/SDLH/
http://senderek.com/SDLH/discrete-logarithm-hash-for-RSA-signatures.ps
http://www.senderek.com/pcp/pcp-security.html
http://www.mit.edu:8008/bloom-picayune/crypto/13190 {link appears dead/down :(}
[Relevant text from above link copied from the Pure Crypto Project Site link above]
Shamir's discrete logarithm hash function (SDLH)
The SDLH is base on a simple idea that once the message is converted into a long integer a hash of the message can be computed as follows:
hash(x) = g ^ x (mod p*q)
given, that both p and q are large primes which are being kept secret so that factoring n = p*q is computationally infeasible.
This hash function is provably collision-resistant, I quote the prove Ronald L. Rivest presented in his posting:
Adi Shamir once proposed the following hash function:
Let n = p*q be the product of two large primes, such that
factoring n is believed to be infeasible.
Let g be an element of maximum order in Z_n^* (i.e. an
element of order lambda(n) = lcm(p-1,q-1)).
Assume that n and g are fixed and public; p and q are secret.
Let x be an input to be hashed, interpreted as a
non-negative integer. (Of arbitrary length; this may be
considerably larger than n.)
Define hash(x) = g^x (mod n).
Then this hash function is provably collision-resistant, since
the ability to find a collision means that you have an x and
an x' such that
hash(x) = hash(x')
which implies that
x - x' = k * lambda(n)
for some k. That is a collision implies that you can find a
multiple of lambda(n). Being able to find a multiple of lambda(n)
means that you can factor n.
I would suggest this meets the specs of your query above.
Cheers,
Ron Rivest
Ronald L. Rivest
Room 324, 200 Technology Square, Cambridge MA 02139
Tel 617-253-5880, Fax 617-258-9738, Email
There are a number of issues to be addressed, especially when the SDLH is being used together with the RSA signature scheme and a full analysis of the SDLH's security can be found in the paper "A Discrete Logarithm Hash Function for RSA Signatures". The analysis shows, that SDLH can safely be used together with RSA once certain conditions are met with regard to the selection of the user's key material. For details I like to refer to the paper about SDLH.
CAPTCHA: revolter {Well, cryptography can be used to secure communications between individuals during a revolt....}
The world around me is bounded by the extent of my mom's basement!
Have gnu, will travel.
With 32-bit short keys, there is a time complexity of 2^32.
That is only if you need to match one specific key.
To just get a match between two 32-bit keys, you on average need to generate less than 80000 keys.
But this is irrelevant, because the short ID isn't meant for positive authentication. It's a negative indicator - if the short key doesn't match, you don't need to check further, but if it does match, you do. Anyone who uses it for positive authentication deserves what they get.
It has been known for many years that two OpenPGP keys might have the same key ID. After all, a 36-bit hash of a 1024-bit or 4096-bit key cannot be unique.
However, no key fingerprint collision is yet known when the key-type and key-length are both the same. That is why, when verifying the ownership of a key, the owner is supposed to supply the type (RSA vs DH/DSS), the key-length (not the key ID length), and the key fingerprint (128 bits for RSA and 160 bits for DH/DSS).
In Laroia's case, neither the key-types nor the key-lengths were the same for the two keys that had the same key ID.
Note: I indicate "no key fingerprint collision is yet known". Such a collision is mathematically possible, but it is extremely difficult (not impossible) to contrive.
I should have done that research before posting -- thank you for clarifying the situation.
There is still a bug here, in that (according to the linked bug ticket) even if one *requests* a key using a longer ID, from a keyserver that can handle the request, GPG transforms it to the short ID and then returns you all the keys that match. That seems like non-optimal behavior, given that the user asked carefully, and the server could have answered, if only GPG would transmit the true request.
However, that's a slightly different problem from what I originally posted, so I'm glad you replied.
http://www.red-bean.com/kfogel
Which surprises you most?
1. That GPG developers and users have ignored the well-known problem (in security circles) of the Birthday Paradox? ;)
- or -
2. That there are > ~45k GPG users such that this even is more likely than not to occur.
Seriously though, a 1 in 65536 chance of a collision doesn't seem acceptable to me.
Ah okay, I didn't read the bug report. That is indeed a bug, but it isn't a security vulnerability.
And that's why the fingerprint's used to actually check which key is what.
The short keyid has always been a short hand for the sake of simplicity, aka, if it doesn't match, it's wrong (that always works).
For performing true verification, fingerprint, always. If you check the key signing parties, they always check fingerprints too. For that reason.
See: "0xDEADBEEF"
It is a vulnerability. What you mean is that it's not a design error.
The semantics here are actually important ;-)
Hash function produces same output from different inputs. More at 11
Collisions of random numbers with approximately equal distribution across the sample space are variations of the classic "birthday problem". And, with a 32-bit sample space, you have a 50% chance of a collision with slightly fewer than 77,500 entries.
I tried calculating it for a 64-bit hash, but the online calculator I used using was apparently using a linear calculation and didn't validate the input. It timed out after about 15 minutes. Oops, sorry I hammered the server. Maybe next time he'll validate the input and maybe even use a more efficient algorithm.
So, lets just say it'll take ~ (77500^2) *.8 ~ 4.8E9 IDs for a 64-bit hash to have a 50% chance of a collision. Take it up to 80 or more bits and the likelihood of a collision becomes very small even if everyone on the planet has an ID.
make imaginary.friends COUNT=100 VISIBLE=false
It isn't a security vulnerability for the same reason that key id collisions aren't vulnerabilities. If I enter a long fingerprint and get two keys, one of which matches only the short id, that is a user interface bug. It isn't a security issue because I should never trust a key I pulled from the cloud unless a) the web of trust tells me it's okay (which means it has checked the full public key), or b) I subsequently check the full fingerprint in my local database.
I suppose you could expect GPG to verify it for you after typing in the long fingerprint, then I guess it's severe. I just wouldn't trust a key unless I looked at the fingerprint in my local database.
let me see...
windows 7 is a fair operating systems, real people couldn't care less between what run their smart phones unless it's iOS, linux year of the desktop must have been the last one because this year graphic cards have no drivers.
Moral of this? To fetch my key, use:
gpg --recv-keys 0xE4F0EDDF374F2C50D473 5EC097833DC998EF9A49
and not just:
gpg --recv-keys 0x98EF9A49
Doing the former, gpg will then download all keys with fingerprint ending by 98EF9A49, and check which one matches the fingerprint. Bonus point: on top of fetching my key, you'll be doing a fingerprint verification (which is needed anyway) by copying entirely with your keyboard.
8 hex digits is 64 bits.
nm.. its late... not thinking.
If 32-bit keys were as secure as the 1024 or 4096 bit keys they're derived from, we wouldn't need the 1024/4096 bit keys.
Using a 32-bit short ID is and has always been less secure.
Nothing to see here, move along.
Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
[rant]
This is a bit OT, but I wanted to make the point that people suddenly care about collision problems in hashes only after the fact.
In git, for example, each unique commit and its history are identified with a SHA-1 hash that depends on the whole history of the project up to that commit.
What happens in the extremely rare and improbable case (or maliciously constructed case) where two SHA-1 hashes collide?
Depending on exactly where and when the collision occurs, the repository can fall apart, and nothing works anymore (tested).
Every single comment about this issue on the mailing list has been ridiculed. "It will never happen! Stop worrying!"
The day it happens, suddenly they will realize: hey, we should have dealt with the failure case after all, to at least leave the repository in a consistent state.
Only after the fact. Before that, you are an idiot.
[/rant]
Imho, the reprehensible behaviors of our governments over the last decade has made encrypting our communications a moral imperative. I have "nothing on the line" personally, but..
There are many activists in the world doing important things to undermine harmful sources of authority. And my own usage of cryptography helps prevent governments and corporations from identifying the interesting traffic quite so easily.
If you have an Android device, then you should check out the Guardian Project.
The Christian religion has been and still is the principal enemy of moral progress in the world. -- Bertrand Russell
This was actually a preimage attack -- that is, I intentionally created a collision for 0x70096AD1.
No birthday paradox required. I looped through the entire key space. It takes, as written in the article, less than a few hours on a regular netbook.
|/usr/games/fortune
... and nobody cares, because anyone with a clue already knew this, and it has zero effect on the effectiveness of GnuPG.
Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
He didn't say "You'd have to be stupid not to understand the birthday paradox", he said that you'd have to be stupid to think that the GnuPG developers don't understand it.
Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
ANY hashing algorithm which generates hash values which are shorter than the original input value is GUARANTEED to have collisions. This is basic mathematics; you can't have a smaller set which has a 1:1 correspondence with a larger set.
and no, I'm not a mathematician, but I did actually stay awake in a few math classes, which the original poster apparently did not...
--- Generation X: The first generation to have SIG lines inferior to their parents... ---
Dear Stupid and Cowardly:
..., and it is therefore common to say that someone is saying something when they have not explicitly stated something, but rather implied it. Still, your effort to condescend was valiant, and you should feel proud for trying!
Actually, yes he did, but you would have to understand English well to know what I'm saying. He implied that you'd have to be stupid to think that the GnuPG developers were that stupid. In the English language, which is clearly not your first language, we ask a question when we are not sure what someone is saying (i.e. implying): Are you saying
Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
Exactly - and some people have "vanity" short keys, and have had since 1999, including generating their own collisions...
http://subkeys.pgp.net:11371/pks/lookup?search=0xDEADBEEF
"Go to CNN [for a] spell-checked, fact-checked summary" -- CmdrTaco