• No results found

An Introduction to the RSA Encryption Method

N/A
N/A
Protected

Academic year: 2021

Share "An Introduction to the RSA Encryption Method"

Copied!
22
0
0

Loading.... (view fulltext now)

Full text

(1)

History Modular Arithmetic Your own RSA system Example Proof

An Introduction to the RSA Encryption Method

Jake Salterberg

April 17, 2012

(2)

History Modular Arithmetic Your own RSA system Example Proof

Outline

1 History

2 Modular Arithmetic

3 Your own RSA system

4 Example

5 Proof

(3)

History Modular Arithmetic Your own RSA system Example Proof

History

RSA stands for Rivest, Shamir, and Adelman, the last names of the designers

It was first published in 1978 as one of the first public-key crytographic systems

A public-key system means the algorithm for encrypting a message is publicly known but the algorithm to decrypt the message is only privately known (by the person who set up the system)

(4)

History Modular Arithmetic Your own RSA system Example Proof

Modular Arithmetic Review

Definition

a ≡ b (mod c) ⇐⇒ a = b + kc for some integer k.

Example

1 21 ≡ 1 (mod 4) because 21 = 1 + (5)4

2 52 ≡ 3 (mod 11) because 25 = 3 + (2)11

3 −1 ≡ 7 (mod 8) because −1 = 7 + (−1)8

4 713≡ 7 (mod 8)

713≡ (−1)13 ≡ −1 ≡ 7 (mod 8)

(5)

History Modular Arithmetic Your own RSA system Example Proof

Modular Arithmetic Review

Definition

a ≡ b (mod c) ⇐⇒ a = b + kc for some integer k.

Example

1 21 ≡ 1 (mod 4) because 21 = 1 + (5)4

2 52 ≡ 3 (mod 11) because 25 = 3 + (2)11

3 −1 ≡ 7 (mod 8) because −1 = 7 + (−1)8

4 713≡ 7 (mod 8)

713≡ (−1)13 ≡ −1 ≡ 7 (mod 8)

(6)

History Modular Arithmetic Your own RSA system Example Proof

Modular Arithmetic Review

Definition

a ≡ b (mod c) ⇐⇒ a = b + kc for some integer k.

Example

1 21 ≡ 1 (mod 4) because 21 = 1 + (5)4

2 52 ≡ 3 (mod 11) because 25 = 3 + (2)11

3 −1 ≡ 7 (mod 8) because −1 = 7 + (−1)8

4 713

7

(mod 8)

713≡ (−1)13 ≡ −1 ≡ 7 (mod 8)

(7)

History Modular Arithmetic Your own RSA system Example Proof

Modular Arithmetic Review

Definition

a ≡ b (mod c) ⇐⇒ a = b + kc for some integer k.

Example

1 21 ≡ 1 (mod 4) because 21 = 1 + (5)4

2 52 ≡ 3 (mod 11) because 25 = 3 + (2)11

3 −1 ≡ 7 (mod 8) because −1 = 7 + (−1)8

4 713

7

(mod 8) 713≡ (−1)13

≡ −1 ≡ 7 (mod 8)

(8)

History Modular Arithmetic Your own RSA system Example Proof

Modular Arithmetic Review

Definition

a ≡ b (mod c) ⇐⇒ a = b + kc for some integer k.

Example

1 21 ≡ 1 (mod 4) because 21 = 1 + (5)4

2 52 ≡ 3 (mod 11) because 25 = 3 + (2)11

3 −1 ≡ 7 (mod 8) because −1 = 7 + (−1)8

4 713

7

(mod 8) 713≡ (−1)13 ≡ −1

≡ 7 (mod 8)

(9)

History Modular Arithmetic Your own RSA system Example Proof

Modular Arithmetic Review

Definition

a ≡ b (mod c) ⇐⇒ a = b + kc for some integer k.

Example

1 21 ≡ 1 (mod 4) because 21 = 1 + (5)4

2 52 ≡ 3 (mod 11) because 25 = 3 + (2)11

3 −1 ≡ 7 (mod 8) because −1 = 7 + (−1)8

4 713

7

(mod 8)

713≡ (−1)13 ≡ −1 ≡ 7 (mod 8)

(10)

History Modular Arithmetic Your own RSA system Example Proof

Modular Arithmetic Review

Definition

a ≡ b (mod c) ⇐⇒ a = b + kc for some integer k.

Example

1 21 ≡ 1 (mod 4) because 21 = 1 + (5)4

2 52 ≡ 3 (mod 11) because 25 = 3 + (2)11

3 −1 ≡ 7 (mod 8) because −1 = 7 + (−1)8

4 713≡ 7 (mod 8)

713≡ (−1)13 ≡ −1 ≡ 7 (mod 8)

(11)

History Modular Arithmetic Your own RSA system Example Proof

Necessary Theorems for RSA - φ(n)

Definition

If n is a positive integer, then Euler’s phi function, φ(n), returns the number of integers k in the range 1 ≤ k ≤ n for which gcd (n, k) = 1.

Theorem (Euler’s Theorem)

If n > 0 and a are relatively prime integers, then aφ(n)≡ 1 (mod n).

Corollary

If b1 ≡ b2 (mod φ(n)), then ab1 ≡ ab2 (mod n).

(12)

History Modular Arithmetic Your own RSA system Example Proof

Necessary Theorems for RSA - φ(n)

Definition

If n is a positive integer, then Euler’s phi function, φ(n), returns the number of integers k in the range 1 ≤ k ≤ n for which gcd (n, k) = 1.

Theorem (Euler’s Theorem)

If n > 0 and a are relatively prime integers, then aφ(n)≡ 1 (mod n).

Corollary

If b1 ≡ b2 (mod φ(n)), then ab1 ≡ ab2 (mod n).

(13)

History Modular Arithmetic Your own RSA system Example Proof

Necessary Theorems for RSA - φ(n)

Definition

If n is a positive integer, then Euler’s phi function, φ(n), returns the number of integers k in the range 1 ≤ k ≤ n for which gcd (n, k) = 1.

Theorem (Euler’s Theorem)

If n > 0 and a are relatively prime integers, then aφ(n)≡ 1 (mod n).

Corollary

If b ≡ b (mod φ(n)), then ab1 ≡ ab2 (mod n).

(14)

History Modular Arithmetic Your own RSA system Example Proof

Setting up your own RSA system

Pick p and q to be large prime numbers, and let n = pq.

Then pick an e such that gcd (e, φ(n)) = 1. e is your encryption exponent.

Now, solve for d where ed ≡ 1 (mod φ(n)). This can be done with something called the Extended Euclidean Algorithm, or by solving the Linear Diophantine Equation: ed = 1 + kφ(n). d is your decryption exponent.

You now have your own RSA system! Public Key - (n, e)

Private Key - (d )

(15)

History Modular Arithmetic Your own RSA system Example Proof

Setting up your own RSA system

Pick p and q to be large prime numbers, and let n = pq.

Then pick an e such that gcd (e, φ(n)) = 1. e is your encryption exponent.

Now, solve for d where ed ≡ 1 (mod φ(n)). This can be done with something called the Extended Euclidean Algorithm, or by solving the Linear Diophantine Equation: ed = 1 + kφ(n).

d is your decryption exponent.

You now have your own RSA system! Public Key - (n, e)

Private Key - (d )

(16)

History Modular Arithmetic Your own RSA system Example Proof

Setting up your own RSA system

Pick p and q to be large prime numbers, and let n = pq.

Then pick an e such that gcd (e, φ(n)) = 1. e is your encryption exponent.

Now, solve for d where ed ≡ 1 (mod φ(n)). This can be done with something called the Extended Euclidean Algorithm, or by solving the Linear Diophantine Equation: ed = 1 + kφ(n).

d is your decryption exponent.

You now have your own RSA system!

Public Key - (n, e)

(17)

History Modular Arithmetic Your own RSA system Example Proof

Using your RSA system

When someone wants to send you a message they:

1 Convert their message into a number in a simple agreed upon way such as a=01, b=02, c=03 . . .

2 Compute the ciphertext c ≡ me (mod n)

3 Send you c

To decrypt their message you:

1 Compute m ≡ cd (mod n)

2 Convert their message back into letters and words

(18)

History Modular Arithmetic Your own RSA system Example Proof

Using your RSA system

When someone wants to send you a message they:

1 Convert their message into a number in a simple agreed upon way such as a=01, b=02, c=03 . . .

2 Compute the ciphertext c ≡ me (mod n)

3 Send you c

To decrypt their message you:

1 Compute m ≡ cd (mod n)

2 Convert their message back into letters and words

(19)

History Modular Arithmetic Your own RSA system Example Proof

Example (Set-Up and Encryption)

First, set up your RSA system.

Pick p = 5, q =11. Let n = pq = 55. Now pick e = 3.

Then ed ≡ 1 (mod φ(n)) =⇒ d = 27. Since 3 ∗ 27 ≡ 81 ≡ 1 (mod 40).

Your RSA system is now set up. Make n and e public.

Let’s say that your friend wants to send you the message m=18. They will compute c where c ≡ me (mod n).

c ≡ me ≡ 183 ≡ 5832 ≡ 2 (mod 55) because 183= 5832 = 2 + (106)55.

Your friend will send you the ciphertext c = 2.

(20)

History Modular Arithmetic Your own RSA system Example Proof

Example (Set-Up and Encryption)

First, set up your RSA system.

Pick p = 5, q =11. Let n = pq = 55. Now pick e = 3.

Then ed ≡ 1 (mod φ(n)) =⇒ d = 27. Since 3 ∗ 27 ≡ 81 ≡ 1 (mod 40).

Your RSA system is now set up. Make n and e public.

Let’s say that your friend wants to send you the message m=18.

They will compute c where c ≡ me (mod n).

c ≡ me ≡ 183 ≡ 5832 ≡ 2 (mod 55) because 183= 5832 = 2 + (106)55.

(21)

History Modular Arithmetic Your own RSA system Example Proof

Example (Decryption)

You just recieved c = 2 from your friend.

Use your private key, d = 27, to compute their message m.

m ≡ cd ≡ 227≡ 134217728 ≡ 18 (mod 55) because 227= 134217728 = 18 + (2440322)55.

So your friend sent you the message m = 18.

(22)

History Modular Arithmetic Your own RSA system Example Proof

RSA Proof

Why does m ≡ cd (mod n) work to get you back the original message m?

Proof.

Let p and q be prime, n = pq, ed ≡ 1 (mod φ(n)). Then ∃k ∈ Z such that ed = 1 + kφ(n).

Also let m < n be a message and let c ≡ me (mod n). Then, cd ≡ (me)d ≡ med ≡ m1+kφ(n)≡ m (mod n).

References

Related documents

The PROMs questionnaire used in the national programme, contains several elements; the EQ-5D measure, which forms the basis for all individual procedure

This built on our previously introduced calculation of the absolute magnitude of ΔψM in intact cells, using time-lapse imaging of the non-quench mode fluorescence

This study determined whether there was a significant relationship between teacher effect data in middle school mathematics and a teachers years of experience and whether there was

• Speed of weaning: induction requires care, but is relatively quick; subsequent taper is slow • Monitoring: Urinary drug screen, pain behaviors, drug use and seeking,

Reflecting the slowdown in advertising investment and particular difficulties in the financial markets during the year, the 2001 results are less than those for 2000 (net profit

Internal Software used for all market and site work analysis Lease Administration / Asset Management:.. Dave Depetris/Legend

Kitabın bu bölümü öyküyü bir nesne olarak ele aldıysa da, bunun bir “okuyucu”nun (bu kavramı sadece koltuklarında kitap okuyanları değil, sinemada, bale

In accordance with Article 719 of the Belgian Companies Code, the boards of directors of KBC Group NV, a naamloze vennootschap (company with limited liability), with its