1 Jun
2002
1 Jun
'02
1:18 a.m.
On Fri, 31 May 2002, Mike Rosing wrote:
With ECC you just recompute the public key from the private key and make sure it matches what's out in public. With RSA you just pick some random value (not zero or 1) and see if r^(e*d) = 1 mod N, or if you know p and q (where N = p*q) check that e*d = 1 mod (p-1)*(q-1). It's the same thing as encrypting/decrypting something to see if you get the same thing back. If not, something is wrong.
Also with RSA, if you know p/q, you should probably check to see if they're actually prime. :) For DSA, assuming only one of the keys has been changed, checking y == g^x mod p should detect it. Again, checking primality (and that q divides p-1) seems prudent. -Jack