RSA Encryption
RSA Encryption
Sanjhay Vijayakumar
December 24, 2023
1 Introduction
RSA encryption algorithm, also known as Rivest-Shamir-Adleman encryption algorithm is used widely
in cryptography as an assymetric algorithm. An assymetric algorithm uses two keys, public and private
where public is able to encrypt any data sent by the sender and the private key is the key that is able to
decrypt the data sent to them but is only available to the receiver to prevent any eavesdropping. This
article will explore the use of number theory in the encryption process, disadvantages and advantages
as well as possible solutions to overcome the encryption.
1.2 Process
To quickly summarise, the sender is able to use the ASCII table to map his letters into numbers and
then using c ≡ me ( mod n), we get the encrypted message, c otherwise known as ciphertext. Then,
using cd ≡ m( mod n), we can get the number, m which can then be unwrapped back to its original
letter. Another approach can be as follows: de ≡ 1( mod (p − 1)(q − 1)) where e is the second half
of the public key and p, q are unique prime numbers. Solving the equation to get d and plugging into
equation cd ( mod n) ≡ m where m is plain text. Let us calculate this with actual values:
p = 23, q = 41
n = pq = 23 ∗ 41 = 943
(p − 1)(q − 1) = 880
1
Let us choose a number that is coprime to 880:e = 7 Suppose m = 35
7d ≡ 1( mod 880)
We can solve this using the Euclidean and Extended Euclidean Algorithm.
880x + 7y = 1
2
1.3 Proof
Firstly, we are proving this statement. Let us remind ourselves of the symbols again for convenience.
Plain text, encrypted message, first half of public key and second half of public key, first prime number
and second prime number are denoted by m, c, n, e, pandq. If me ( mod n) ≡ c is true and n = pq
and p + q are prime and de ≡ 1( mod ϕ) where ϕ = (p − 1)(q − 1) and 1 < e < ϕ and e and
phi are co-prime then cd ( mod n) ≡ m.
de ≡ 1( mod (p − 1)(q − 1)
←→ ∃k ∈ Z : de ≡ (p − 1)(q − 1)k + 1
We are given that
axy ≡ (ax ( mod n)y )( mod n)
p−1∗q−1 p−1 q
m ≡ [(m ( mod p)) − 1( mod p)]
We also know that given p is prime, ∀x : x ̸≡ 0( mod p)
mp−1 ( mod p) ≡ 1
1q−1 ( mod p)
1( mod p)
·
··m
p−1∗q−1
≡ 1( mod p)
p−1∗q−1
m ≡ 1( mod q)
We are given that if p + q are coprime and if x ≡ y( mod p) and x ≡ y( mod q) then x ≡ y(
mod pq)
··· m
p−1∗q−1
≡ 1( mod pq)
me mod n ≡ c
e
←→ m ≡ c( mod n)
Given that
ax ≡ (a( mod n))x ( mod n)
←→
e d
(m ) ≡ (c( mod n))d ( mod n)
Given that
axy ≡ ((ax ( mod n))y ( mod n)
ed d
←→ m ≡c ( mod n)
Given that
de ≡ (p − 1)(q − 1)k + 1
p−1∗q−1∗k+1
←→ m ≡ cd ( mod n)∃k ∈ Z
d p−1∗q−1∗k
←→ c ≡ m ∗ m1 ( mod n)
Given that
(ax ≡ (ay ( mod n)ax−y )( mod n)
d p−1∗q−1∗k
←→ c ≡ m ( mod n) ∗ m)( mod n)
d p−1∗q−1 k
←→ c ≡ (((m ( mod n)) ∗ m)( mod n)
d p−1∗q−1 k
←→ c ≡ ((m ( mod pq)) ∗ m)( mod n)
Due to:
mp−1∗q−1 ≡ 1( mod pq)
d k
c ≡ ((1 ) ∗ m)( mod n)
d
←→ c ≡ m( mod n)
d
←→ c ( mod n) ≡ m
Q.E.D
3
1.4 Advantages and Disadvantages
There are numerous advantages and disadvantages. The advantages are seemingly obvious but vital
to consider for one point is that there is no means to exchange a secret key, otherwise known as the
private key. It is also easy to implement mathematically and because of the fact that it involves very
large numbers, it is very hard to decrypt the cipher text back into plain text. However, in the era
that is to come, we see that an algorithm known as the Euclidean algorithm, that of which was used
above, can compute the greatest common divisor of two numbers and if the GCD ̸= 1, then the public
keys can be broken simultaneously. Also, if me < n then the private key can easily be determined.
Another important to disadvantage would be the use of quantum computers which use algorithms that
are able to factor numbers at a faster complexity than other hardware. In particular, an algorithm
named Shor’s would used in the quantum computer