Saturday, May 7, 2011

OpenSSL cheats

Since I keep forgetting this, I'll write it down here.

# Download a cert
openssl s_client -connect somesitename.com:443

# Encrypt:
openssl enc -aes-256-cbc -salt -in cleartext_file.txt -out encrypted_file.txt.enc

# Decrypt:
openssl enc -d -aes-256-cbc -in encrypted_file.txt.enc -out cleartext_file.txt