OPENSSL Blowfish CBC encryption differs from PHP to C++
问题 I am trying to encrypt and decrypt a communication between a C++ library and a PHP server using OPENSSL library in both of them. I want to use the Blowfish CBC algorithm but it seems that the results are different between the C++ code and the PHP code. The C++ code is taken from here: This is the PHP code: <?php function strtohex($x) { $s=''; foreach (str_split($x) as $c) $s.=sprintf("%02X",ord($c)); return($s); } $encryptedMessage = openssl_encrypt("input", "BF-CBC", "123456", 0, "initvect")