diff --git a/app/hash-collision/page.tsx b/app/hash-collision/page.tsx new file mode 100644 index 00000000..a20de000 --- /dev/null +++ b/app/hash-collision/page.tsx @@ -0,0 +1,22 @@ +import type { Metadata } from "next"; +import HashCollisionFinder from "../../components/hash/HashCollisionFinder"; +import Navbar from "../../components/layout/Navbar"; +import Footer from "../../components/layout/footer"; + +export const metadata: Metadata = { + title: "Hash Collision Finder — Birthday Attack Simulator | CryptoViz", + description: + "Find hash collisions using the birthday attack method. Interactive educational tool demonstrating why hash function collision resistance matters for security.", +}; + +export default function HashCollisionPage() { + return ( +
+ 2^{stats.bitsOfSecurity} +
++ = {stats.spaceSize.toLocaleString()} values +
++ ~{stats.expected50Percent.toLocaleString()} +
++ ≈ √(π/2 × 2^n) attempts +
++ {attempts.toLocaleString()} +
++ {attempts > 0 ? `${((attempts / stats.expected50Percent) * 100).toFixed(0)}% of expected` : ""} +
++ ~{stats.expected99Percent.toLocaleString()} +
++ Near-certain collision +
+| # | +Input | +Hash (truncated) | +
|---|---|---|
| + {attempt.attemptNumber} + | ++ {attempt.input} + | ++ {attempt.hash} + | +
+ {collision.description} +
++ {collision.reference} +
++ Cryptanalysis Tool +
++ Find hash collisions using the Birthday Attack method. Demonstrates why collision resistance requires hash outputs at least twice the desired security level — and why MD5 and SHA-1 are no longer safe. +
++ Birthday Attack +
++ Finding two inputs with the same hash takes O(√N) attempts — not O(N). With only 12 bits of hash, collisions appear in hundreds of tries, not millions. +
++ {item.description} +
++ {item.reference} +
++ Two different inputs produce the same {bits}-bit hash +
++ Input 1 +
++ {result.input1} +
++ Hash: {result.hash1} +
++ Input 2 +
++ {result.input2} +
++ Hash: {result.hash2} +
++ Reached the attempt limit without finding a collision. + Try fewer bits or a weaker algorithm. +
++ {exp.content} +
+{item.desc}
+