Sunteți pe pagina 1din 3

Jonah Back, Jessica Francis, Christine Santabarbara, Cory Wallace

Modern Cryptography MATH 3096


18 April 2016
RSA Project Report
I. Construction
In order to create the RSA system, first two 48-bit prime numbers p and q were chosen
randomly. Next the value of n was found, which is equal to p*q, and (n) was calculated using
the formula (n) = (p-1)(q-1). From here a value was chosen for e that was relatively prime to
(n). The value of d was then calculated using the Modexp Magma command, where d is
equal to the inverse of e mod (n). With all of these numbers determined, the exchange of the
Vigenre key could be completed. For this scenario, Bob will be the one who calculated the
above values and Alice will determine a Vigenre key that she would like to send to Bob. The
numbers associated with each variable can be found in Table 1.
Name

Values known

Bob

p = 98,893,675,136,699
q = 244,188,000,626,083
(n) = 24,148,648,806,195,561,140,934,157,236
e = 24,148,648,806,195,561,140,934,157,099
d = 176,267,509,534,274,168,911,928,155
n = 24,148,648,806,195,904,222,609,920,017
cipher = 13289913231256236730514997519
Vigenre key (ASCII) = 113676684848751
Vigenre key = gcjkno

Alice

n = 24,148,648,806,195,904,222,609,920,017
e = 24,148,648,806,195,561,140,934,157,099
Vigenre key = gcjkno
Vigenre key (binary) =
011001110110001101101010011010110110111001101111
Vigenre key (ASCII) = 113,676,684,848,751
cipher= 13,289,913,231,256,236,730,514,997,519

Eve

n = 24,148,648,806,195,904,222,609,920,017
e = 24,148,648,806,195,561,140,934,157,099
cipher = 13,289,913,231,256,236,730,514,997,519

Table 1. Shown here are what values Bob and Alice know or calculated to find, and what values
Eve sees as a result of Alice and Bob publicly exchanging values.
The Vigenre key that Alice wanted to secretly tell Bob was gcjkno. In order to
exchange this Vigenre key, first the letters were converted to binary, and then the binary
number was converted to ASCII. Next Alice uses the values of n and e that Bob had sent using
a public form of communication to calculate the cipher that she would send to Bob that the
public can also see (including the eavesdropper Eve). To do so, she used the values for e and n

to encode her key by finding the value of the following using Magma: (Vigenre key (in ASCII
format))^e mod n. She sent this value to Bob, and in order for him to decipher the cipher value,
Bob simply plugged in the cipher to the following formula: cipher^d mod n. The resulting
number, computed with Magma, is the ASCII format Vigenre key that Bob then converted back
to letters. Overall, the eavesdropper Eve only knows of the values of e, n and the cipher, as
shown in Table 1.
II. Attack
The Eve transcript provided by group 2 contained the following information:
N=2630492240413883318777134293253671517529
e=1883813924287027013746049381
C=81270683980664305210423125305440246548
The following Magma script was used first to factor N and then to decrypt C. X in the script is
equal to (N).
N:=2630492240413883318777134293253671517529;
e:=1883813924287027013746049381;
c:=81270683980664305210423125305440246548 mod N;
f:= 2;
repeat
f:=NextPrime(f);
Qt:= N div f;
Re:= N mod f;
until 0 eq Re;
print f, Qt;
x:=(f-1)*(Qt-1);
d:=Modexp(e, -1, x);
m:=c^d mod N;
print m;
The loop runs until factors of N are found (which happens when the N mod f = 0, where f is the
prime number being tested as a factor. To speed up the program, the function NextPrime was
used which would allow us to skip past numbers that shared a factor with a number we had
already tested. The code ran for more than nine hours.

This is the decrypted message found using factorization:


m = 111114097110103101

Binary=110001010110000011010111010111111110010010011010000111
101
Code = b?k??m
This did not seem right, so rather than converting m to binary, we tried
converting it directly from decimal to ASCII text. We later found that unless
the proper number of leading zeros were kept in the binary form, the ASCII
converter would give an incorrect output.
Code = orange (found by this table http://www.asciitable.com/)

S-ar putea să vă placă și