// add translations $_SERVER['REQUEST_URI'] = ''; require_once "$docroot/webGui/include/Translations.php"; $index = $_GET['index']; $tests = explode(',',$_GET['test']); if ($index < count($tests)) { $test = $tests[$index]; list($name,$size) = explode(':',$test); if (!$size) { $default = $test==$_GET['hash']; if ($index>0) $test .= '|tail -1'; if ($default) echo ""; echo preg_replace(['/^(# Tests.*\n)/','/\n$/'],["$1\n",""],shell_exec("/usr/sbin/cryptsetup benchmark -h $test")); echo $default ? " (default)\n" : "\n"; } else { $default = $test==$_GET['luks']; if ($index>5) $size .= '|tail -1'; if ($default) echo ""; echo preg_replace(['/^# Tests.*\n/','/\n$/'],["\n",""],shell_exec("/usr/sbin/cryptsetup benchmark -c $name -s $size")); echo $default ? " (default)\n" : "\n"; } } else { $bm = popen('/usr/sbin/cryptsetup --help','r'); while (!feof($bm)) { $text = fgets($bm); if (strpos($text,'Default PBKDF2 iteration time for LUKS')!==false) echo "\n$text"; elseif (strpos($text,'Default compiled-in device cipher parameters')!==false) echo "\n$text"; elseif (strpos($text,'LUKS1:')!==false) echo str_replace("\t"," ",$text); } pclose($bm); echo "
"; } ?>