26. So, Harley Quinn want to send message "14" to Joker, knowing only Joker's public key
ASYMMETRIC ENCRYPTION – SIMPLE RSA
26
27. Harley Quinn: encrypted = messagepublic mod n = 143 mod 33 = 5
Joker: encryptedprivate mod n = 57 mod 33 = 14
ASYMMETRIC ENCRYPTION – SIMPLE RSA
27
28. Batman want to know what Harley sent to Joker, but only knows the public key 3, message 5 and
magic number 33, but have no possibility to decipher message without private key 7
ASYMMETRIC ENCRYPTION – SIMPLE RSA
28
29. Not every 3 numbers may give you expected result
PROBLEM 1
29
30. Choose two prime numbers: p and q (in this example: p = 11, q = 3)
Get magic number n = p * q = 33
Get Euler's phi = (p - 1) * (q - 1) = 10 * 2 = 20
Choose public key which should be coprime with phi, p-1 and q-1 and satisfy 1 < public < phi
Find private key where phi divides public * private - 1 (3 * 7 - 1 = 20, 20 / 20 = 1, private = 7)
You are all done! Easy-peasy! Enjoy your public key encryption
GETTING KEY PAIR
30
38. Good mathematicians often makes very bad code
Partial implementations
Incorrect implementations
Outdated protocol versions or crypto primitives
Abandoned projects
Absence of implementation
Fun
WHY?
38