Dear All:
I'm sending this again coz I'm not sure if it was sent out
successfully earlier. Thanks for your help!
Best,
Peter
======
hi there, here's my code. the output on client side should be "Hello
World" but is garbage now... pls help..... thanks so much
crypto++ client:
=============
std::string plaintext = "Hello World", ciphertext, output;
std::string iv,key = "12345678901234567890123456789012";
iv = key;
CFB_Mode<AES>::Encryption encryption(
reinterpret_cast<const byte *>(key.c_str()),
32,
reinterpret_cast<const byte *>(iv.c_str()));
ciphertext.resize(plaintext.size());
encryption.ProcessData(reinterpret_cast<byte *>(&ciphertext[0]),
reinterpret_cast<const byte *>(plaintext.c_str()), plaintext.length());
wwwrequest("/php/decrypt.php", ciphertext, output); // output is garbage...
php server:
==========
<?php
$req = $_GET['data'];
$key = "12345678901234567890123456789012";
$iv = $key;
$td = mcrypt_module_open('rijndael-256', '', 'cfb', '');
mcrypt_generic_init($td, $key, $iv);
$resp = mdecrypt_generic($td, $req);
mcrypt_generic_deinit($td);
echo $resp;
?>