Answer the question
In order to leave comments, you need to log in
How to properly encrypt text in openssl?
Hello.
I need to encrypt a string in php and decrypt in python with regular AES-256-ECB.
here is the code:
function create_hash($var1, $var2, $var3) {
$key = 'hVyzdDQmDqanzkUDowPtere17cvNN3Lm';
$input_string = $var1 . ' ' . $var2 . ' ' . $var3;
$hash = openssl_encrypt($input_string, 'AES-256-ECB', $key);
//make hash url safety
$hash = strtr( $hash, '+/', '-_' );
return $hash;
}
error:0607F08A:digital envelope routines:EVP_EncryptFinal_ex:data not multiple of block length
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question