Table of contents
Open Table of contents
Asymmetric Cyptography
Every participant has a key pair. The key pair consist of:
- public key
- private key
Math
Take RSA.
- Pick two large primes, p & q.
- Compute their product, n.
- Compute Euler’s totient
- Pick a public exponent e so that it causes wrap around with the modulus.
- Compute the private exponent d
Digital Signature
You have a message. You hash it using a known hashing algorithm. Sign the hash with your private key. At this point, you have:
- M = the message
- H = hash(M), the hash of the message body
- S = encrypt_private(H), the signed hash with private key
The reciever can then:
- H = hash(M) <- reciever has to do this step; both sides have to do it
- = decrypt_public(S)
The reciever takes the signed hash and can verify it with the public key to get back the original hash.