Quote:
Originally Posted by gaaara
hello
i have a probleme with key générated of your script dénobis
is a good key is not a probleme juste but it works randomly
on the script
Code:
$open = fopen("php\key\keyfile.txt", "r");
$okey=fgets($open,255);
$td = mcrypt_module_open('rijndael-128', '', 'ecb', '');
$iv = str_repeat("\x00", 16);
$key = pack("A*",$okey); ## **not working**
$key = $key . str_repeat("\x00", 32 - strlen($key));
mcrypt_generic_init($td, $key, $iv);
$key = mcrypt_generic($td, $key);
$key = str_repeat(substr($key, 0, 16), 2);
mcrypt_generic_deinit($td);
the key is readable
test code
Code:
<?php
$key = pack('A*', 'b8e3c43ee882b09ec4e7ace525dfd45');
echo "$key"
?>
résult
Code:
[gaaara@localhost adn]$ php test
b8e3c43ee882b09ec4e7ace525dfd45
jus actualy not works
|
$key = $okey; ## **working**
The key is 'b8e3c43ee882b09ec4e7ace525dfd45', dont repack it, but adjust it to 32 bytes
0b8e3c43ee882b09ec4e7ace525dfd45
change the script anyway to
Code:
$iv=array_slice(explode("24",explode("5620",explode("d030",explode("62052404d3a215d3ffff620848",$swf)[1])[1])[0]),1);
$key="";
foreach ($iv as $c)
{
$actual=sprintf("%02x",chr(hexdec(substr($c,0,2))));
$key.=str_repeat($actual,strlen($c)/2);
}