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
#PowerShell to create an gibberishaes(and openssl) compatible aes string with salt | |
#Salted__8bitsalt/aesstring | |
#thanks for .netcode -> http://stackoverflow.com/questions/5452422/openssl-using-only-net-classes | |
# | |
# This outputs the same ciphertext as: echo -n "SomePlainText"|/usr/bin/openssl enc -A -e -aes-256-cbc -a -pass pass:ThePassword | |
# For decrypt: echo "[cipherText]"|/usr/bin/openssl base64 -d|/usr/bin/openssl enc -A -d -aes-256-cbc -pass pass:ThePassword | |
function OpenSSLEncrypt($passphrase, $plainText) | |
{ | |
# generate salt |