Problem Implement Three Component Algorithms Rsa Cryptographic Protocol Define Python Func Q37082002

In this problem you will implement the three componentalgorithms of the RSA cryptographic protocol

a) Define a Python function generate(k) that takes a singleinteger input k and returns a tuple (n,e,d) corresponding to thepublic values n and e and private key d in the RSA cryptographicprotocol. The output n must be the product of two distinct,randomly chosen k-digit primes. You may import and use the Pythonrandom number generator (from random import random or from randomimport randint), and you may want to reuse the extended Euclideanalgorithm implementation

def egcd(a, b):

(x, s, y, t) = (0, 1, 1, 0)

while b != 0:

k = a

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.