Skip to content

Commit

Permalink
deploy: 9c5207d
Browse files Browse the repository at this point in the history
  • Loading branch information
TransparentLC committed Aug 14, 2024
1 parent 14709be commit 909f998
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="zh-Hans"><head><meta charset="utf-8"><link href="./vite.svg" rel="icon" type="image/svg+xml"><meta content="TransparentLC" name="author"><meta content="width=device-width,initial-scale=1" name="viewport"><title>webgl-vanity-gpg</title><style>[v-scope]{display:none}body{--fonts:ui-monospace,Menlo,Monaco,"Cascadia Code","Segoe UI Mono","Roboto Mono","Oxygen Mono","Ubuntu Monospace","Source Code Pro","Fira Mono","Droid Sans Mono",Consolas;--font-stack:var(--fonts),sans-serif;--mono-font-stack:var(--fonts),monospace;--global-font-size:16px}body code{padding:0 .25em}body code::after,body code::before{content:none}.grid{display:grid;grid-template-rows:auto;grid-gap:1em;grid-template-columns:repeat(auto-fit,minmax(calc(var(--page-width)/ 12),1fr))}@media (max-width:800px){.grid.desktop-only{display:unset}}</style><script crossorigin src="./assets/index-B8A58fJZ.js" type="module"></script><link href="./assets/index-B5bb1FGs.css" rel="stylesheet" crossorigin></head><body @vue:mounted="mounted" class="container" v-scope><header class="terminal-nav" style="display:flex;justify-content:right;align-items:center;flex-direction:row"><div class="terminal-logo"><div class="logo terminal-prompt">webgl-vanity-gpg</div></div><div style="flex-grow:1"></div><a href="https://github.com/TransparentLC/webgl-vanity-gpg" style="display:flex;background:0 0"><img src="https://img.shields.io/github/stars/TransparentLC/webgl-vanity-gpg?style=social"></a></header><main><p>使用 GPU(WebGL)快速生成带有“靓号”的 PGP 密钥!</p><p>“靓号”指的是带有连号等特定格式的密钥指纹或 ID(例如以 <code>77777777</code> 结尾),具体介绍和生成原理请参见:</p><ul><li><a href="https://www.douban.com/note/763978955/">一位 PGP 进步青年的科学算号实践</a></li><li><a href="https://blog.dejavu.moe/posts/the-scientific-vanity-pgp-counting-guide/">某科学的 PGP 算号指南</a></li></ul><p>密钥使用 <a href="https://openpgpjs.org/">OpenPGP.js</a> 在浏览器中生成,不会发送到其他地方。如果仍然担心这一点,可以检查源代码、查看浏览器开发者工具的“网络”部分、或在页面加载完成后断网使用。</p><hr><div class="form-group"><label>密钥类型</label> <select v-model="keyType"><optgroup label="ECC"><option value="curve25519">Curve25519 (ed25519/cv25519)</option><option value="p256">NIST P-256</option><option value="p384">NIST P-384</option><option value="p521">NIST P-521</option><option value="brainpoolP256r1">Brainpool P-256</option><option value="brainpoolP384r1">Brainpool P-384</option><option value="brainpoolP512r1">Brainpool P-512</option></optgroup><optgroup label="RSA"><option value="2048">2048 bits</option><option value="3072">3072 bits</option><option value="4096">4096 bits</option></optgroup></select></div><div class="form-group"><label>用户 ID</label><div class="grid"><input type="text" v-model="userIDInput.name" placeholder="Dummy" @keypress.enter="addUserID"> <input type="email" v-model="userIDInput.email" placeholder="[email protected]" @keypress.enter="addUserID"></div></div><p>可以按 <kbd>Enter</kbd> 添加更多的用户 ID。</p><ul><li v-for="e, i in userID">{{ e.name }} &lt;{{ e.email }}> <span @click="userID.splice(i, 1)" style="color:var(--error-color);cursor:pointer">[x]</span></li></ul><div class="form-group"><label>并行设定(线程数/迭代数)</label><div class="grid"><input type="number" v-model="thread" min="1"> <input type="number" v-model="iteration" min="1"></div></div><p>根据 GPU 性能和占用率调节这两个值。</p><p>你会得到一个生效时间距离现在 {{ (backTime > 2592000) ? `${Math.ceil(backTime / 2592000)} 个月` : `${Math.ceil(backTime / 86400)} 天` }}之内(最早为 <code>{{ (new Date(Date.now() - backTime * 1000)).toISOString() }}</code>)的密钥。</p><div class="form-group"><label>密钥指纹格式</label> <input type="text" v-model="pattern" style="font-variant-ligatures:none" required> <input type="checkbox" v-model="vanitySubkey">将格式应用到子密钥而不是主密钥上</div><p>40 个十六进制数字,不区分大小写。空格会被忽略,<code>X</code> 表示只要这些位相同即可,其他 <code>[\dA-FX]</code> 以外的字符表示对该位数字没有要求。</p><p>最后 <input type="number" v-model="patternLength" style="width:3em;padding:unset;text-align:center" max="40" min="1"> 个数字为 <input type="text" v-model="patternNumber" style="width:1em;padding:unset;text-align:center" pattern="[\dA-Fa-fXx]"> <a @click="patternHelper">快速设置</a></p><p>预计需要计算 {{ estimatedHashCount }} 次 hash,实际的计算次数可能是这个值的几分之一或几倍,也许需要一点运气……</p><details style="margin-bottom:var(--global-line-height)"><summary>把不同密钥的“靓号”合并到一起!</summary><div class="grid desktop-only"><div class="terminal-card" style="margin-bottom:var(--global-line-height)"><header>私钥 A</header><textarea rows="10" style="border:none" v-model="subkeyCombinerArmoredA"></textarea></div><div class="terminal-card" style="margin-bottom:var(--global-line-height)"><header>私钥 B</header><textarea rows="10" style="border:none" v-model="subkeyCombinerArmoredB"></textarea></div></div><p>如果你希望生成主密钥和子密钥都是“靓号”的密钥,可以先分别生成两个不同的密钥,然后在这里合并。</p><p>私钥 B 的主密钥和子密钥将作为子密钥被附加到私钥 A 上。</p><p>然后,请自行使用 <code>gpg --edit-key</code> 编辑私钥,例如删除不需要的子密钥 <code>delkey</code>、修改密钥用途 <code>change-usage</code> 和有效期 <code>expire</code> 等,再输入 <code>save</code> 保存更改。</p><button @click="subkeyCombine" class="btn btn-ghost btn-primary btn-block">保存合并后的私钥</button></details><div class="form-group"><input type="checkbox" v-model="notification.sfx">算号成功后播放提示音<br><input type="checkbox" v-model="notification.ntfy">算号成功后使用 <a href="https://ntfy.sh/app">ntfy</a> 发送通知 <input type="text" v-model="notification.ntfyTopic" style="width:unset;padding:unset" pattern="[\-_A-Za-z\d]{1,64}" placeholder="主题名称"><br><input type="checkbox" v-model="nonstopMode">不间断算号</div><button @click="toggleKeygen" :class="['btn', 'btn-block', running ? 'btn-error' : 'btn-primary']">{{ running ? '停止算号' : '开始算号' }}</button><hr><blockquote><p>已计算 hash:{{ hashCount }} {{ `(${Number(BigInt(hashCount) * 100n / estimatedHashCount) / 100}x estimated)` }}<br>耗时:{{ Math.round(runningTime / 1000 * 100) / 100 }}s<br>速度:{{ Math.round(hashCount / runningTime * 1000 * 100) / 100 || 0 }} hash/s</p></blockquote><details style="margin-bottom:var(--global-line-height)"><summary>生成的密钥</summary><ul><li v-for="e, i in generatedKeyHistory" style="cursor:pointer"><a @click="generatedKey = e"><code>{{ formatFingerprint(e.publicKey.getFingerprint().substring(24, 40)) }}</code> {{ `(${[e.publicKey, ...e.publicKey.subkeys].map(t => {const a = t.getAlgorithmInfo(); return a.bits ? `rsa${a.bits}` : a.curve}).join(', ')})` }} {{ e.publicKey.getCreationTime().toISOString() }}</a> <span @click="generatedKeyHistory.splice(i, 1)" style="color:var(--error-color);cursor:pointer">[x]</span></li></ul><p><span @click="bulkDownload" style="color:var(--primary-color);cursor:pointer">[批量下载私钥]</span> <span @click="generatedKeyHistory.length = 0" style="color:var(--error-color);cursor:pointer">[清除生成记录]</span></p></details><div class="grid desktop-only"><div class="terminal-card" style="margin-bottom:var(--global-line-height)"><header>私钥</header><textarea rows="10" style="border:none" :value="generatedKey?.privateKey.armor() || ''" readonly></textarea></div><div class="terminal-card" style="margin-bottom:var(--global-line-height)"><header>公钥</header><textarea rows="10" style="border:none" :value="generatedKey?.publicKey.armor() || ''" readonly></textarea></div></div><p>生效时间:<code>{{ generatedKey?.publicKey.getCreationTime().toISOString() || '****-**-**T**:**:**.***Z' }}</code></p><p>指纹(主密钥和子密钥):</p><ul><li v-for="e in (generatedKey ? [generatedKey.publicKey, ...generatedKey.publicKey.subkeys].map(e => e.getFingerprint()) : ['*'.repeat(40), '*'.repeat(40)])"><code>{{ formatFingerprint(e) }}</code></li></ul><div class="grid"><a :download="generatedKey ? `${generatedKey.privateKey.getFingerprint().toUpperCase()}-sec.asc` : 'nothing'" :href="`data:text/plain;charset=utf-8,${encodeURIComponent(generatedKey?.privateKey.armor() || '')}`" class="btn btn-ghost btn-primary">保存私钥</a> <a :download="generatedKey ? `${generatedKey.publicKey.getFingerprint().toUpperCase()}-pub.asc` : 'nothing'" :href="`data:text/plain;charset=utf-8,${encodeURIComponent(generatedKey?.publicKey.armor() || '')}`" class="btn btn-ghost btn-primary">保存公钥</a></div><hr><footer style="text-align:center"><p><small>© 2024 ✨小透明・宸✨ <a href="https://github.com/TransparentLC/webgl-vanity-gpg">源代码</a></small></p></footer></main></body></html>
<!doctype html><html lang="zh-Hans"><head><meta charset="utf-8"><link href="./vite.svg" rel="icon" type="image/svg+xml"><meta content="TransparentLC" name="author"><meta content="width=device-width,initial-scale=1" name="viewport"><title>webgl-vanity-gpg</title><style>[v-scope]{display:none}body{--fonts:ui-monospace,Menlo,Monaco,"Cascadia Code","Segoe UI Mono","Roboto Mono","Oxygen Mono","Ubuntu Monospace","Source Code Pro","Fira Mono","Droid Sans Mono",Consolas;--font-stack:var(--fonts),sans-serif;--mono-font-stack:var(--fonts),monospace;--global-font-size:16px}body code{padding:0 .25em}body code::after,body code::before{content:none}.grid{display:grid;grid-template-rows:auto;grid-gap:1em;grid-template-columns:repeat(auto-fit,minmax(calc(var(--page-width)/ 12),1fr))}@media (max-width:800px){.grid.desktop-only{display:unset}}</style><script crossorigin src="./assets/index-B8A58fJZ.js" type="module"></script><link href="./assets/index-B5bb1FGs.css" rel="stylesheet" crossorigin></head><body @vue:mounted="mounted" class="container" v-scope><header class="terminal-nav" style="display:flex;justify-content:right;align-items:center;flex-direction:row"><div class="terminal-logo"><div class="logo terminal-prompt">webgl-vanity-gpg</div></div><div style="flex-grow:1"></div><a href="https://github.com/TransparentLC/webgl-vanity-gpg" style="display:flex;background:0 0"><img src="https://img.shields.io/github/stars/TransparentLC/webgl-vanity-gpg?style=social"></a></header><main><p>使用 GPU(WebGL)快速生成带有“靓号”的 PGP 密钥!</p><p>“靓号”指的是带有连号等特定格式的密钥指纹或 ID(例如以 <code>77777777</code> 结尾),具体介绍和生成原理请参见:</p><ul><li><a href="https://www.douban.com/note/763978955/">一位 PGP 进步青年的科学算号实践</a></li><li><a href="https://blog.dejavu.moe/posts/the-scientific-vanity-pgp-counting-guide/">某科学的 PGP 算号指南</a></li></ul><p>密钥使用 <a href="https://openpgpjs.org/">OpenPGP.js</a> 在浏览器中生成,不会发送到其他地方。如果仍然担心这一点,可以检查源代码、查看浏览器开发者工具的“网络”部分、或在页面加载完成后断网使用。</p><hr><div class="form-group"><label>密钥类型</label> <select v-model="keyType"><optgroup label="ECC"><option value="curve25519">Curve25519 (ed25519/cv25519)</option><option value="p256">NIST P-256</option><option value="p384">NIST P-384</option><option value="p521">NIST P-521</option><option value="brainpoolP256r1">Brainpool P-256</option><option value="brainpoolP384r1">Brainpool P-384</option><option value="brainpoolP512r1">Brainpool P-512</option></optgroup><optgroup label="RSA"><option value="2048">2048 bits</option><option value="3072">3072 bits</option><option value="4096">4096 bits</option></optgroup></select></div><div class="form-group"><label>用户 ID</label><div class="grid"><input type="text" v-model="userIDInput.name" placeholder="Dummy" @keypress.enter="addUserID"> <input type="email" v-model="userIDInput.email" placeholder="[email protected]" @keypress.enter="addUserID"></div></div><p>可以按 <kbd>Enter</kbd> 添加更多的用户 ID。</p><ul><li v-for="e, i in userID">{{ e.name }} &lt;{{ e.email }}> <span @click="userID.splice(i, 1)" style="color:var(--error-color);cursor:pointer">[x]</span></li></ul><div class="form-group"><label>并行设定(线程数/迭代数)</label><div class="grid"><input type="number" v-model="thread" min="1"> <input type="number" v-model="iteration" min="1"></div></div><p>根据 GPU 性能和占用率调节这两个值。</p><p>你会得到一个生效时间距离现在 {{ (backTime > 2592000) ? `${Math.ceil(backTime / 2592000)} 个月` : `${Math.ceil(backTime / 86400)} 天` }}之内(最早为 <code>{{ (new Date(Date.now() - backTime * 1000)).toISOString() }}</code>)的密钥。</p><div class="form-group"><label>密钥指纹格式</label> <input type="text" v-model="pattern" style="font-variant-ligatures:none" required> <input type="checkbox" v-model="vanitySubkey">将格式应用到子密钥而不是主密钥上</div><p>40 个十六进制数字,不区分大小写。空格会被忽略,<code>X</code> 表示只要这些位相同即可,其他 <code>[\dA-FX]</code> 以外的字符表示对该位数字没有要求。</p><p>最后 <input type="number" v-model="patternLength" style="width:3em;padding:unset;text-align:center" max="40" min="1"> 个数字为 <input type="text" v-model="patternNumber" style="width:1em;padding:unset;text-align:center" pattern="[\dA-Fa-fXx]"> <a @click="patternHelper">快速设置</a></p><p>预计需要计算 {{ estimatedHashCount }} 次 hash,实际的计算次数可能是这个值的几分之一或几倍,也许需要一点运气……</p><details style="margin-bottom:var(--global-line-height)"><summary>把不同密钥的“靓号”合并到一起!</summary><div class="grid desktop-only"><div class="terminal-card" style="margin-bottom:var(--global-line-height)"><header>私钥 A</header><textarea rows="10" style="border:none" v-model="subkeyCombinerArmoredA"></textarea></div><div class="terminal-card" style="margin-bottom:var(--global-line-height)"><header>私钥 B</header><textarea rows="10" style="border:none" v-model="subkeyCombinerArmoredB"></textarea></div></div><p>如果你希望生成主密钥和子密钥都是“靓号”的密钥,可以先分别生成两个不同的密钥,然后在这里合并。</p><p>私钥 B 的主密钥和子密钥将作为子密钥被附加到私钥 A 上。</p><p>然后,请自行使用 <code>gpg --edit-key</code> 编辑私钥,例如删除不需要的子密钥 <code>delkey</code>、修改密钥用途 <code>change-usage</code> 和有效期 <code>expire</code> 等,再输入 <code>save</code> 保存更改。</p><button @click="subkeyCombine" class="btn btn-ghost btn-primary btn-block">保存合并后的私钥</button></details><div class="form-group"><input type="checkbox" v-model="notification.sfx">算号成功后播放提示音<br><input type="checkbox" v-model="notification.ntfy">算号成功后使用 <a href="https://ntfy.sh/app">ntfy</a> 发送通知 <input type="text" v-model="notification.ntfyTopic" style="width:unset;padding:unset" pattern="[\-_A-Za-z\d]{1,64}" placeholder="主题名称"><br><input type="checkbox" v-model="nonstopMode">不间断算号</div><button @click="toggleKeygen" :class="['btn', 'btn-block', running ? 'btn-error' : 'btn-primary']">{{ running ? '停止算号' : '开始算号' }}</button><hr><blockquote><p>已计算 hash:{{ hashCount }} {{ `(${Number(BigInt(hashCount) * 100n / estimatedHashCount) / 100}x estimated)` }}<br>耗时:{{ Math.round(runningTime / 1000 * 100) / 100 }}s<br>速度:{{ Math.round(hashCount / runningTime * 1000 * 100) / 100 || 0 }} hash/s</p></blockquote><details style="margin-bottom:var(--global-line-height)"><summary>生成的密钥(已生成 {{ generatedKeyHistory.length }} 个)</summary><ul><li v-for="e, i in generatedKeyHistory" style="cursor:pointer"><a @click="generatedKey = e"><code>{{ formatFingerprint(e.publicKey.getFingerprint().substring(24, 40)) }}</code> {{ `(${[e.publicKey, ...e.publicKey.subkeys].map(t => {const a = t.getAlgorithmInfo(); return a.bits ? `rsa${a.bits}` : a.curve}).join(', ')})` }} {{ e.publicKey.getCreationTime().toISOString() }}</a> <span @click="generatedKeyHistory.splice(i, 1)" style="color:var(--error-color);cursor:pointer">[x]</span></li></ul><p><span @click="bulkDownload" style="color:var(--primary-color);cursor:pointer">[批量保存私钥]</span> <span @click="generatedKeyHistory.length = 0" style="color:var(--error-color);cursor:pointer">[清除生成记录]</span></p></details><div class="grid desktop-only"><div class="terminal-card" style="margin-bottom:var(--global-line-height)"><header>私钥</header><textarea rows="10" style="border:none" :value="generatedKey?.privateKey.armor() || ''" readonly></textarea></div><div class="terminal-card" style="margin-bottom:var(--global-line-height)"><header>公钥</header><textarea rows="10" style="border:none" :value="generatedKey?.publicKey.armor() || ''" readonly></textarea></div></div><p>生效时间:<code>{{ generatedKey?.publicKey.getCreationTime().toISOString() || '****-**-**T**:**:**.***Z' }}</code></p><p>指纹(主密钥和子密钥):</p><ul><li v-for="e in (generatedKey ? [generatedKey.publicKey, ...generatedKey.publicKey.subkeys].map(e => e.getFingerprint()) : ['*'.repeat(40), '*'.repeat(40)])"><code>{{ formatFingerprint(e) }}</code></li></ul><div class="grid"><a :download="generatedKey ? `${generatedKey.privateKey.getFingerprint().toUpperCase()}-sec.asc` : 'nothing'" :href="`data:text/plain;charset=utf-8,${encodeURIComponent(generatedKey?.privateKey.armor() || '')}`" class="btn btn-ghost btn-primary">保存私钥</a> <a :download="generatedKey ? `${generatedKey.publicKey.getFingerprint().toUpperCase()}-pub.asc` : 'nothing'" :href="`data:text/plain;charset=utf-8,${encodeURIComponent(generatedKey?.publicKey.armor() || '')}`" class="btn btn-ghost btn-primary">保存公钥</a></div><hr><footer style="text-align:center"><p><small>© 2024 ✨小透明・宸✨ <a href="https://github.com/TransparentLC/webgl-vanity-gpg">源代码</a></small></p></footer></main></body></html>

0 comments on commit 909f998

Please sign in to comment.