Implement the function encryptRSA (m, n, e) which encrypts a string m using RSA key (n = p * q, e). In [ ]:
Implement the function encryptRSA (m, n, e) which encrypts a string m using RSA key (n = p * q, e). In [ ]: def encrypt RSA(m, n, e): In [ ] N **** """encrypts the plaintext m, using RSA and the key (n = p * q, e) INPUT: m - plaintext as a string of letters n a positive integer e - integer satisfying gcd ((p-1)*(q-1), e) = 1 OUTPUT: The encrypted message as a string of digits FIB pass ENCRYPTION TESTER CELL encrypted1 encryptRSA ("STOP", 2537, 13) encrypted2 encryptRSA ("HELP", 2537, 13) encrypted3 encryptRSA ("STOPS", 2537, 13) print("Encrypted Message:", encrypted1) print("Expected: 2081 2182") print("Encrypted Message:", encrypted2) print("Expected: 0981 0461") print("Encrypted Message:", encrypted 3) print("Expected: 2081 2182 1346") TEST 2 encrypted = encrypt RSA("UPLOAD", 3233, 17) print("Encrypted Message:", encrypted) print("Expected: 2545 2757 1211") Activate Windows Go to Settings to activa
Step by Step Solution
3.30 Rating (150 Votes )
There are 3 Steps involved in it
Step: 1
To implement the encryptRSA function you can use the RSA encryption formula c me mod n Where c is th...See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started