Question: Important: Solve it in an octave programming language. ( write for me the code please ) Here is the question: Implementing RSA Encryption and Decryption.

Important: Solve it in an octave programming language. (write for me the code please)
Here is the question:
Implementing RSA Encryption and Decryption.
Pseudocode for RSA Encryption and Decryption
------------------------------------------------------------------------------------------
Inputs:
p, q: small prime numbers
plaintext: word to be encrypted and decrypted (plaintext will be converted to UPPERCASE)
Outputs:
Display of public and private keys
Encrypted & Decrypted Codes
Decrypted text
------------------------------------------------------------------------------------------
PSEUDOCODE
Initialize RSA Parameters
Compute n=pq,
Compute ( n )=(p1)(q1)
Select Public Exponent
Select e to an initial smallest odd number (start 11,13,...) such that
gcd(e,( n )=1 if not, choose the next odd number
Compute Private Key d using the Extended Euclidean Algorithm to find
d, the modular inverse of e modulo ( n ), such that de 1(mod ( n )).
[Call function: = extended_gcd(a, b)]
Display Public and Private Keys
Print the public key (e, n).
Print the private key (d, n).
Convert Plaintext to ASCII Codes (use UPPERCASE)
Encrypt Plaintext [call the function: mod_exp(base, e, n)]
Display the ciphered Code.
Decrypt the ciphered Code. [call the function: mod_exp(base, d, n)]
Display the decrypted ciphered Code
Display Decrypted Text
------------------------------------------------------------------------------------------
see sample outputs below
For example:
Test data:
p =11 ;
q =17;
plaintext ='HI';
RSArun(p,q,plaintext)
Result:
Public key (e, n): (11,187)
Private key (d, n): (131,187)
A->Z [A=>0,..Z=>25]: 7273
Ciphered Code: 14962
Decrypted Code: 7273
Decrypted text: HI
-----------------------------------------------------------
Test data:
p =23;
q =11;
plaintext ='BP';
RSArun(p,q,plaintext)
Result:
Public key (e, n): (13,253)
Private key (d, n): (17,253)
A->Z [A=>0,..Z=>25]: 6680
Ciphered Code: 198247
Decrypted Code: 6680
Decrypted text: BP
-----------------------------------------------------------
Test data:
p =61;
q =53;
plaintext = 'MATH';
RSArun(p,q,plaintext)
Result:
Public key (e, n): (11,3233)
Private key (d, n): (851,3233)
A->Z [A=>0,..Z=>25]: 77658472
Ciphered Code: 7572811278350
Decrypted Code: 77658472
Decrypted text: MATH

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