You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thanks for your work. but i want to decryption use php , how to do that?
and the aes-js password is byte array, but the php aes decryption's password is string。
how to do decryption?
The text was updated successfully, but these errors were encountered:
key=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2]; counter=new aesjs.Counter(1);//默认是1 counter_key=counter._counter;//结果是[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1] var aesCtr = new aesjs.ModeOfOperation.ctr(keys,counter);
php 解密代码
function bytes2String($bytes){
$hex='';
foreach($bytes as $byte){
$one=dechex($byte);
if(strlen($one)=='1'){
$one='0'.$one;
}
$hex.=$one;
}
$string=hex2bin($hex);
return $string;
}
$key=bytes2String([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2]);
$iv=bytes2String([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]);
$de_data=openssl_decrypt($data,'aes-128-ctr',$key,OPENSSL_RAW_DATA,$iv);
thanks for your work. but i want to decryption use php , how to do that?
and the aes-js password is byte array, but the php aes decryption's password is string。
how to do decryption?
The text was updated successfully, but these errors were encountered: