0

I have a problem where I have to find mod N in a RSA cipher.

I am given the following information:

  1. The public key (e)
  2. Plaintext (M)
  3. Cipher text (C)

How can I reverse the equation C = (M^e) mod N to find N?

1 Answers1

1

something is wrong with your numbers:

>>> cr=69**55317
>>> cr2=189**55317
>>> 
>>> from math import gcd
>>> gcd(cr-79,cr2-200)
1

We calculate the raw exponent, we subtract the cipher text and expect to get 0 mod N, we have two such ciphertexts so we expect to get $a*N$, $b*N$ for natural integers a and b. We calculate gcd to extract $N$ but with your numbers we get 1 which means, something is wrong with the input, or possibly in how are interpreting the input.

Meir Maor
  • 12,053
  • 1
  • 24
  • 55