Docroot sub-apps beiratkozas/, iskolak/, phpext/; root PHPs crashadmin.php, crm_hardlock.class.php, login-external.php, tips.php, recaptchalib.php, configuration.php (74-byte MightySites multi-site stub, legit). public/ excluded (user data, ~219k files). Signed-off-by: LÁZÁR Imre <imre@illusion.hu> Assisted-by: claude-code@claude-opus-4-8
31 lines
876 B
PHP
31 lines
876 B
PHP
<?php
|
|
|
|
function generateRandomString($length = 10) {
|
|
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
$charactersLength = strlen($characters);
|
|
$randomString = '';
|
|
for ($i = 0; $i < $length; $i++) {
|
|
$randomString .= $characters[rand(0, $charactersLength - 1)];
|
|
}
|
|
return $randomString;
|
|
}
|
|
|
|
$privateKey = "3E9YY6E3pgGOGNEv30UFiF";
|
|
$publicKey = "2lBv1XQeEHJu5ptjgK5iVm";
|
|
$result = true;
|
|
for ($i = 1; $result == true && $i <= 100000; $i++) {
|
|
$data = generateRandomString(30);
|
|
$encoded = twk_encode($privateKey, $publicKey, $data);
|
|
$decoded = twk_decode($privateKey, $publicKey, $encoded);
|
|
$result = (strcmp($data,$decoded) == 0);
|
|
}
|
|
|
|
if($result)
|
|
echo "OK";
|
|
else
|
|
echo "not OK ".$i;
|
|
|
|
//print_r(twk_test());
|
|
//print_r(twk_encode("3E9YY6E3pgGOGNEv30UFiF", "2lBv1XQeEHJu5ptjgK5iVm", "123456789"));
|
|
?>
|