how to use this with php,
i got strange result, when on pb i can use output from pb and php, but on php i can't use output from pb
i use cypher and decypher code from this thread : http://forums.purebasic.com/english/vie ... exible+aes
pb test :
Code: Select all
key$ = "54325879851235451522748462123584";
iv$ = "2165468412123574";
message$ = "Dog, Cat, Whale, Ox, Duck, Elephant";
; PB OUTPUT : THwv9zcRxSUzLLusMa7+Hd317JuloEGv+y8lSq3l2Uq6x30X
; PHP OUTPUT: THwv9zcRxSUzLLusMa7+HbrHfRcMM/V5whVdXrR3Sr1a+1a1UEz8INpZE4KsR5xf
Debug Cypher(message$,key$,iv$)
Debug Decypher("THwv9zcRxSUzLLusMa7+Hd317JuloEGv+y8lSq3l2Uq6x30X",key$,iv$)
Debug Decypher("THwv9zcRxSUzLLusMa7+HbrHfRcMM/V5whVdXrR3Sr1a+1a1UEz8INpZE4KsR5xf",key$,iv$)
Code: Select all
<?php
$key = "54325879851235451522748462123584";
$iv = "2165468412123574";
$message = "Dog, Cat, Whale, Ox, Duck, Elephant";
$pboutput = "THwv9zcRxSUzLLusMa7+Hd317JuloEGv+y8lSq3l2Uq6x30X";
$encrypted = openssl_encrypt ( $message , "aes-256-cbc" , $key, 0, $iv );
$decrypted = openssl_decrypt ( $encrypted , "aes-256-cbc" , $key, 0, $iv );
$test = openssl_decrypt ( $pboutput , "aes-256-cbc" , $key, 0, $iv );
echo($encrypted);
echo ("<br />");
echo($decrypted);
echo ("<br /> OUTPUT : ");
echo($test);
?>
how to make the cypher and decypher function output same with php output even the unicode is on?
please help , thank you very much
