Asymmetric (public-key) cryptography with mathematical foundations, including RSA, ECC, and key exchange protocols. Mathematical Foundation Public-Key Cryptosystem A public-key cryptosystem consists of: $$ \begin{aligned} (pk, sk) &\leftarrow KeyGen() \ C &= Encrypt(pk, M) \ M &= Decrypt(sk, C) …
Read MoreEncrypt and decrypt data using public/private key pairs and derive symmetric keys from ECC key pairs. RSA Encryption (OpenSSL) 1# Generate RSA key pair 2openssl genrsa -out private.pem 4096 3openssl rsa -in private.pem -pubout -out public.pem 4 5# Encrypt file with public key 6openssl rsautl -encrypt -pubin -inkey …
Read MoreGenerate public/private key pairs on Linux for various cryptographic purposes. SSH Keys (Ed25519 - Recommended) 1# Generate Ed25519 key pair 2ssh-keygen -t ed25519 -C "your_email@example.com" 3 4# Specify output file 5ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_custom -C "comment" 6 7# Without passphrase …
Read More