Question: Write a program that will verify the following steps outlining the RSA encryption / decryption technique using the prescribed test values: i . Choose two

Write a program that will verify the following steps outlining the RSA encryption/decryption
technique using the prescribed test values:
i. Choose two prime numbers p and q consisting of exactly 7 digits.
ii. Compute N = pq. The security of RSA depends on not making p and q publicly known
even though N will be made public. If N can be factored, then RSA becomes insecure.
iii. Compute (N )=(p 1)(q 1)(given that p and q are prime, (N ) is easily
computed by using (p 1)(q 1) where p and q are known only to you).
iv.(Key Generation) Choose a small prime number e such that 1< e < (N ) and
gcd(e, )=1. Use the extended Euclidean algorithm to compute d such that ed
mod =1(make sure you verify that gcd(e, )=1). After the algorithm runs do
not forget to convert your result to a positive answer d mod .
a. Public Key: (N, e)
b. Private Key: (N, d)
v. Encode the plaintext STOP into two blocks m1m2 of four digits using the UTF-8 code:
m1=8384, m2=7980.
vi.(Encryption) For each plaintext block, use the repeated squaring algorithm to encrypt
the plaintext message m into the ciphertext c by computing
c = me mod N
vii. (Decryption) Use the repeated squaring algorithm to decrypt the ciphertext back into
the plaintext message by computing
m = cd mod N

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!