{
  "slug": "birthday-bound",
  "term": "Birthday bound",
  "aliases": [
    "Birthday collision bound"
  ],
  "definition": "The birthday bound describes how the probability of any hash collision grows with the number of distinct inputs sharing an output space.",
  "note": "For n distinct inputs with independent uniform b-bit digests, the probability of at least one collision is 1 - product(1 - i/2^b), for i from 0 to n-1 and n <= 2^b. It is one when n exceeds the output-space size. The upper bound min(1, n(n-1)/(2*2^b)) follows by counting unordered pairs. The expression 1 - exp(-n(n-1)/(2*2^b)) is an approximation, not the exact product. [black2006]\n\nThis is not a measured storage failure rate. One specified pair, repeated comparisons against a fixed target, and all pairs in an archive are different events. The random-function model does not require random file contents, but it does assign independent outputs only to distinct inputs. Rehashing identical bytes adds no new distinct input. [black2006]\n\nHesela's exact four-input, two-bit example has 232 colliding assignments out of 256, giving 29/32. The downloadable code checks small spaces exhaustively and labels its large-population calculations as approximations. A billion distinct inputs with ideal 64-bit outputs give about 2.67410e-2 for any collision, not the one-pair value 2^-64. These are hypothetical arithmetic results, not cryptanalysis. [hesela-birthday]\n\nHistorical papers discussing SHA-1 are not current algorithm recommendations. Collision resistance and second-preimage resistance concern different attack goals; digest width alone does not establish a concrete function's security. [nist-hashes]",
  "status": "shipping",
  "advantages": [],
  "limitations": [
    {
      "text": "An all-pairs archive calculation is inappropriate for a system that compares only selected corresponding pairs; the comparison namespace and horizon must be specified.",
      "citationIds": [
        "black2006"
      ]
    },
    {
      "text": "Ideal random-output arithmetic does not account for chosen-input attacks, implementation errors, stale metadata or hardware faults.",
      "citationIds": [
        "black2006",
        "nist-hashes"
      ]
    }
  ],
  "related": [
    "hash-collision",
    "deduplication",
    "cryptographic-hash"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-20",
  "citations": [
    {
      "id": "black2006",
      "title": "J. Black. Compare-by-Hash: A Reasoned Analysis. USENIX ATC 2006, pp. 85-90; sections 2-3 and appendix A.",
      "url": "https://www.usenix.org/legacy/events/usenix06/tech/full_papers/black/black.pdf",
      "accessed": "2026-11-20"
    },
    {
      "id": "nist-hashes",
      "title": "NIST CSRC: Hash Functions, security strengths and SHA-1 transition.",
      "url": "https://csrc.nist.gov/projects/hash-functions",
      "accessed": "2026-11-20"
    },
    {
      "id": "hesela-birthday",
      "title": "Hesela: archive-wide collision populations, exact toy oracle and ideal-hash arithmetic.",
      "url": "https://hesela.com/analyses/deduplication-restore-fragmentation/#birthday-population",
      "accessed": "2026-11-20"
    }
  ],
  "provenance": [
    "Primary-source synthesis and original arithmetic, not a new theorem or an empirical collision sample.",
    "Reproducible model, tests, limitations and source metadata: https://hesela.dev/research/birthday/README.md"
  ]
}
