Skip to content
Go back

Public and Private Key

Table of contents

Open Table of contents

Asymmetric Cyptography

Every participant has a key pair. The key pair consist of:

Math

Take RSA.

  1. Pick two large primes, p & q.
  2. Compute their product, n.
  3. Compute Euler’s totient ϕ(n)=(p1)(q1)\phi(n) = (p - 1)(q - 1)
  4. Pick a public exponent e so that it causes wrap around with the modulus.
  5. Compute the private exponent d de1(modϕ(n))d \cdot e \equiv 1 \pmod{\phi(n)}

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:

The reciever can then:

The reciever takes the signed hash and can verify it with the public key to get back the original hash.


Share this post on:

Previous Post
DNS Records
Next Post
Arrays in Go