I want to encrypt and decrypt one file using one password.
How can I use OpenSSL to do that?
Security Warning: AES-256-CBC does not provide authenticated encryption and is vulnerable to padding oracle attacks. You should use something like age instead.
Encrypt:
openssl aes-256-cbc -a -salt -in secrets.txt -out secrets.txt.enc
Decrypt:
openssl aes-256-cbc -d -a -in secrets.txt.enc -out secrets.txt.new
More details on the various flags
2.1m questions
2.1m answers
60 comments
57.0k users