Question: Project 1 (RSA Cryptosystem): RSA is a public-key cryptosystem named after its inventors, Ronal Rivest, Adi Shamir, and Leonard Adleman. In this cryptosystem, we treat

Project 1 (RSA Cryptosystem): RSA is a public-key cryptosystem named after its inventors, Ronal Rivest, Adi Shamir, and Leonard Adleman. In this cryptosystem, we treat plaintext and ciphertext message blocks as large numbers, represented using thousands of bits. Encryption and decryption are done using modular exponentiation. The setup for RSA allows a potential message receiver, Bob, to create his public and private keys. It begins with Bob generating two large, random prime numbers, p and q, and setting n = pq. He, then, picks a number e that is relatively prime to (n), and he computes d = e1 mod (n). From this point on, he can throw away the values of p, q, and (n). they are no longer needed. Bobs public key is the pair (e, n). His private key is d. He needs to keep d a secret, but he should publish (e, n) to any places that might allow others to use it to send Bob encrypted messages. Given Bobs public key (e, n), Alice can encrypt a message M for him by computing: C = M e mod n Thus, encrypting M requires a single modular exponentiation. To decrypt the ciphertext C, Bob performs a modular exponentiation: C d mod n and sets the result to M. This is, in fact, the plaintext that Alice encrypted, as the following shows for the case when M is relatively prime to n: C d mod n = (M e) d mod n = M ed mod n = M ed mod (n) mod n 2 = M 1 mod n = M Provide an implementation of the RSA protocol described above. More precisely, write a program that implements RSA setup, encryption, and decryption. The implementation of the DH protocol should be as structured as possible.

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 Databases Questions!