define("KEY1","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
define("KEY2","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
define("KEY3","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
define("KEY4","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
define("IV1","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
define("IV2","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
define("IV3","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
define("IV4","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
define("ID1","2.0");
define("ID2","2.1");
define("ID3","2.2");
define("ID4","2.3");
function decrypt($data){
$plainKeys=array(KEY1,KEY2,KEY3,KEY4);
$plainIVs=array(IV1,IV2,IV3,IV4);
$versionIDs=array(ID1,ID2,ID3,ID4);
$block=MCRYPT_RIJNDAEL_128;
$mode=MCRYPT_MODE_CBC;
$i=0;
$
xml="";
while($i<count($plainKeys)){
$crypter = mcrypt_module_open($block, '', $mode, '');
@mcrypt_generic_init($crypter, base16Decode($plainKeys[$i]),base16Decode($plainIVs[$i]));
$decoded = filterString(mdecrypt_generic($crypter, $data));
mcrypt_generic_deinit($crypter);
mcrypt_module_close($crypter);
if(strpos(strtolower($decoded), "<item>")>0){
$
xml=trim($decoded);
break;
}
$i++;
}