-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrsa_encryption.html
110 lines (106 loc) · 3.67 KB
/
rsa_encryption.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html>
<head>
<title>Crypto Exercises</title>
<link rel="stylesheet" href="./cryptoexercises-stylesheet.css" />
</head>
<!----------------------------------------------------------------------------->
<header>
<table class="headerTable" cellspacing="0">
<tr>
<td class="left">
<img class="bannerImage" src="./LLCipher_logo.png" alt="Llcipher logo" />
</td>
<td class="middle">
<p>Cryptography Challenges</p>
</td>
<td class="right">
<img class="lincolnLogo" src="./lincoln_logo.png" alt="Lincoln logo" />
</td>
</tr>
</table>
</header>
<!----------------------------------------------------------------------------->
<nav>
<ul>
<li><a href="./index.html">Home</a></li>
</ul>
<br />
<ul>
<li class="title">Background</li>
<li><a href="./el_gamal_encryption.html">El Gamal Encryption</a>
<li><a href="./rsa_encryption.html">RSA Encryption</a>
</ul>
<br />
<ul>
<li class="title">Challenges</li>
<li><a href="./classical_crypto.html">Classical Crypto</a></li>
<li><a href="./exercise_one.html">RSA Challenge One</a></li>
<li><a href="./exercise_two.html">RSA Challenge Two</a></li>
<li><a href="./exercise_three.html">RSA Challenge Three</a></li>
<li><a href="./exercise_three_a.html">RSA Challenge Three (a)</a></li>
<li><a href="./exercise_four.html">RSA Challenge Four</a></li>
<li><a href="./exercise_five.html">El Gamal Challenge</a></li>
</ul>
<br />
<ul>
<li class="title">Other Stuff</li>
<li><a href="./references.html">References</a></li>
<li><a href="./credits.html">Credits</a></li>
</ul>
</nav>
<!----------------------------------------------------------------------------->
<article>
<table class="exerciseLayoutTable" cellspacing="0">
<tr>
<h1>RSA Encryption</h1>
<p>Here, we summarize a naive version of the RSA cryptosystem.
This version of RSA should <i>not</i> be used; it is very broken, as you will show in exercises one through four.
Consult
<a href="https://en.wikipedia.org/wiki/RSA_(cryptosystem)"
target="wikipedia">wikipedia</a> for more detail.</p>
<p>
<ul>
<li>KeyGen:
<!--
<li>KeyGen(k), where k is a security parameter:
-->
<ul>
<li> Choose two random primes p and q. </li>
<li> Let n = pq be the modulus. </li>
<!--
<li> Let l be the least common multiple of p-1 and q-1. </li>
-->
<li> Select a random encryption exponent e such that the greatest common denominator of e and (p-1)(q-1) is 1 (that is, e and (p-1)(q-1) are relatively prime). </li>
<!--
<li> Select a random encryption exponent e from {1, ... , l} such that the greatest common denominator of e and l is 1 (that is, e and l are relatively prime). </li>
-->
<li> Let the decryption exponent d be e<sup>-1</sup> mod (p-1)(q-1). </li>
<li> Return the public key pk = (n, e) and the secret key sk = d. </li>
</ul>
</li>
<li>Enc(pk = (n, e), m), where m is a message to be encrypted:
<ul>
<li> Return the ciphertext c = m<sup>e</sup> mod n. </li>
</ul>
<li>Dec(sk = d, c), where c is a ciphertext to be decrypted:
<ul>
<li> Return the recovered message m = c<sup>d</sup> mod n. </li>
</ul>
</li>
</ul>
<p>To see how RSA can be used correctly, take a look at
<a href="https://en.wikipedia.org/wiki/RSA_(cryptosystem)#Padding"
target="wikipedia">the sections starting here</a> in the RSA description in
Wikipedia.</p>
</tr>
</table>
</article>
<!----------------------------------------------------------------------------->
<footer>
<small>
© 2016, by Uri Blumenthal, Jeff Diewald, and Sophia Yakoubov, and 2024, by David Wilson and Nick Cunningham.
</small>
</footer>
</body>
</html>