0

I'd like to have a small sanity check first: As far as I understand, diffie-hellman is all about that fact that, given the generator ($g$), the modulo ($n$) and the remainder ($c$), it's hard to find the exponent a in:

$g^a \bmod n = c$

But the conditions for this are that n is a big prime number, and g is a root primitive. So my questions are:

  1. Does $n$ must be prime? or it's just better for security?
  2. Does $g$ must be root primitive mod $n$?

Ok now to RSA. As far as I understand, RSA stands on another notion, and that is that it's hard to find the message (m) given the cipher (c), modulo (n) and exponent (e) in:

$m^e \bmod n = c$

So my question is: Does the same restrictions regarding diffie-hellman apply to RSA? Seemingly that's not possible since:

  1. you can't impose restrictions on the message itself
  2. $n$ is a composite of two (or more) prime numbers.

Am I right here? Please correct me if not.

I suppose that my questions comes down to this: Do Diffie-Hellman and RSA rely on the same mechanism of modular arithmetic, or is it completely different?

fgrieu
  • 149,326
  • 13
  • 324
  • 622
YoavKlein
  • 169
  • 1
  • 5

0 Answers0