Internet checksum algorithm (RFC 1071) used in IPv4, TCP, UDP protocols. Uses 16-bit oneβs complement arithmetic for network packet header integrity verification.
| Property | Value |
|---|---|
| Category | Checksums |
| Sub-category | Network Protocol Checksum |
| Security status | π Educational Only |
| Complexity | Intermediate |
| Inventor | Internet Engineering Task Force (IETF) |
| Year | 1988 |
| Origin | πΊπΈ United States |
| Source | algorithms/checksum/internet-checksum.js |
Status: π Educational Only
| Issue | Description | Mitigation |
|---|---|---|
| Not Cryptographically Secure | Designed for error detection only, not security - can be easily forged | β |
| Collision Prone | 16-bit checksum provides limited collision resistance | β |
| No Protection Against Reordering | Cannot detect packet reordering or replay attacks | β |
4 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 β Empty data
Source: RFC 1071 - empty data gives all 1s checksum
| Field | Value |
|---|---|
input |
(empty) |
expected |
ffff |
Vector 2 β IPv4 header example
Source: RFC 1071 style IPv4 header checksum
| Field | Value |
|---|---|
input |
4500003044224000800600008c7053548c70545f |
expected |
f611 |
Vector 3 β Sequential bytes 1-4
Source: Educational test vector
| Field | Value |
|---|---|
input |
0001000200030004 |
expected |
fff5 |
Vector 4 β Partial IPv4 header
Source: Educational test vector
| Field | Value |
|---|---|
input |
45000020000040004006 |
expected |
3ad9 |