Applied Cryptography

Project 2 (Group Project, 2 per group)

Spring 2009

RSA Operations

 

Method of submission: E mail the required files to TA by April 18, 2009 11: 59 pm.  Please use Subject - “Applied Crypto Project 2 Submission” so that mailbox filters can be setup. Do not reply to any previous mails for turning in the project.

 

 

You are provided with a C++ RSA library. You can extract the required files from the given Zip file.

 

The programs compile and run on Linux/Unix systems. Instructions on how to compile and run are given in the myReadme file and samplerun.txt file inside the zip folder. It is preferred that you attempt to solve this problem in a Linux environment, as it is easier for the TA to use one machine to check your programs.

 

You have to do the following:

 

  1. Perform encryption and Decryption each using the RSA routines provided here. They don’t necessarily have to be part of the same code
    1. Create 10 RSA classes without giving arguments, generate random message or assign messages, and perform encryption through each of the 10 classes.
    2. Create 5 RSA classes by passing a large prime number [p](in the region of 30,000), and perform encryption decryption
    3. Create 5 RSA classes by passing 2 large prime numbers [p,q] (in the region of 30,000) and perform encryption decryption
    4. Create 10 RSA classes by passing 2 large non prime numbers (in the region of 30,000) and perform encryption decryption. In most of the cases the message should not get decrypted correctly.
    5. Show the results for encryption and decryption for each of the above cases.

 

  1. Challenge Response: Scheme 0
    1. Create an RSA class. Call it RSA1
    2. Create a new RSA class, call it RSA2. Obtain the public key and modulus [n] of RSA1. Assign these two to the public key and N value in RSA2.
    3. Generate a random message [random BigInt number]. Encrypt it using the public key of RSA2 [You have stored the pub key of RSA1 in RSA2].
    4. Decrypt the value using the private key of RSA1.
    5. Match both the values (original message vs decrypted message), they should be the same. If so Challenge Response scheme 0 is completed.

 

  1. Blind Signature:

Blind signature is a kind of signature, where the signing authority does not know what is being signed. Blind Signatures are used to implement Anonymous money orders. You have to implement a blind signature scheme. The scheme you have to implement is described in wikipedia at the link: http://en.wikipedia.org/wiki/Blind_signature

 

The scheme can be briefly stated as:

a.       Alice obtains the public key and Modulus N of the person (Bob) who is to sign the message

b.      Obtain a random number and its inverse with respect to the Modulus [Not phi] of Bob

c.       Alice obtains/generates a message to be signed.

d.      Alice encrypts the random number with the public key.

e.       Alice multiplies this value by the message

f.       Alice then takes a modulus over N

g.      Alice sends it to Bob

h.      Bob simply decrypts the received value with the private key

i.        Bob sends it back to Alice

j.        Alice then multiplied the received value with the inverse and takes a modulus over N.

k.      The value obtained above is the signed message. To obtain the original message from it, again encrypt it with Bob’s Public Key.

 

To implement the sending and receiving, you may use whatever method you choose, you can use files, pipes or just pass it through functions, or through global memory. Ensure that the random number is around 16 bits long for the program to work correctly.

 

Some encryption examples are shown in rsaDriver.cpp and rsatry1.cpp in the zip file.