I need the decryption function below converted into AS3.
## Deliverables
I need the following PHP function converted to AS3:
function _decrypt($buffer, $key) {
$decrypted = "";
$k2 = $key;
$k2 = $k2 * 3;
for ($i = 0; $i < strlen($buffer); $i += 4) {
$s = substr($buffer, $i, 4);
list($i2) = array_values(unpack("V", $s)); // little endian
$i2 = $i2 ^ $k2;
$s2 = pack("V", $i2);
$decrypted .= $s2;
}
$decrypted = strrev($decrypted);
return $decrypted;
}
To test your decryption, you will need to do the following:
Write an SWF that calls the following script and decodes the result:
[login to view URL]{any number}
The decrypted result will be an encrypted XML formatted file.
I am including the [login to view URL] file and the XML file it is encoding and returning.