{
  "tool": "msc-software--cybersecurity.birthday_collision",
  "name": "Birthday-bound collision probability (CDU-ICT-SEC-900)",
  "answers": "Among this many hashed items, how likely is at least one collision, and at what count does it reach 50%?",
  "degree": {
    "id": "competency:msc-software--cybersecurity",
    "code": "CDU-ICT-SEC-900",
    "name": "MSc Software & Cybersecurity",
    "version": "1.0.0"
  },
  "reference": "The birthday bound; NIST SP 800-107 Rev. 1 §4.1 — collision resistance of an L-bit hash is at most L/2 bits",
  "endpoint": "/faculty/msc-software--cybersecurity/birthday_collision",
  "feeSt": 1,
  "inputSchema": {
    "type": "object",
    "required": [
      "pan",
      "hashBits",
      "items"
    ],
    "properties": {
      "pan": {
        "type": "string",
        "description": "The student PAN — the degree must be held in one of its five slots",
        "pattern": "^[0-9 ]{16,19}$"
      },
      "hashBits": {
        "type": "number",
        "description": "Output length in bits",
        "minimum": 8,
        "maximum": 1024
      },
      "items": {
        "type": "number",
        "description": "Number of values hashed",
        "minimum": 2
      }
    },
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "collisionProbability",
      "itemsFor50Percent",
      "securityBits"
    ],
    "properties": {
      "collisionProbability": {
        "type": "number",
        "description": "1 − exp(−n(n−1) ÷ 2^(b+1))"
      },
      "itemsFor50Percent": {
        "type": "number",
        "description": "√(2·ln 2·2^b)"
      },
      "securityBits": {
        "type": "number",
        "description": "b ÷ 2"
      }
    },
    "additionalProperties": false
  },
  "example": {
    "hashBits": 64,
    "items": 1000000000
  }
}