How to encrypt and decrypt a file with openssl

Openssl comes with lots of cipher types. At the end of the post you can find a list of all cipher types.


We want to encrypt the file test.txt with AES 256 Bit CBC. The name of the encrypted file is test.enc:

openssl enc -aes-256-cbc -in test.txt -out test.enc


We want to decrypt the file test.enc with AES 256 Bit CBC:

openssl enc -d -aes-256-cbc -in test.enc -out test.txt

Openssl will ask you for the passphrase.

List of all cipher types:


Last update: 14.06.2015


Posted on April 18, 2012, in Cryptography and tagged . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: