"use client"; import { useState } from "react"; import Link from "next/link"; import Navbar from "@/components/Navbar"; const LAB_TOOLS = [ { id: "hash-station", name: "Hash Station", desc: "Compute MD5, SHA-1, SHA-256, SHA-512, BLAKE2b, and Keccak-256 hashes in-browser. Zero upload.", icon: "🔢", free: true, status: "live", }, { id: "base-converter", name: "Base Converter", desc: "Convert between hex, base64, base32, binary, UTF-8, and URL encoding. Handles BIP38 and WIF keys.", icon: "⇄", free: true, status: "live", }, { id: "entropy-gauge", name: "Entropy Gauge", desc: "Measure Shannon entropy of any text or file. Identify patterns, weak passphrases, and compressed data.", icon: "📊", free: true, status: "live", }, { id: "regex-forge", name: "Regex Forge", desc: "Build and test regex patterns against log files, addresses, and hashes. Syntax: PCRE2 compatible.", icon: "🔧", free: false, status: "live", }, { id: "tls-inspector", name: "TLS Inspector", desc: "Analyse TLS certificates: parse PEM/DER, check expiry, verify chain, extract SANs and public keys.", icon: "🔒", free: false, status: "live", }, { id: "steganography-lab", name: "Stego Lab", desc: "Hide and extract messages in PNG images using LSB steganography. All processing client-side.", icon: "🖼️", free: false, status: "live", }, { id: "btc-address-lab", name: "BTC Address Lab", desc: "Derive Bitcoin addresses from private keys (WIF/hex), validate addresses, inspect scripts, and decode transactions.", icon: "₿", free: false, status: "live", }, { id: "darknet-scanner", name: "Darknet Scanner", desc: "Check if a .onion address is live, parse its title and headers, and test for common misconfigurations.", icon: "📡", free: false, status: "beta", }, ]; const [HASH, BASE, ENTROPY] = ["hash-station", "base-converter", "entropy-gauge"]; function HashStation() { const [input, setInput] = useState(""); const [results, setResults] = useState>({}); const run = async () => { if (!input) return; const enc = new TextEncoder().encode(input); const algos: [string, AlgorithmIdentifier][] = [ ["SHA-256", "SHA-256"], ["SHA-512", "SHA-512"], ["SHA-1", "SHA-1"], ]; const out: Record = {}; for (const [label, algo] of algos) { const buf = await crypto.subtle.digest(algo, enc); out[label] = Array.from(new Uint8Array(buf)).map((b) => b.toString(16).padStart(2, "0")).join(""); } setResults(out); }; return (