-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
160 lines (147 loc) · 5.63 KB
/
index.html
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Wireguard Key Generator (Trustless)</title>
<meta name="author" content="Juan I Carrano">
<meta name="description" content="Fully offline Wireguard key and configuration generator, small and open-source.">
<meta name="keywords" content="wireguard, key, generator, vpn, security, privacy, keygen, offline">
<meta name="canonical" content="https://jcarrano.github.io/wg-keygen-notrust/">
<script src="wireguard.js" integrity="sha256-KnkrBLei0lXuE9dGbMURxP000Jg7a9Tm8Gvvc6DysrU="
crossorigin="anonymous"></script>
<style>
body {
margin: 40px auto;
max-width: 650px;
line-height: 1.6;
font-size: 18px;
color: #444;
padding: 10px
}
h1,
h2,
h3 {
line-height: 1.2
}
h2 {
font-size: large;
}
div {
padding: 1ex;
margin-top: 1ex;
}
div.adm {
background-color: rgb(255, 231, 231);
}
div.usr {
text-align: center;
}
div.usr a {
text-decoration: none;
}
#gen {
background-color: rgb(248, 206, 69);
}
[readonly] {
filter: saturate(0);
opacity: 0.5;
}
#results {
display: none;
background-color: rgb(91, 241, 136);
}
pre {
text-align: left;
font-size: small;
background-color: rgb(230, 230, 230);
display: inline-block;
padding: 5px
}
</style>
</head>
<body>
<h1>Wireguard Key Generator (Trustless)</h1>
<div class="usr">
<h2><em>Use this webpage on a private window!!!</em></h2>
</div>
<div class="adm">
<details>
<summary>Parameters</summary>
<form id="params" method="get">
<span id="relevant_for_clientconfig">
<label for="sa">Server Address</label>:<input type="text" id="sa" name="sa" value="example.com">
<label for="sp">Port</label>:<input type="number" id="sp" id="sp" name="sp" min="1" max="65635"
value="51820"><br>
<label for="sk">Server Pubkey</label>:<input type="text" id="sk" name="sk"
value="RANDOM-EXAMPLE"><br>
<label for="pk">Preshared Key</label>:<input type="text" id="pk" name="pk" value="">
<button type="button" id="pskbtn" onclick="genPsk()">Generate</button>
<label for="pka">Autogenerate</label>:<input type="checkbox" id="pka" name="pka"
onchange="pskbtn.disabled = this.checked;pk.readOnly = this.checked;"><br>
<label for="ca">Client Address</label>:<input type="text" id="ca" name="ca" value="10.0.0.2/32"><br>
<label for="dn">DNS</label>:<input type="text" id="dn" name="dn" value=""><br>
<label for="mt">MTU</label>:<input type="number" id="mt" name="mt" min="0" max="65635"
value="1400"><br>
<label for="aa">Allowed Subnets</label>:<input type="text" id="aa" name="aa" value="10.0.0.0/24"><br>
<label for="ka">Keepalive</label>:<input type="number" id="ka" name="ka" min="0" max="1000"
value="25"><br>
<label for="cn">Client name</label>:<input type="text" id="cn" name="cn">
<button type="button" id="gencnbtn" onclick="generateCN()">Generate</button>
<label for="cna">Autogenerate</label>:<input type="checkbox" id="cna" name="cna"
onchange="gencnbtn.disabled = this.checked;cn.readOnly = this.checked;"><br>
<label for="ae">Admin email</label>:<input type="text" id="ae" name="ae"><br>
</span>
<input type="submit" value="Save to URL">
</form>
</details>
</div>
<div id="gen" class="usr">
<p>Note: for maximum security, close all other browser tabs and all programs before
generating the configuration files</p>
<button id="genbtn" onclick="genCfg()">Generate</button>
</div>
<div id="results" class="usr">
<p>You must keep the <em>client configuration</em> for yourself and send the
<em>server fragment</em> to the VPN server administrator
</p>
<h3>Client Configuration</h3>
<a id="client-dl" title="Download">💾</a>
<a title="Copy to clipboard"
href="javascript:copycl(document.getElementById('client-sh').textContent);">📋</a><br>
<pre id="client-sh"></pre>
<h3>Server Fragment</h3>
<a id="server-dl" title="Download">💾</a>
<a title="Copy to clipboard"
href="javascript:copycl(document.getElementById('server-sh').textContent);">📋</a>
<a href="" id="server-em" title="Send by Email" target="_blank">📧</a><br>
<pre id="server-sh"></pre>
<p>Note: for maximum security, reboot your computer after you are done</p>
</div>
<div>
<details>
<summary>Additional info</summary>
<p>The parameters are usually set by the server administrator and can be saved in URL's query string. Only
the
client address and name need to be changed per client. The client name is optional and serves to
uniquely
label the config fragments sent to the server.</p>
<p>Filling in "Admin Email" will enable a mailto link.</p>
<p>If this webpage is not used in private mode, the contents of the client config will be stored in the
browser's history as the download location of the file.</p>
<p>There are no guarantees that javascript crypto is safe from side-channel attacks and there is no secure
wipe function, that's why it is recommended to close all other tabs before and reboot the machine after.
</p>
<p>NO WARRANTY EXPRESSED OR IMPLIED!!!!</p>
</details>
</div>
<div class="usr">
<p>This tool © 2022 Juan I Carrano and contributors.<br> Keygen code © 2015-2020 Jason A. Donenfeld.<br>
This project is not associated with WireGuard®. "WireGuard" and the "WireGuard" logo are registered
trademarks of Jason A. Donenfeld.<br>
<a href="https://github.com/jcarrano/wg-keygen-notrust">GitHub Repository</a>
</p>
</div>
<script src="ui.js" integrity="sha256-tZM3n9wHhCy84ks5euyNYPRzbzFYUnBtJ4euoSxmDSI="
crossorigin="anonymous"></script>
</body>
</html>