To display the contents of a PEM formatted certificate:

$ openssl x509 -in the-cert.pm -text

Connecting to the server:

$ openssl s_client -showcerts -connect imap.ejemplo.org:993 < /dev/null

Test smtp 587:

$ openssl s_client -host smtp.gmail.com -port 587 -starttls smtp -crlf

Checking the Validity Date:

$ openssl s_client -showcerts -connect nbari.com:443 2>/dev/null | openssl x509 -noout -dates

Encode base64 a file:

$ openssl enc -base64 -in file.txt -out file.txt.enc

if no ssl: python -m base64 -d

Create pair of keys (self signed certificate):

$ openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650

Test speed of signatures:

$ openssl speed sha256 sha512

Change pass-phrase of a key, you will need to specify the old pass-phrase and then spedify a new one:

$ openssl rsa -des3 -in example.key -out example.key.new

🔗encrypt / decrypt

Encrypt:

$ openssl aes-256-cbc -a -salt -in file.txt -out file.txt.enc

Decrypt:

$ openssl aes-256-cbc -d -a -in file.txt.enc -out file.txt