Skip to main content
>_ supraj.dev
TOPIC SECURITY
Public-key Cryptography the math behind SSH and TLS
IN 10 SECONDS

A cryptographic model using a public key (shareable) to encrypt data and a private key (secret) to decrypt it. Data encrypted with your public key can only be decrypted by your private key.

GOTCHA Sharing your private key compromises your entire security perimeter. Public keys can be public, but private keys must stay protected.
HOW ASYMMETRIC KEY CRYPTO WORKS
01 Key pair generation user runs algorithm generating public and private key files.
02 Encryption sender uses recipient's public key to encrypt a secret message.
03 Decryption recipient uses their secret private key to decrypt the ciphertext back to plaintext.
POKE IT YOURSELF
ssh-keygen -t rsa -b 4096 — generate a secure public/private key pair