php - live encryption key not working after upgrading to VPS protocol 3.00 -


similar this question, i've migrated site on use vps protocol 3.00. have done testing against test site test encryption key , works well. when switch on use live site live encryption key, dreaded 3045 : currency field missing error.

the same encryption key works on live site when using vps protocol 2.22, not when it's switched 3.00.

i have fed post data decryption script using same key decrypt crypt without issue.

can think of why code work against test., not live. appropriate key, or why 2.22 accepts key , 3.0 not? live. doing checking 3.00 test. isn't?

my code has modified functions integration kit:

function addpkcs5padding($input) {   $blocksize = 16;   $padd = "";    // pad input block size boundary.   $length = $blocksize - (strlen($input) % $blocksize);   ($i = 1; $i <= $length; $i++) {     $padd .= chr($length);   }    return $input . $padd; }  // aes encryption, cbc blocking pkcs5 padding hex encoding. function sagepay_encrypt($string, $key) {   // add pkcs5 padding text encrypted.   $string = addpkcs5padding($string);    // perform encryption php's mcrypt module.   $crypt = mcrypt_encrypt(mcrypt_rijndael_128, $key, $string, mcrypt_mode_cbc, $key);    // perform hex encoding , return.   return "@" . strtoupper(bin2hex($crypt)); } 

it called populating $crypt_values array , calling:

$crypt_source = sagepay_buildcrypt($crypt_values); $crypt = sagepay_encrypt($crypt_source, $sagepay_key); 

the $crypt_source valid , (largely) same in cases:

vendortxcode=20150721020857deannatest&vendordata=deanna test&amount=1&currency=gbp&description=quote reference deanna test&billingsurname=earley&billingfirstnames=deanna&billingaddress1..... 

looking @ encryption password, short 1 character. i've updated adding 'x' (upper case) end, update value accordingly.

i've given try , fine.

i'm assuming using password begins '3gd' (if not let me know).


Comments