關於AES CBC 加密的問題

目前我的程式碼大致如下
<?php 
        $key="12345678901234567890123456123456"; // (32)
	$iv="1234567812345678"; //(16)
        $testgo = '{"PayType":"555","ReCheckId":"","1525":"15251","Amount":15215,"ClientId":"888","ProductName":"888"}';

        $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key1, $testgo, MCRYPT_MODE_CBC, $key2));

       echo $encrypted;
?>

但我轉出來的加密後的和別人傳過來的加密後不同

並且API串接方也無法解碼

請問一下是那裡出錯了??

Sign In or Register to comment.