-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
243 lines (218 loc) · 10.3 KB
/
index.html
File metadata and controls
243 lines (218 loc) · 10.3 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Interactive demonstration of the Noise Protocol Framework — composable handshake patterns for secure channels" />
<script>
(function () {
const saved = localStorage.getItem('theme');
document.documentElement.setAttribute('data-theme', saved ?? 'dark');
})();
</script>
<title>Noise Pipe — crypto-lab</title>
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='0.9em' font-size='90'>🔐</text></svg>" />
</head>
<body>
<!-- Skip link for accessibility -->
<a href="#main-content" class="skip-link">Skip to main content</a>
<!-- Header -->
<header class="site-header">
<button
id="theme-toggle"
class="theme-toggle"
type="button"
aria-label="Switch to light mode"
style="position: absolute; top: 0; right: 0"
>🌙</button>
<div class="header-top">
<div class="header-left">
<span class="category-chip" aria-label="Category: Protocols">Protocols</span>
<h1 class="site-title">Noise Pipe</h1>
</div>
<div class="header-right">
<a
href="https://github.com/systemslibrarian/crypto-lab-noise-pipe"
class="github-badge"
target="_blank"
rel="noopener noreferrer"
aria-label="View source on GitHub"
title="View on GitHub"
>
<svg aria-hidden="true" width="20" height="20" viewBox="0 0 16 16" fill="currentColor">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/>
</svg>
</a>
</div>
</div>
<p class="site-subtitle">Interactive demonstration of the Noise Protocol Framework</p>
<div class="primitive-chips" aria-label="Cryptographic primitives used">
<span class="prim-chip">Noise Protocol</span>
<span class="prim-chip">X25519</span>
<span class="prim-chip">AES-256-GCM</span>
<span class="prim-chip">HKDF-SHA-256</span>
</div>
<p class="spec-ref">
Based on <a href="https://noiseprotocol.org/noise.html" target="_blank" rel="noopener noreferrer">Noise Protocol Framework, Revision 34</a>
</p>
</header>
<!-- Main Content -->
<main id="main-content">
<!-- Why This Matters -->
<section class="why-matters" aria-labelledby="why-heading">
<h2 id="why-heading">Why This Matters</h2>
<p>
Noise powers <strong>WireGuard</strong>, <strong>Lightning Network</strong>, and
<strong>WhatsApp's transport layer</strong> — composable security without TLS complexity.
Choose a handshake pattern, and the security properties follow. No negotiation, no downgrade attacks,
no certificate authorities required.
</p>
</section>
<!-- Tab Navigation -->
<nav class="panel-nav" aria-label="Demo panels">
<div role="tablist" aria-label="Noise Protocol demo panels">
<button role="tab" aria-selected="true" aria-controls="panel-pattern" id="tab-pattern" tabindex="0">
Pattern Selector
</button>
<button role="tab" aria-selected="false" aria-controls="panel-walkthrough" id="tab-walkthrough" tabindex="-1">
Handshake
</button>
<button role="tab" aria-selected="false" aria-controls="panel-transport" id="tab-transport" tabindex="-1">
Transport
</button>
<button role="tab" aria-selected="false" aria-controls="panel-comparison" id="tab-comparison" tabindex="-1">
Compare
</button>
<button role="tab" aria-selected="false" aria-controls="panel-wireguard" id="tab-wireguard" tabindex="-1">
WireGuard
</button>
</div>
</nav>
<!-- Panel 1: Pattern Selector -->
<section id="panel-pattern" role="tabpanel" aria-labelledby="tab-pattern">
<h2>Pattern Selector</h2>
<p>Select a Noise handshake pattern to explore its message flow and security properties.</p>
<div id="pattern-chips" class="pattern-chips-container" role="radiogroup" aria-label="Select a Noise pattern"></div>
<div class="pattern-detail" aria-live="polite">
<h3 id="pattern-name" class="pattern-name-display"></h3>
<p id="pattern-description" class="pattern-desc"></p>
<div class="pattern-section">
<h4>Message Sequence</h4>
<pre id="pattern-messages" class="pattern-display" aria-label="Handshake message sequence"><code></code></pre>
</div>
<div class="pattern-section">
<h4>Security Properties</h4>
<div id="security-properties" aria-label="Security properties for selected pattern"></div>
</div>
<div class="pattern-section">
<h4>Real-World Use</h4>
<p id="real-world-use" class="real-world-text"></p>
</div>
<div class="pattern-section">
<h4>Token Legend</h4>
<div id="token-legend" class="token-legend" aria-label="Token descriptions"></div>
</div>
</div>
</section>
<!-- Panel 2: Handshake Walkthrough -->
<section id="panel-walkthrough" role="tabpanel" aria-labelledby="tab-walkthrough" hidden>
<h2>Handshake Walkthrough</h2>
<p>Step through each handshake message to see DH operations, key evolution, and hash updates.</p>
<div id="handshake-status" class="status-message" aria-live="polite"></div>
<div class="step-navigation">
<button id="step-prev" class="btn btn-secondary" aria-label="Previous handshake message" disabled>
← Previous
</button>
<span id="step-counter" class="step-counter" aria-live="polite">Message 1 of 1</span>
<button id="step-next" class="btn btn-secondary" aria-label="Next handshake message">
Next →
</button>
</div>
<div id="step-info" class="step-info" aria-live="polite"></div>
</section>
<!-- Panel 3: Transport Phase -->
<section id="panel-transport" role="tabpanel" aria-labelledby="tab-transport" hidden>
<h2>Transport Phase</h2>
<p>After handshake completion, encrypt and decrypt messages with the derived transport keys.</p>
<div class="transport-keys">
<div class="key-display">
<label class="key-label" id="send-key-label">Send Key (initiator → responder)</label>
<div class="hex-value" id="transport-send-key" aria-labelledby="send-key-label"></div>
</div>
<div class="key-display">
<label class="key-label" id="recv-key-label">Receive Key (responder → initiator)</label>
<div class="hex-value" id="transport-recv-key" aria-labelledby="recv-key-label"></div>
</div>
</div>
<div class="nonce-display">
<span>Nonce counter:</span>
<span id="transport-nonce" class="nonce-value" aria-live="polite">0</span>
<span class="nonce-note">(exhaustion at 2<sup>64</sup> — rekey required)</span>
</div>
<div class="transport-demo">
<div class="input-group">
<label for="transport-message">Message to encrypt</label>
<input
type="text"
id="transport-message"
class="text-input"
placeholder="Type a message…"
autocomplete="off"
/>
</div>
<button id="encrypt-btn" class="btn btn-primary" aria-label="Encrypt message with transport key">
Encrypt & Send
</button>
<div id="transport-error" class="error-message" aria-live="assertive"></div>
<div class="transport-output">
<div class="output-group">
<label id="ct-label">Ciphertext (hex)</label>
<div class="hex-output" id="transport-ciphertext" aria-labelledby="ct-label"></div>
</div>
<div class="output-group">
<label id="pt-label">Decrypted plaintext</label>
<div class="plaintext-output" id="transport-plaintext" aria-labelledby="pt-label"></div>
</div>
</div>
</div>
</section>
<!-- Panel 4: Pattern Comparison -->
<section id="panel-comparison" role="tabpanel" aria-labelledby="tab-comparison" hidden>
<h2>Pattern Comparison</h2>
<p>Side-by-side comparison of key Noise patterns and their security properties.</p>
<div id="comparison-table" class="comparison-container"></div>
</section>
<!-- Panel 5: WireGuard Deep Dive -->
<section id="panel-wireguard" role="tabpanel" aria-labelledby="tab-wireguard" hidden>
<h2>WireGuard Deep Dive</h2>
<div id="wireguard-content"></div>
</section>
</main>
<!-- Cross-links -->
<section class="cross-links-section" aria-label="Related demos">
<h2>Related Demos</h2>
<div class="cross-link-badges">
<a href="https://github.com/systemslibrarian/crypto-lab-ratchet-wire" class="cross-badge" target="_blank" rel="noopener noreferrer">
crypto-lab-ratchet-wire
</a>
<a href="https://github.com/systemslibrarian/crypto-lab-x3dh-wire" class="cross-badge" target="_blank" rel="noopener noreferrer">
crypto-lab-x3dh-wire
</a>
<a href="https://github.com/systemslibrarian/crypto-lab-hybrid-wire" class="cross-badge" target="_blank" rel="noopener noreferrer">
crypto-lab-hybrid-wire
</a>
<a href="https://github.com/systemslibrarian/crypto-compare" class="cross-badge" target="_blank" rel="noopener noreferrer">
crypto-compare — Protocols
</a>
</div>
</section>
<!-- Footer -->
<footer class="site-footer">
<p class="footer-verse">
"So whether you eat or drink or whatever you do, do it all for the glory of God."
<br />— 1 Corinthians 10:31
</p>
</footer>
<script type="module" src="./src/main.ts"></script>
</body>
</html>