I'm sending encrypted data from Flash to PHP using LoadVars. While still in Flash, I'm using the RC4 class of Meychi's ASCrypt package to encrypt said data. The encrypted data is being received by PHP successfully, and my key is correct. I'm having trouble decrypting the data, though. I think the root of my problem comes down to the nature of the arguments (hexadecimal v. binary). After some playing around, I've been able to reproduce ASCrypt's output using PHP's RC4Crypt, but I still can't seem to figure out how to decrypt it.
Here's a PHP script I've made that reproduces the encrypted data coming from Flash. Could anyone show me how to go about decrypting it???
Code:require_once("scripts" . "/" . "rc4crypt" . "." . "php"); $data = "The secret message is flewdendybewdendybop."; $key = "1234567890"; $encryptedData = bin2hex(rc4crypt::encrypt($key, $data, 0)); //The next part is what needs fixed $decryptedData = rc4crypt::decrypt($key, $encryptedData, 0); echo "<b>data:</b><br />$data<br /><br />"; echo "<b>key:</b><br />$key<br /><br />"; echo "<b>encryptedData:</b><br />$encryptedData<br /><br />"; echo "<b>decryptedData:</b><br />$decryptedData<br /><br />";