Skip to content

Instantly share code, notes, and snippets.

@dce
Created June 14, 2013 15:26
Show Gist options
  • Save dce/5782728 to your computer and use it in GitHub Desktop.
Save dce/5782728 to your computer and use it in GitHub Desktop.
Encrypt/decrypt a file
#!/bin/sh
openssl aes-256-cbc -d -a -pass "pass:$2" -in $1 -out `echo $1 | sed 's/\.enc$//'`
#!/bin/sh
openssl aes-256-cbc -a -salt -pass "pass:$2" -in $1 -out $1.enc
@mattrude
Copy link

Try:
openssl aes-256-cbc -d -a -pass "pass:$2" -in $1 -out ${1%.enc}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment