Encrypt local files

Table of Content

gpg

$ tar -cz "<folder/file>" | gpg --encrypt --recipient <recipientname/ID> --s2k-mode 3 --s2k-digest-algo sha512 --s2k-count 142002142 -o "<name>.tar.gz.gpg"

openssl

encrypt

$ tar cz /etc | openssl enc -aes-256-cbc -out etc.tar.gz.dat

decrypt

$ openssl enc -aes-256-cbc -d -in etc.tar.gz.dat | tar xz

zip

$ zip -r --encrypt filename.zip <files>

URL

https://linuxconfig.org/using-openssl-to-encrypt-messages-and-files-on-linux