Skip to content

Instantly share code, notes, and snippets.

@dymx101
Forked from soygul/crypt.sh
Created November 21, 2019 06:33
Show Gist options
  • Save dymx101/1a97d9f4215ce51e9630ad66cc1a3286 to your computer and use it in GitHub Desktop.
Save dymx101/1a97d9f4215ce51e9630ad66cc1a3286 to your computer and use it in GitHub Desktop.
Encrypt/Decrypt Files Using OpenSSL
# encrypt
openssl enc -in test.txt -aes-256-cbc -pass pass:mypass -out test.txt.enc
# decrypt
openssl enc -in test.txt.enc -d -aes-256-cbc -pass pass:mypass -out test.txt
# valid password sources (as of OpenSSL 1.1.1, see 'man openssl' for more recent info):
# -pass pass:mypass
# -pass env:somevar
# -pass file:somepathname
# -pass fd:number
# -pass stdin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment