A primer on encryption and hashing
Sep 2023
Vivek Pandey
Outline
A gradation of ideas
most profound
least profound
I can never think of such an idea
- Theory of evolution
- Theory of relativity
I can probably not think of such an idea
- public key cryptography
- neural networks
I could have thought of it
- public key cryptography
- many maths olympiad problems
I often think of such ideas
- your yet another leetcode problem
A primer on encryption
A primer on encryption
m
f(m)
f
What is a very important property of f?
sender
receiver
A primer on encryption
m
f(m)
f
What is a very important property of f?
f needs to be invertible!
f(x) = x + 3 is invertible: g(x) = x - 3 is its inverse
f(x) = 1 if x is odd, 0 if 1 x is even is not invertible
sender
receiver
Two major types of cryptography
Symmetric key cryptography
Symmetric key cryptography
1975
DES is developed
Some people argue DES can be broken
1977
DES is convincingly broken
1997-99
2001
AES is announced
AES is in use till today
2023
Essential idea of DES/AES
Uses of AES
Problem with symmetric key cryptography
Public key cryptography
RSA basic
p
q
λ(n)
e
d
n
You need p & q to find λ(n), knowing n won't suffice
Aside: Digital signatures - 1
Aside: Digital signatures - 2
Outline
Hash function, mathematically
m
f(m)
f
Can f be invertible?
Hash function, mathematically
m
f(m)
f
Can f be invertible?
No: because give some specifically hash value, many inputs can map to that value.
Some desirable properties of hash functions
Where do we use hash functions - 1
Where do we use hash functions - 2
Where do we use hash functions - 3
Where do we use hash functions - 4
Some bad hash functions
Some good hash functions
Collision probability