Created
March 18, 2017 16:01
-
-
Save romaad/3836dd18dd21f4e856d265a542cf03c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#program that decrypts and encrypts a file using des3 | |
#encrypts a file and save it | |
if [ "$1" = "-e" ]; then | |
openssl des3 < $2 > $2.des3 | |
fi | |
#encrypts a file and erase the original | |
if [ "$1" = "-ee" ]; then | |
openssl des3 < $2 > $2.des3 | |
rm $2 | |
fi | |
#decrypt file and show it | |
if [ "$1" = "-ds" ]; then | |
openssl des3 -d < $2.des3 | |
echo "" #echo new line | |
fi | |
#decrypt file and write it | |
if [ "$1" = "-dw" ]; then | |
openssl des3 -d < $2.des3 > $2 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment