Docsity

CS3510 Second Programming Assignment: Implementing the RSA Algorithm, Study Guides, Projects, Research of Algorithms and Programming

Toggle sidebar
bg1
CS3510: Second programming assignment
Implementing the RSA algorithm.
Due Date: Tuesday, Nov. 30, 11:59 PM
November 9, 2004
Description
In this programming assignment you will implement the RSA protocol for asym-
metric cryptography. As part of this project you will implement algorithms re-
lated to cryptography, i.e. finding prime numbers, performing arithmetic of large
integers, fast exponentiation, encryption, decryption. (NO you are not allowed
to use libraries (for example, for cryptography-related functions or arithmetic of
large integers); however, you are more than welcome to read, but not duplicate,
already existing code.)
After you implement your RSA algorithm, you will send to your TA (chris-
[email protected]) your public key (e,N ). Make sure that eis small, 3 or
5 should suffice, certainly keep e < 10.We will decide the exact format
of the email later so that Christos can reply easily/quickly. We will use your
public key to encrypt a particular phrase Kand send to you the encrypted
message. You will have to use your private key dto retrieve the phrase K. You
will submit the decrypted K, your code, and write a very short report with your
observations.
The RSA algorithm
You will generate a pair of public and private keys. The size of these keys should
be 8 bytes (128 bits). (The most significant bytes of pand qshould not be zero.)
Thus, you will need to implement algorithms that generate random numbers of
8 bytes (use the random number generators supported by your programming
environment) and test for primality.
Then, you will implement the RSA encryption and decryption schemes. Your
algorithms should be able to take as input an array of bytes and output an
encrypted/decrypted array of bytes.
You should answer the following questions:
•The algorithm you have used to choose random prime numbers.
1
pf2

Partial preview of the text

Download CS3510 Second Programming Assignment: Implementing the RSA Algorithm and more Study Guides, Projects, Research Algorithms and Programming in PDF only on Docsity!

CS3510: Second programming assignment

Implementing the RSA algorithm.

Due Date: Tuesday, Nov. 30, 11:59 PM

November 9, 2004

Description

In this programming assignment you will implement the RSA protocol for asym- metric cryptography. As part of this project you will implement algorithms re- lated to cryptography, i.e. finding prime numbers, performing arithmetic of large integers, fast exponentiation, encryption, decryption. (NO you are not allowed to use libraries (for example, for cryptography-related functions or arithmetic of large integers); however, you are more than welcome to read, but not duplicate, already existing code.) After you implement your RSA algorithm, you will send to your TA (chris- [email protected]) your public key (e, N ). Make sure that e is small, 3 or 5 should suffice, certainly keep e < 10. We will decide the exact format of the email later so that Christos can reply easily/quickly. We will use your public key to encrypt a particular phrase K and send to you the encrypted message. You will have to use your private key d to retrieve the phrase K. You will submit the decrypted K, your code, and write a very short report with your observations.

The RSA algorithm

You will generate a pair of public and private keys. The size of these keys should be 8 bytes (128 bits). (The most significant bytes of p and q should not be zero.) Thus, you will need to implement algorithms that generate random numbers of 8 bytes (use the random number generators supported by your programming environment) and test for primality. Then, you will implement the RSA encryption and decryption schemes. Your algorithms should be able to take as input an array of bytes and output an encrypted/decrypted array of bytes. You should answer the following questions:

  • The algorithm you have used to choose random prime numbers.
  • The running time (in seconds) of picking random prime numbers of 8 bytes. How many iterations does your algorithm take to find a prime number (in other words, how many random numbers do you generate before finding a random prime number)?
  • The cleartext of the encrypted phrase.

Most of the programming languages have libraries that implement the re- quired functionality (e.g. BigInteger in Java). For extra credit you should imple- ment the required functionality using these libraries and compare your results. (In general it is good to use these libraries to get a feeling of the work involved and to test your code.) To some extend, in this project you will implement your own big integer library (and RSA)!

Submission instructions

Please follow the following instructions as closely as possible:

  • Work in groups of up to 3-4 people. NO MORE THAN FOUR IN EACH GROUP!
  • If you do not have a project partner and you are interested in collaborating in this assignment with another student, please send me an email.
  • Read the project description carefully. Answer all questions!
  • Send your TA (christos@cc) an email with your report and all relevant files. The subject of your email should be “CS3510 Programming Assignment 2, , ”, where the first and last names are of the team member with the lexicographically smaller last name. In the body of your email you should list the names of the team members as follows (one student per line): “, , ” e.g. “Gkantsidis, Christos, [email protected]”.
  • Attach each file separately. Please do NOT tar, zip, etc. your files.
  • Do not send executables.