21_Encryption
21_Encryption
The Problem
• --Demo--
The Problem
Encrypt
VH6rMQ3CNIVe9FfEzyQgXhc6FZGe3ydwjF6aTr8aIw5zde/
2BpckQ0kwnBkIBKH4NpGLMYNpjaI1Q2xWhA7qclTfe17C2dXiAKMhdTWQ5+k6w
Km3wnKCl71TOtsNEVZ3yUEW4jZC+r4a7k7PENhTFWm2kyad62grjBha731Sa+g=
Decrypt
Decryption
• Receive c
• Compute m = c^d mod(n)
• Read m
Public Key Encryption - RSA
• RSA key generation gives us: m = m^(e*d) mod(n)
• This means that we can also encrypt with the private key
and decrypt with the public key
• We call this a signature
• Everyone can decrypt the message so there is no privacy
• However, there is a guarantee that the author is legitimate
(You know I'm the one who sent this message)
Public Key Encryption - RSA
• What about a brute force attack?
• Attacker has the public key
• Keep encrypting "guesses" of the plaintext until the
cyphertext matches
Public Key Encryption - RSA
• What about a brute force attack?
• Solution: Use a padding algorithm
• Add random bits to the end of each message
• Attacker must guess these random bits
• Adds security!
• Unlike salting, padding can be kept secret and adds
entropy
• Makes encryption of even short messages secure!
Public Key Encryption - RSA
• Unlike salting, padding can be kept secret and adds
entropy
• Why?
Public Key Encryption - RSA
• Unlike salting, padding can be kept secret and adds
entropy
ffi
Public Key Encryption
Demo