Skip to content

Commit

Permalink
deploy: 61ccf51
Browse files Browse the repository at this point in the history
  • Loading branch information
TransparentLC committed Jul 15, 2024
1 parent 87aaf49 commit 41d38c0
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:"Cascadia Code","Consolas","Menlo","Monaco","Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New";--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-CG0IAS0V.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</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" @keypress.enter="addUserID" placeholder="Dummy"> <input type="email" v-model="userIDInput.email" @keypress.enter="addUserID" placeholder="[email protected]"></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><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><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><div class="form-group"><label>密钥指纹格式</label> <input type="text" v-model="pattern" style="font-variant-ligatures:none" required><p>40 个十六进制数字,不区分大小写。空格会被忽略,其他 <code>[\dA-F]</code> 以外的字符表示对该位数字没有要求。</p><p>最后 <input type="number" v-model="patternLength" min="1" max="80" style="width:3em;padding:unset;text-align:center"> 个数字为 <input type="text" v-model="patternNumber" style="width:1em;padding:unset;text-align:center" pattern="[\dA-Fa-f]"> <a @click="patternHelper">快速设置</a></p><p>预计需要计算 {{ estimatedHashCount }} 次 hash,实际的计算次数可能是这个值的几分之一或几倍。</p></div><button :class="['btn', 'btn-block', running ? 'btn-error' : 'btn-primary']" @click="toggleKeygen">{{ running ? '停止算号' : '开始算号' }}</button><hr><blockquote><p>已计算 hash:{{ hashCount }}<br>耗时:{{ Math.round(runningTime / 1000 * 100) / 100 }}s<br>速度:{{ Math.round(hashCount / runningTime * 1000 * 100) / 100 || 0 }} hash/s</p></blockquote><div class="grid desktop-only"><div class="terminal-card" style="margin-bottom:var(--global-line-height)"><header>私钥</header><textarea :value="generatedKey?.privateKey.armor() || ''" rows="10" style="border:none"></textarea></div><div class="terminal-card" style="margin-bottom:var(--global-line-height)"><header>公钥</header><textarea :value="generatedKey?.publicKey.armor() || ''" rows="10" style="border:none"></textarea></div></div><p>生效时间:<code>{{ generatedKey?.publicKey.getCreationTime().toISOString() || '****-**-**T**:**:**.***Z' }}</code></p><p>指纹:<code>{{ (generatedKey?.publicKey.getFingerprint().toUpperCase() || '*'.repeat(40)).match(/[^]{1,4}/g).join(' ') }}</code></p><div class="grid"><a :download="generatedKey ? `${generatedKey.privateKey.getFingerprint().toUpperCase()}-sec.asc` : false" :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` : false" :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:"Cascadia Code","Consolas","Menlo","Monaco","Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New";--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-CG0IAS0V.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</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" @keypress.enter="addUserID" placeholder="Dummy"> <input type="email" v-model="userIDInput.email" @keypress.enter="addUserID" placeholder="[email protected]"></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><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><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><div class="form-group"><label>密钥指纹格式</label> <input type="text" v-model="pattern" style="font-variant-ligatures:none" required><p>40 个十六进制数字,不区分大小写。空格会被忽略,其他 <code>[\dA-F]</code> 以外的字符表示对该位数字没有要求。</p><p>最后 <input type="number" v-model="patternLength" min="1" max="40" style="width:3em;padding:unset;text-align:center"> 个数字为 <input type="text" v-model="patternNumber" style="width:1em;padding:unset;text-align:center" pattern="[\dA-Fa-f]"> <a @click="patternHelper">快速设置</a></p><p>预计需要计算 {{ estimatedHashCount }} 次 hash,实际的计算次数可能是这个值的几分之一或几倍。</p></div><button :class="['btn', 'btn-block', running ? 'btn-error' : 'btn-primary']" @click="toggleKeygen">{{ running ? '停止算号' : '开始算号' }}</button><hr><blockquote><p>已计算 hash:{{ hashCount }}<br>耗时:{{ Math.round(runningTime / 1000 * 100) / 100 }}s<br>速度:{{ Math.round(hashCount / runningTime * 1000 * 100) / 100 || 0 }} hash/s</p></blockquote><div class="grid desktop-only"><div class="terminal-card" style="margin-bottom:var(--global-line-height)"><header>私钥</header><textarea :value="generatedKey?.privateKey.armor() || ''" rows="10" style="border:none"></textarea></div><div class="terminal-card" style="margin-bottom:var(--global-line-height)"><header>公钥</header><textarea :value="generatedKey?.publicKey.armor() || ''" rows="10" style="border:none"></textarea></div></div><p>生效时间:<code>{{ generatedKey?.publicKey.getCreationTime().toISOString() || '****-**-**T**:**:**.***Z' }}</code></p><p>指纹:<code>{{ (generatedKey?.publicKey.getFingerprint().toUpperCase() || '*'.repeat(40)).match(/[^]{1,4}/g).join(' ') }}</code></p><div class="grid"><a :download="generatedKey ? `${generatedKey.privateKey.getFingerprint().toUpperCase()}-sec.asc` : false" :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` : false" :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 41d38c0

Please sign in to comment.