New script to generate nginx.conf part

This commit is contained in:
nemunaire 2014-01-21 03:08:08 +01:00
commit 8d7394b833
7 changed files with 108 additions and 29 deletions

View file

@ -20,7 +20,22 @@ else if (!empty($_POST["solution"]) && !empty($_GET["team"]) && !empty($_GET["th
$algos = array("md5", "sha1", "sha256", "sha384", "sha512", "whirlpool");
$content = "";
foreach($algos as $algo)
$content .= mcrypt_encrypt(MCRYPT_SERPENT_256, hash($algo, $_POST["solution"]), hash($algo, $filename), MCRYPT_MODE_ECB)."\n";
{
$cnt = hash($algo, $filename, true);
// Encrypt twice on long key
$key = hash($algo, $_POST["solution"]);
$kfirst = pack('H*', substr($key, 0, 64));
$cnt = mcrypt_encrypt(MCRYPT_SERPENT, $kfirst, $cnt, MCRYPT_MODE_ECB);
if (strlen($key) > 64)
{
$ksec = pack('H*', substr($key, 64, 64));
$cnt = mcrypt_encrypt(MCRYPT_SERPENT, $ksec, $cnt, MCRYPT_MODE_ECB);
}
$content .= bin2hex($cnt)."\n";
}
file_put_contents($file, $content, LOCK_EX);