Program to find decryption key in RSA algorithm
Hi, I'm a bit of a beginner when it comes to using MATLAB. I was wondering if anyone knew of any codes to help me with the following questions:
'In the RSA system, an individual follows this recipe. Choose two large primes p and q and compute n = pq. Then choose a number e < n which is coprime to Ï•(n) = (p−1)(q−1). Then ï¬nd a number d such that ed ≡ 1 (mod Ï•(n)). The public key is the pair (n, e) and the private key is d. A message m sent to this person would be encrypted as c = m^e (mod n). The individual for whom the message was intended would decrypt c as m = c^d (mod n).
1) Write a program to compute the private decryption key from a given public encryption key.
2) Write a program to convert an encrypted number c = m^e (mod n) into the original m = c^d (mod n), where 0 ≤ m < n is some integer. State, with justiï¬cation, the greatest number of digits that n can have for which your program can be trusted to work.'
Any help would be much appreciated!
'In the RSA system, an individual follows this recipe. Choose two large primes p and q and compute n = pq. Then choose a number e < n which is coprime to Ï•(n) = (p−1)(q−1). Then ï¬nd a number d such that ed ≡ 1 (mod Ï•(n)). The public key is the pair (n, e) and the private key is d. A message m sent to this person would be encrypted as c = m^e (mod n). The individual for whom the message was intended would decrypt c as m = c^d (mod n).
1) Write a program to compute the private decryption key from a given public encryption key.
2) Write a program to convert an encrypted number c = m^e (mod n) into the original m = c^d (mod n), where 0 ≤ m < n is some integer. State, with justiï¬cation, the greatest number of digits that n can have for which your program can be trusted to work.'
Any help would be much appreciated!
0
Comments