3 ms·
This underscores the need for flexible security that doesn't rely on magic numbers. If an algorithm needs a number that can't be one of the obvious ones (0, 1,
by imagist 10y ago
This underscores the need for flexible security that doesn't rely on magic numbers. If an algorithm needs a number that can't be one of the obvious ones (0, 1, 2, 3, 2^x - 1, largest prime < 2^x) it should be generated.
- eridius 10y agoI would assume that DH typically uses pre-baked primes instead of calculating them for a reason. One possible reason is that pre-baked primes can be designed to avoid certain pitfalls (e.g. primes close to powers of 2, which the article implies can be solved using the much faster algorithm) or otherwise to be resistant against certain cryptographic attacks. I don't know enough about DH to know if that's really the case here or if it's merely done to avoid having to compute fresh large primes, but I'm going to guess there's a good reason for it.
- daveloyall 10y agoI also assume it is a good reason. I'm curious, what is that reason? From the article... > Unlike prime numbers in RSA keys, which are always > supposed to be unique, certain Diffie-Hellman primes > are extremely common. Does anyone know why?
- vabmit 10y agoBasically, because people thought it was safe. It didn't seem significant to use the same prime since the key exchange process involves both Alice and Bob generating a secret. Solving the discrete logarithm of g^a mod p was still thought to be intractable given a large enough (1024bits) p. As to the technical reason why the DH parameters were reused - speed and efficiency. A DH key exchange would take longer if you had to generate those parameters each time.
- imagist 10y agoI agree with your comment, but I'd like to add that if you speedily/efficiently do the wrong thing, it's no good. The first step of optimization is correctness.
- imagist 10y ago> One possible reason is that pre-baked primes can be designed to avoid certain pitfalls (e.g. primes close to powers of 2, which the article implies can be solved using the much faster algorithm) or otherwise to be resistant against certain cryptographic attacks. Why can't those primes be calculated on the fly? Checking a number for being within a certain distance of a power of two is well within the programming capability of a freshman CS student. > I don't know enough about DH to know if that's really the case here or if it's merely done to avoid having to compute fresh large primes, but I'm going to guess there's a good reason for it. Given the incentives involved, I see strong reason to believe this is not the case.
- eridius 10y ago> Why can't those primes be calculated on the fly? Checking a number for being within a certain distance of a power of two is well within the programming capability of a freshman CS student. You're assuming that that's the only criteria for a bad prime, but as this article points out, it's not. > Given the incentives involved, I see strong reason to believe this is not the case. Incentives where? The incentives by nearly everybody involved in making crypto is to be secure. The NSA wants to be able to break crypto, but the NSA didn't write the software that uses these primes (e.g. Apache).