>
 

MATH 243 -- Algebraic Structures 

RSA Public-Key Encryption Example 

Friday, October 27 

 

Consider the RSA system with  

 

 m = `*`(11, 13) and `*`(11, 13) = 143(much too small to be a secure system, but 

                                OK for "hand" calculations!) 

 

 The public information would be the encryption exponent  

 e  and the number  m = 143.We will use  e = 7  so the 

 encryption function is  f(x) = `mod`(x^7, 143.) 

 

 Let's take the plaintext message  "MEET AT DAWN" 

 converted to numerical form in the simplest way 

 (A = 0, B = 1, C = 2, etc.) 

> plaintext := [12, 4, 4, 19, 0, 19, 3, 0, 22, 13]; 1
 

[12, 4, 4, 19, 0, 19, 3, 0, 22, 13] 

 We apply the encryption function to each number in the 

 plaintext message like this: 

> f := proc (x) options operator, arrow; `mod`(x^7, 143) end proc; 1
 

proc (x) options operator, arrow; `mod`(x^7, 143) end proc 

> ciphertext := map(f, plaintext); 1
 

[12, 82, 82, 46, 0, 46, 42, 0, 22, 117] 

>
 

 The decryption exponent in this case is  d = 103since 

 

> `mod`(`*`(7, 103), `+`(11, -1)*`+`(13, -1)); 1
 

1 

 So to decrypt: 

> g := proc (x) options operator, arrow; `mod`(x^103, 143) end proc; 1
 

proc (x) options operator, arrow; `mod`(x^103, 143) end proc 

> decrypt := map(g, ciphertext); 1
 

[12, 4, 4, 19, 0, 19, 3, 0, 22, 13] 

 which recovers the original plaintext(!) 

>
 

>