Prelab 10: RSA Key Generation
Reading
- Computer Science: an Overview: Sections 4.5, 11.6
Random Numbers
In order to create a RSA key, we first need to learn how to create a random
prime number.
We use the java probablePrime method of the BigInteger java class.
The Java API specification for the BigInteger class is found
here:
http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigInteger.html
The API is difficult to read, but will be a good resource both for the prelab and the lab.
In order to understand the code that we will give you in lab, you will need to answer the following questions:
- What is a BigInteger? And, why is it important that we use BigInteger instead of an int? (You can use the Java API and your textbooks
to help you define both terms).
- Does the fact that the method probablePrime could return a number that is not prime present a large problem? Why or why not?
Key Generation
In lecture, we learned
about the RSA Encryption Algorithm. Now, we will walk through an example using small numbers.
Given the prime numbers p=3 and q=5 , find the following (Please show the work that you do to find these answers):
- What is n ?
- What is v ?
- What is k ?
- What is d ?
- What is the private key?
- What is the public key?
- Suppose we are given the message 25 to encode. What is the encrypted message using the keys above?
- Using that encrypted message, show how to decrypt it.
Submission
Please hand in a hard copy of your answers to these questiona at the begining of your lab period.
Be sure to include your name, NetID, and collaborators in your submission.
Adapted from a lab originally created by Albert Meixner and Tammy Bailey.