Jump to content

Using PHP's RC4Crypt to Interpret Data Encrypted by Meychi's RC4 (ASCrypt)


Recommended Posts

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???

 

 

require_once("scripts/rc4crypt.php");

 

$data = "The secret message is flewdendybewdendybop.";

$key = "1234567890";

 

$encryptedData = bin2hex(rc4crypt::encrypt($key, $data, 0));

$decryptedData = rc4crypt::decrypt($key, $encryptedData, 0); //<== part that needs fixed

 

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 />";

 

 

Meychi's ASCrypt

http://www.jek2k.com/wp//wp/wp-content/uploads/2007/05/ascrypt_sample.zip

 

RC4Crypt

http://sourceforge.net/projects/rc4crypt/

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.