I implemented an RSA program, but why cannot I revert to the original data after encrypting and decrypting it?
Beginner Hint
- The reason why it cannot be decrypted correctly is that there is an error in a part of
chall.py. Because of this error, it is not guaranteed that the incorrect d and the correct phi are relatively prime, and it becomes very difficult to recover the ciphertext c from the incorrect flag, which happens about once in four times, so please be careful when actually runningchall.pyto solve it. - However, this does not happen in the majority of cases, and the data in the distributed
output.txtcan also be solved assuming gcd(incorrect d, correct phi)=1.