<!DOCTYPE html>
<html lang="zh-Hant">
<head>
<meta charset="UTF-8">
<title>Tor Traditional Chinese Signature</title>
<style>
body { font-family: "PingFang TC", "Microsoft JhengHei", sans-serif; background: #0f1218; color: #d1d5db; display: flex; align-items: center; justify-content: center; height: 100vh; margin: 0; }
.card { background: #1a1d23; padding: 40px; border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,0.6); text-align: center; border: 1px solid #2d333b; width: 450px; }
.label { font-size: 11px; color: #6b7280; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 2px; }
input { background: #0f1218; border: 1px solid #374151; color: #5eead4; padding: 14px; width: 100%; border-radius: 8px; margin-bottom: 25px; font-size: 14px; box-sizing: border-box; transition: 0.3s; }
input:focus { border-color: #5eead4; outline: none; box-shadow: 0 0 10px rgba(94, 234, 212, 0.2); }
button { background: #0d9488; color: white; border: none; padding: 12px 30px; border-radius: 8px; cursor: pointer; font-size: 16px; font-weight: 600; width: 100%; transition: background 0.2s; }
button:hover { background: #14b8a6; }
#result { margin-top: 40px; font-size: 72px; color: #ffffff; text-shadow: 0 0 20px rgba(255, 255, 255, 0.1); display: flex; justify-content: space-around; }
.char-unit { border-bottom: 2px solid #374151; padding: 10px; min-width: 80px; }
</style>
</head>
<body>
<div class="card">
<div class="label">Onion Address</div>
<input type="text" id="onionInput" placeholder="Enter .onion address" value="v2k7uo66p647x5q8.onion">
<button onclick="generateTraditionalSignature()">Generate Signature</button>
<div id="result">
<div class="char-unit">?</div>
<div class="char-unit">?</div>
<div class="char-unit">?</div>
</div>
</div>
<script>
// Traditional Chinese pool from the Thousand Character Classic (subset)
const tradPool = "天地玄黃宇宙洪荒日月盈昃辰宿列張寒來暑往秋收冬藏閏餘成歲律呂調陽雲騰致雨露結為霜金生麗水玉出崑岡劍號巨闕珠稱夜光果珍李碄菜重芥薑海鹹河淡鱗潛羽翔龍師火帝鳥官人皇始制文字乃服衣裳推位讓國有虞陶唐弔民伐罪周發殷湯坐朝問道垂拱平章愛育黎首臣伏戎羌遐邇一體率賓歸王鳴鳳在竹白駒食場化被草木賴及萬方蓋此身髮四大五常恭惟鞠養豈敢毀傷女慕貞潔男效才良知過必改得能莫忘罔談彼短靡恃己長信使可覆器欲難量墨悲絲染詩讚羔羊".split('');
async function generateTraditionalSignature() {
const input = document.getElementById('onionInput').value.toLowerCase().trim();
if (!input) return;
// Hash the input to get 256 bits of entropy
const msgUint8 = new TextEncoder().encode(input);
const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8);
const hashArray = Array.from(new Uint8Array(hashBuffer));
// Map the hash bytes to indices in our traditional character pool
const results = [
(hashArray[0] << 8 | hashArray[1]) % tradPool.length,
(hashArray[2] << 8 | hashArray[3]) % tradPool.length,
(hashArray[4] << 8 | hashArray[5]) % tradPool.length
];
const display = document.getElementById('result');
display.innerHTML = results.map(idx => `<div class="char-unit">${tradPool[idx]}</div>`).join('');
}
</script>
</body>
</html>
|