Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

CSE 4215

Chapter 3
RSA Algorithm
Lecture 9
Public Key Cryptography

24 B B
User A decrypt User B encrypt message
the message using 24 using public key of user A.
Private key Suppose B is the message and
24 is the ciphertext

Suppose user A wants to communicate using insecured channel


But someone can try to access the data

CSE 4215 Department of CSE, RUET


Public Key Cryptography

CSE 4215 Department of CSE, RUET


Euler’s Totient Function

CSE 4215 Department of CSE, RUET


Euler’s Totient Function

If n is prime then (n)=n-1


CSE 4215 Department of CSE, RUET
Multiplicative Inverse
1/5 is multiplicative
inverse of 5

2 is the Multiplicative Inverse of 3 mod 5

6 is the Multiplicative Inverse of 2 mod 11

4 is the Multiplicative Inverse of 4 mod 5


No MI as 5 & 10 are not relatively prime
CSE 4215 Department of CSE, RUET
Modular Exponentiation

CSE 4215 Department of CSE, RUET


Modular Exponentiation (extended)
RSA Algorithm

CSE 4215 Department of CSE, RUET


RSA Algorithm
If it is asked that what the prime factors of 35?

The answer is very easy and simple, it is 5 & 7


because the number is very small but consider
the following 256 digit number, it is very
difficult, the RSA algorithm is based on this

What is the prime factors of 256?

It is very difficult to find prime factors

CSE 4215 Department of CSE, RUET


RSA Algorithm

CSE 4215 Department of CSE, RUET


RSA Algorithm

CSE 4215 Department of CSE, RUET


RSA Algorithm

Test the result online use the link


https://umaranis.com/rsa_calculator_demo.html

CSE 4215 Department of CSE, RUET


RSA Algorithm

USER A Public key – {13, 143}


It’s known to Hacker

CT=52
USER A Public key – {13, 143}
USER A Private key – {37, 143} USER A Public key – {13, 143}
It’s only known to User A It’s known to User B
PT=13 PT=13

CT=52 CT=52

Hacker doesn’t have private key to decrypt the message


CSE 4215 Department of CSE, RUET
RSA Algorithm
If it is asked that what the prime factors of 35?

The answer is very easy and simple, it is 5 & 7


because the number is very small but consider
the following 256 digit number, it is very
difficult, the RSA algorithm is based on this

CSE 4215 Department of CSE, RUET


RSA Algorithm

Very difficult the big prime numbers

The more bigger prime number makes more difficult for Hacker to decrypt
Go to the website for RSA factoring challenge
https://en.wikipedia.org/wiki/RSA_Factoring_Challenge

CSE 4215 Department of CSE, RUET


End

You might also like