Last active
October 20, 2015 10:45
-
-
Save etoxin/7f902b183608c9f69f9b to your computer and use it in GitHub Desktop.
How do I simply encrypt a file in terminal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encrypt file.txt to file.enc using 256-bit AES in CBC mode | |
openssl enc -aes-256-cbc -salt -in file.txt -out file.enc | |
# the same, only the output is base64 encoded for, e.g., e-mail | |
openssl enc -aes-256-cbc -a -salt -in file.txt -out file.enc | |
# decrypt binary file.enc | |
openssl enc -d -aes-256-cbc -in file.enc -out file.txt | |
# decrypt base64-encoded version | |
openssl enc -d -aes-256-cbc -a -in file.enc -out file.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment