118 Cryptography with Open-Source Software
c3=(-s*p*cq+t*q*cp)%N;num2str(c3)
c4=(-s*p*cq-t*q*cp)%N;num2str(c4)
One of the outputs c1, c2, c3 and c4 should produce the correct plain-
text; the others should be gibberish.
27. As in question 20, swap public keys with a friend, and use those public
keys to encrypt a message to him or her. Now decrypt the ciphertext
you have been g iven.
Further Exercises
28. Prove the correctness of the formula for the RSA common modulus
attack.
29. Experiment with the low encryption attack: first work through the ex-
ample given.
30. For another example, take these pairs of primes:
(11617 , 69313), (46747 , 34589), (55399, 19433).
Using e = 3 the following are the corresponding ciphertexts:
521156063, 21150 682, 22870584 2.