+ {/* Header Banner */}
+
+
+
+
+ NIST Post-Quantum Cryptography (PQC) Inspector
+
+
+ Inspect quantum-resistant lattice & hash-based cryptography parameter metrics (FIPS 203, FIPS 204, FIPS 205).
+
+
+
+
+ { setSelectedAlgo(val); setKeyPair(null) }}>
+
+
+ {Object.entries(PQC_ALGORITHMS).map(([id, item]) => (
+
+ {item.name} ({item.standard})
+
+ ))}
+
+
+
+
+
+ {/* Spec Info Grid */}
+
+
+
Standard
+
{spec.standard}
+
+
+
Category
+
{spec.type}
+
+
+
Security Strength
+
{spec.securityLevel}
+
+
+
Public Key Size
+
{spec.pubKeyBytes} bytes
+
+
+
+ {/* Algorithm Characteristics */}
+
+
+
+ Algorithm Construction
+
+
{spec.claim}
+
+ Private Key: {spec.privKeyBytes} B
+ {spec.ctBytes && Ciphertext: {spec.ctBytes} B }
+ {spec.sigBytes && Signature: {spec.sigBytes} B }
+
+
+
+ {/* Key Generation Trigger */}
+
+
+ Generate Test {spec.name} Key Pair
+
+
+
+ {/* Key Pair Output */}
+ {keyPair && (
+
+
+
+
+ Public Key ({spec.pubKeyBytes} Bytes)
+
+ copyText(keyPair.publicKeyHex, 'pub')} className="h-7 text-xs text-amber-400">
+ {copiedKey === 'pub' ? : }
+ {copiedKey === 'pub' ? 'Copied' : 'Copy Public Key'}
+
+
+
+ {keyPair.publicKeyHex}
+
+
+
+
+
+
+ Private / Secret Key ({spec.privKeyBytes} Bytes)
+
+ copyText(keyPair.privateKeyHex, 'priv')} className="h-7 text-xs text-red-400">
+ {copiedKey === 'priv' ? : }
+ {copiedKey === 'priv' ? 'Copied' : 'Copy Secret Key'}
+
+
+
+ {keyPair.privateKeyHex}
+
+
+
+ {keyPair.ciphertextHex && (
+
+
Encapsulated Ciphertext ({spec.ctBytes} Bytes)
+
+ {keyPair.ciphertextHex}
+
+
+ )}
+
+ )}
+
+ {/* Info footer */}
+
+
+ PQC algorithms protect against future quantum computer decryption attacks (Shor's and Grover's algorithm resistance).
+
+
+ )
+}
diff --git a/components/tools/SqlTool.tsx b/components/tools/SqlTool.tsx
new file mode 100644
index 0000000..3dae337
--- /dev/null
+++ b/components/tools/SqlTool.tsx
@@ -0,0 +1,116 @@
+'use client'
+import React, { useState, useEffect } from 'react'
+import { Button } from '@/components/ui/button'
+import { Textarea } from '@/components/ui/textarea'
+import { Copy, Check, Database, Sparkles, Filter } from 'lucide-react'
+
+const SQL_KEYWORDS = [
+ 'SELECT', 'FROM', 'WHERE', 'AND', 'OR', 'INSERT', 'INTO', 'UPDATE', 'DELETE', 'VALUES',
+ 'JOIN', 'INNER JOIN', 'LEFT JOIN', 'RIGHT JOIN', 'ON', 'GROUP BY', 'ORDER BY', 'HAVING',
+ 'LIMIT', 'OFFSET', 'CREATE', 'TABLE', 'DROP', 'ALTER', 'INDEX', 'UNION', 'ALL', 'AS', 'CASE', 'WHEN', 'THEN', 'END'
+]
+
+function formatSql(sql: string): string {
+ let result = sql.trim()
+ if (!result) return ''
+
+ // Standardize keyword upper casing
+ SQL_KEYWORDS.forEach((kw) => {
+ const regex = new RegExp(`\\b${kw}\\b`, 'gi')
+ result = result.replace(regex, kw)
+ })
+
+ // Insert newlines before major query clauses
+ const clauseKeywords = ['SELECT', 'FROM', 'WHERE', 'GROUP BY', 'ORDER BY', 'HAVING', 'LIMIT', 'JOIN', 'LEFT JOIN', 'RIGHT JOIN', 'INNER JOIN']
+ clauseKeywords.forEach((kw) => {
+ const regex = new RegExp(`\\s+(${kw})\\s+`, 'g')
+ result = result.replace(regex, `\n$1 `)
+ })
+
+ return result
+}
+
+function minifySql(sql: string): string {
+ return sql
+ .replace(/--.*$/gm, '')
+ .replace(/\/\*[\s\S]*?\*\//g, '')
+ .replace(/\s+/g, ' ')
+ .trim()
+}
+
+function sanitizeSql(sql: string): string {
+ // Strips comment blocks and dangerous inline injection tokens
+ return sql
+ .replace(/--.*$/gm, '')
+ .replace(/\/\*[\s\S]*?\*\//g, '')
+ .replace(/;+/g, ';')
+ .trim()
+}
+
+export default function SqlTool() {
+ const [input, setInput] = useState(`SELECT u.id, u.username, count(o.id) as total_orders FROM users u LEFT JOIN orders o ON u.id = o.user_id WHERE u.status = 'active' GROUP BY u.id, u.username HAVING count(o.id) > 5 ORDER BY total_orders DESC LIMIT 10;`)
+ const [formatted, setFormatted] = useState('')
+ const [copied, setCopied] = useState(false)
+
+ useEffect(() => {
+ setFormatted(formatSql(input))
+ }, [input])
+
+ const handleFormat = () => setFormatted(formatSql(input))
+ const handleMinify = () => setFormatted(minifySql(input))
+ const handleSanitize = () => setFormatted(sanitizeSql(input))
+
+ const copyToClipboard = () => {
+ navigator.clipboard.writeText(formatted)
+ setCopied(true)
+ setTimeout(() => setCopied(false), 2000)
+ }
+
+ return (
+
+
+
+
+ SQL Query Input
+
+ setInput('')} className="text-xs text-zinc-500 hover:text-zinc-300">
+ Clear
+
+
+
+
+
+
+ Format & Beautify
+
+
+ Minify Single-Line
+
+
+ Strip Comments & Sanitize
+
+
+
+ {formatted && (
+
+
+ Processed SQL Result
+
+ {copied ? : }
+ {copied ? 'Copied' : 'Copy SQL'}
+
+
+
+ {formatted}
+
+
+ )}
+
+ )
+}
diff --git a/components/tools/ToolRenderer.tsx b/components/tools/ToolRenderer.tsx
index aba6e88..2aea12e 100644
--- a/components/tools/ToolRenderer.tsx
+++ b/components/tools/ToolRenderer.tsx
@@ -27,6 +27,11 @@ const RegexTool = dynamic(() => import('./RegexTool'), { ssr: false })
const LoremTool = dynamic(() => import('./LoremTool'), { ssr: false })
const CronTool = dynamic(() => import('./CronTool'), { ssr: false })
const IPTool = dynamic(() => import('./IPTool'), { ssr: false })
+const HmacTool = dynamic(() => import('./HmacTool'), { ssr: false })
+const PQCTool = dynamic(() => import('./PQCTool'), { ssr: false })
+const CurlTool = dynamic(() => import('./CurlTool'), { ssr: false })
+const ImageBase64Tool = dynamic(() => import('./ImageBase64Tool'), { ssr: false })
+const SqlTool = dynamic(() => import('./SqlTool'), { ssr: false })
const HASH_ALGORITHMS: Record