Answered step by step
Verified Expert Solution
Question
1 Approved Answer
RSA Encryption In this assignment we will write a 3 2 bit, non - optimized version of the asymmetric public - private key encryption algorithm
RSA Encryption
In this assignment we will write a bit, nonoptimized version of the asymmetric publicprivate key encryption
algorithm RSA. It is a simplified version of the algorithm that is currently being used with SSH FTPS and https
You wouldn't be able to use PayPal without it There is high level theory behind this algorithm, and you are not
required to understand all of it Our goal is to implement the steps and get it to work.
The goal of asymmetric encryption is to allow anyone on the outside, a client, to send an encrypted message to a
host, usually a web server, such that only the web server can decrypt the message. This allows the client and
server to set up private communication. The public key allows any client to encrypt. No clients can decrypt. The
private key is needed to decrypt, which only the server has. This makes it so only the server can decrypt the
messages sent from clients requesting communication. Once the server receives and decrypts the request for
communication, a symmetric encryption algorithm such as AES, where both the client and server can encrypt and
decrypt, is used from then on
The RSA algorithm is implemented as follows:
Assume the message to be sent is an integer. For a message find integers e and such that:
@
In other words, find a mod value and two exponents such that raising a number to the product of
those exponents and then modding it gives you the original number back
Once these three numbers are found, asymmetric encryption is possible.
To create an encrypted message c also known as a cipher, use e and :
To decrypt, use and on the encrypted message:
Thus, the public key, which allows encryption of a message consists of:
e and
The private key, which allows decryption of a cipher c consists of:
and
Note that since everything is being modded with must be less than in order to avoid duplicate ciphers
To raise to an exponent and then mod is called modular exponentiation.
We will write a function for this.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
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