by tptacek · 4y ago · 0 comments
This is part of a pattern with this author. They're extremely attached to PGP. PGP uses RSA. Therefore: RSA must be fine. Recurrence of the same pattern: PGP doesn't use authenticated encryption. Therefore, authenticated encryption must not be important, or maybe it's even a negative. There's another example somewhere in the comments here about forward secrecy being overrated. (I can cite, but you should just take my word for it that these takes have been shared here).
It's frustrating, because the pattern isn't super clear in isolation (though this response actually mentions PGP as the impetus for the response) and, if you don't work in the field, it might not be clear how far these takes stray from cryptographic engineering orthodoxy. It's also frustrating because in general, we're not supposed to write things like this on HN --- a list of floridly bad previous comments from this author would be way over the line --- so one has to sort of tiptoe around the edges of the guidelines to find a way to describe what's going on here.
Anyways, caveat lector.
Hats off for describing Boneh's fault attack paper as "completely theoretical", though! Bold!
The point of the Prime and Prejudice paper is, in effect, that the Miller-Rabin primality test should only be applied to random prime candidates, not adversarially chosen ones. The reason is: for a random composite, each M-R iteration has probability roughly 1/4 of revealing that the number is indeed composite. But it is possible to find composites that fool M-R with high probability. The upshot is: if an adversary is proposing primes to you, be very careful about using M-R!
For RSA key generation, unless you're worried about your RNG (in which case you're sunk anyway, to a first approximation), candidate primes are not adversarially chosen. So, as this article says, it does not appear that Prime and Prejudice is an issue for RSA key generation.
As further evidence for this, the Prime and Prejudice paper does not talk about vulnerabilities in RSA key generation. The issues that it describes have to do with validating prime-field DH parameters provided to a client by a potentially adversarial TLS server. As far as I can tell, the P&P paper only mentions RSA three times: twice as name-checks and once in the name of a library.
This isn't a defense of any other claim in the article. But as far as I can tell, P&P is not an issue in the context of RSA key generation.
> Normally for RSA you pick 2 random numbers and then find a prime close to each.
I.e. if you pick a number and then search upwaard til you find a prime, that gives a non-uniform distribution on the primes in that range. You instead want to pick a random number, and if it's composite, throw it away and pick another random number til you get a prime. Then repeat to get second prime.
(This is a relatively recent result. And as I mentioned in my other comment, this is not a defense of the article!)
You stopped quoting too soon. I described it as a "completely theoretical hardware attack". In practice it would have to be some sort of glitch attack capable of causing actual bit flips. My point is that it has nothing to do with RSA implementation as it was described in the article.