Question: CSC 2 4 1 Programming Assignmnet # 5 Spring' 2 4 RSA Public - Key Cryptosystem Overview. Write a program to implement the RSA public
CSC
Programming Assignmnet #
Spring'
RSA PublicKey Cryptosystem
Overview. Write a program to implement the RSA publickey cryptosystem. The RSA RivestShamirAdleman cryptosystem is widely used for secure communication in browsers, bank ATM machines, credit card machines, mobile phones, smart cards, and the Windows operating system. It works by manipulating integers. To thwart eavesdroppers, the RSA cryptosystem must manipulate huge integers hundreds of digits The builtin CJava type int is only capable of dealing with or bit integers, providing little or no security. You will design, implement, and analyze an extended precision arithmetic data type that is capable of manipulating much larger integers, using Biginteger in Java or simply using Python. You will use this data type to write a client program that encrypts and decrypts messages using RSA.
Note: the training wheels are off on this assignment you're starting with a blank screen, not our code. This means that you must pay particular attention to the process of building up your program from scratch. Consider carefully how your program should be structured and how you are going to implement the various functions before plunging in Remember to thoroughly test and debug each function as you write it
The RSA cryptosystem. The RSA public key cryptosystem involves three integer parameters and that satisfy certain mathematical properties. The private key is known only by Bob, while the public key is published on the Internet. If Alice wants to send Bob a message eg her credit card number she encodes her message as an integer that is between and Then she computes:
Mmodn
and sends the integer to Bob. As an example, if then Alice computes
modmod
When Bob receives the encrypted communication he decrypts it by computing:
modn.
Continuing with the example above, Bob recovers the original message by computing:
mod
To check your arithmetic, you may use Maclab, maple.
Part encryption and decryption Now it's time to put all your hard work to use. The encryption and decryption processes are identical, except that they involve different encryptiondecryption keys. Write a program rsa.java that takes in one command line arguments the name of the encryption key reads in a decimal string from standard input, and applies the RSA function to the message. It should work as follows. In real applications, you might want to send an ASCII text message instead of a decimal integer; however, you are only responsible for handling decimal inputs.
RSA function. The key step is to implement the RSA function aka modular exponentiation: given three extended precision integers the basethe exponent and the modulus compute modn. You will implement this as the function XPrsa in xpc
A natural way to compute is to set ; then multiply it by times; then set xmodn. This method suffers from two serious performance bugs.
First, observe that if the inputs and are Ndigit decimal integers, then the intermediate result could contain as many as digits. To see the great importance of this, observe that if is the intermediate result could consume a terrabyte of memory!
The second problem is that repeating anything times will be slow. If is even moderately large say decimal digits it will take centuries to execute, even on the fastest supercomputer. Data structure
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
