-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
72 lines (65 loc) · 1.87 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
$lang = htmlspecialchars($_GET["lang"] ?? false);
$dict = "";
$listNonAlpha = ",;:!?$/*-_+&@";
switch ($lang) {
case "fr":
$dict = "fr-freelang";
$title = "Mots de passe sécurisés mémorables";
break;
case "en":
$dict = "eff-long";
$title = "Rememberable secure passwords";
break;
default:
$dict = "ger-anlx";
$title = "Einprägsame sichere Passwörter";
break;
}
$xkcdcmd = "xkcdpass -w " . $dict . " --min 3 --max 10 --numwords 3 --delimiter='' --valid-chars='[a-z]' --case='first' --count 30";
$pwlist = shell_exec($xkcdcmd);
?>
<!DOCTYPE html>
<html>
<head>
<title><?= $title ?></title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open%20Sans">
<style type="text/css">
h1,a {
font-family: "Open Sans";
}
</style>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WY96FKFLEW"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-1857734-8');
</script>
</head>
<body>
<h1><?= $title ?></h1>
<hr>
<a href="?lang=de">Deutsch<a/> | <a href="?lang=fr">Français<a/> | <a href="?lang=en">English<a/>
<hr>
<?php
$pws = explode("\n", $pwlist);
$pws = array_filter($pws, 'trim');
// $idx = 0;
foreach($pws as $pw) {
$rNum = rand(0, 99);
// if($idx == 15)
// print "<br>\n";
// if($idx < 15) {
$rNAl = $listNonAlpha[rand(0, strlen($listNonAlpha)-1)];
print $pw . $rNAl . $rNum . "<br>\n";
// }
// else
// print $pw . $rNum . "<br>\n";
// $idx++;
}
?>
<hr>
</body>
</html>