What is the openssl command line to decrypt text encrypted by this php snippet? -
what openssl command line decrypting text encrypted using following php code?
function encrypt($text, $key) { return trim(base64_encode(mcrypt_encrypt(mcrypt_rijndael_256, $key, $text, mcrypt_mode_ecb, mcrypt_create_iv(mcrypt_get_iv_size(mcrypt_rijndael_256, mcrypt_mode_ecb), mcrypt_rand)))); }
this how far got:
"blah blah" encrypted "password" becomes:
whsklkp6+wjdbgpiacavfp8biaz6b1lzmj0d7nqx2nc=
i try , decrypt with:
openssl base64 -d -in test.b64 > test.bin openssl enc -d -aes-256-ecb -pass pass:password -in test.bin -out test.txt
and get:
bad magic number
Comments
Post a Comment