Created
July 3, 2018 19:37
-
-
Save jhyland87/2785daf96ac9fc876bf53e6f69f44c60 to your computer and use it in GitHub Desktop.
Generate a GZIP compressed TAR archive thats AES-256 encrypted and password protected
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
# Create encrypted folder with password specified in the command (CHANGEME) | |
tar cz -P -C ./data ./ | openssl enc -aes-256-cbc -salt -pass "pass:CHANGEME" -a -A -e -out encrypted-compressed-archive.tar.gz.enc | |
# Decrypt above file | |
openssl enc -aes-256-cbc -a -A -d -pass "pass:CHANGEME" -in ./encrypted-compressed-archive.tar.gz.enc | tar xz -C ./data | |
# Same thing as the above, but password isn't specified (which means the password will be requested) | |
tar cz -P -C ./data ./ | openssl enc -aes-256-cbc -salt -a -A -e -out encrypted-compressed-archive.tar.gz.enc | |
openssl enc -aes-256-cbc -a -A -d -in ./encrypted-compressed-archive.tar.gz.enc | tar xz -C ./data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment