Github encrypt files

Note

View on github: Link

1. Encrypting and decrypting files

  1. Adding files to a tar archive.
# Where foo and bar are the files you want to encrypt.
tar cvf ./path-to-secrets.tar foo bar
  1. Encrypting file
gpg --symmetric --cipher-algo AES256 ./path-to-secrets.tar
  1. Decrypting file
gpg --quiet --batch --yes --decrypt --passphrase="$SECRET_KEY" --output ./path-to-output-file.tar ./path-to-input-gpg-file.gpg
  1. Extracting the tar archive
# -C is for CWD
tar xvf secrets.tar -C ./out-dir
Last Updated: 4/11/2020, 6:11:03 PM