OpenSSL cheatsheet
The toolkit behind HTTPS: keys, certificates and hashing
How it works
- Make a key — Generate a private and public key pair.
- Prove identity — A certificate authority signs your certificate.
- Agree a secret — TLS sets up a session key between browser and server.
- Encrypt — Everything after that travels protected.
First steps
openssl version- Check the version
openssl dgst -sha256 file.txt- Fingerprint a file
openssl rand -base64 24- Make a strong random value
openssl s_client -connect example.com:443- View a website certificate chain
openssl enc -aes-256-cbc -pbkdf2 -in notes.txt -out notes.enc- Encrypt your own file with a password