Skip to content

Instantly share code, notes, and snippets.

@rafaelsq
Last active April 29, 2020 16:36
Show Gist options
  • Save rafaelsq/60ae94086970b4dbd2e36c77e7955d48 to your computer and use it in GitHub Desktop.
Save rafaelsq/60ae94086970b4dbd2e36c77e7955d48 to your computer and use it in GitHub Desktop.
Encode/Decode file with openssl
#!/bin/bash
echo "limon" > encdec.dec
echo "Encrypt"
openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter 10000 -salt -in encdec.dec -out encdec.enc
ls encdec.*
# encdec.enc encdec.dec
rm encdec.dec
ls encdec.*
# encdec.enc
echo "Decrypt"
openssl enc -aes-256-cbc -md sha512 -pbkdf2 -d -in encdec.enc -out encdec.dec
ls encdec.*
# encdec.enc encdec.dec
cat encdec.dec
# limon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment