Question: CODE MUST BE WRITTEN IN PYTHON 3! We are going to code a very basic implementation of the Key Generation algorithm for RSA. The input

CODE MUST BE WRITTEN IN PYTHON 3!  CODE MUST BE WRITTEN IN PYTHON 3! We are going to

We are going to code a very basic implementation of the Key Generation algorithm for RSA. The input into GenerateRSAKey is k, the size of the modulus in bits, and the output is p, q, factors of the modulus n, the modulus d3, the signing exponent d5, the decryption exponent. Psuedocode: Check for a sensible range. assert 64 lessthanorequalto k lessthanorequalto 128 Generate the primes. P leftarrow GenerateRSAPrime ([k/2]) q leftarrow GenerateRSAPrime([k/2]) Compute the LCM of p-1 and q - 1 t leftarrow (p - 1) (q - 1)/GCD(p-1, q-1) Compute the secret key exponents using the modular inversion feature of the extended GCD algorithm. g, (u, v) leftarrow ExtendedGCD(3, t) Check that the GCD is correct. assert g = 1 Reduce u modulo t d_3 = u mod t Repeat for dS g, (u, v) leftarrow ExtendedGCD(5, t) assert g = 1 d5 = u mod t return p, q, pq, d3, d5 We are going to code a very basic implementation of the Key Generation algorithm for RSA. The input into GenerateRSAKey is k, the size of the modulus in bits, and the output is p, q, factors of the modulus n, the modulus d3, the signing exponent d5, the decryption exponent. Psuedocode: Check for a sensible range. assert 64 lessthanorequalto k lessthanorequalto 128 Generate the primes. P leftarrow GenerateRSAPrime ([k/2]) q leftarrow GenerateRSAPrime([k/2]) Compute the LCM of p-1 and q - 1 t leftarrow (p - 1) (q - 1)/GCD(p-1, q-1) Compute the secret key exponents using the modular inversion feature of the extended GCD algorithm. g, (u, v) leftarrow ExtendedGCD(3, t) Check that the GCD is correct. assert g = 1 Reduce u modulo t d_3 = u mod t Repeat for dS g, (u, v) leftarrow ExtendedGCD(5, t) assert g = 1 d5 = u mod t return p, q, pq, d3, d5

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!