Created
May 12, 2015 17:22
-
-
Save hudon/d451cd869bde8ed85623 to your computer and use it in GitHub Desktop.
hybrid decrypt
This file contains hidden or 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
# decrypt /path/to/decrypted/target | |
# assumes existence of target.iv, target.key (aes-256-cbc), target.enc (encrypted target) | |
decrypt () { | |
local IV=`base64 -d < "$1.iv" | openssl rsautl -decrypt \ | |
-inkey /etc/ssl/private/private.key` | |
local KEY=`base64 -d < "$1.key" | openssl rsautl -decrypt \ | |
-inkey /etc/ssl/private/private.key` | |
openssl aes-256-cbc -d -a -in "$1.enc" -out "$1" -iv "$IV" -K "$KEY" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment