How many different keys would be need if they use public key cryptography? A pair of a public and a private key is counted as one key.
For all problems below assume the following translation of letters into numbers, digits, and punctuation marks into numbers (use only upper-case letters):
There are 50 different characters total.
Please show your computations.
Using p = 53 and n = 7, generate a sequence of pseudo-random numbers and encode the message:
MIDWAY UPON THE JOURNEY OF OUR LIFE
I FOUND MYSELF WITHIN A FOREST DARK.
Using p = 61 and n = 20, decode the following message. We draw zero in blue (0) to distinguish it from the letter O.
If the message is longer than the sequence of distinct pseudo-random
(1*n) % p, ... , (n*(p-1)) % p
generated from p and n, then just continue the sequence as follows:
(n*p) % p, (n*(p+1)) % p, ....
Note that (n*p) % p is zero, and the rest of the numbers repeat the first sequence, so no additional computations are needed.
Bonus question (2 points each): what is the source of each of the verses?
A. You know that p = 91?
B. You know that p < 23?
Please show how you have computed the answer. You may assume that the message is in recognizible English and that you need to decode the entire message to check whether the decoding makes a sensible English phrase.
B. Which of the numbers that you have determined form the public key, and which are part of the private key?