A Fingerprint Pressed Into Every Packet
The envelope from the fountain pen customer sat on my desk for twenty minutes before I opened it. Burgundy wax, crisp impression, crossed nibs in the die. I kept running my thumb over the seal, feeling the texture, thinking about what it actually does — not decoration, not even signature in the modern sense. A wax seal answers a question: has this been tampered with?
Networking protocols ask the same thing constantly. Every Ethernet frame, every Zip file, every PNG image carries a small mathematical fingerprint calculated from its contents. Break the seal — change even one bit — and the numbers stop matching.
The CRC (cyclic redundancy check) treats your data as one enormous binary number, then divides it by a fixed polynomial. The remainder becomes the check value. What makes this clever is that polynomial division in binary uses XOR instead of subtraction, which means no carries, no borrows — just a shift register clocking bits through.
CRC-16-CCITT uses the polynomial x¹⁶ + x¹² + x⁵ + 1, which in hex is 0x1021. Here’s the bit-by-bit calculation:
crc16_ccitt <- function(data) {
crc <- 0xFFFF
poly <- 0x1021
for (byte in data) {
crc <- bitwXor(crc, bitwShiftL(byte, 8))
for (i in 1:8) {
if (bitwAnd(crc, 0x8000) != 0) {
crc <- bitwXor(bitwShiftL(crc, 1), poly)
} else {
crc <- bitwShiftL(crc, 1)
}
crc <- bitwAnd(crc, 0xFFFF)
}
}
crc
}
message <- utf8ToInt("SEALED")
sprintf("CRC-16: 0x%04X", crc16_ccitt(message))
[1] "CRC-16: 0x08C6"
The Pascal version shows the same algorithm — appropriate, since Turbo Pascal was how many of us first encountered these checks in the MS-DOS era:
program CRC16Demo;
var
data: string;
crc: Word;
i, j: Integer;
begin
data := 'SEALED';
crc := $FFFF;
for i := 1 to Length(data) do begin
crc := crc xor (Ord(data[i]) shl 8);
for j := 1 to 8 do
if (crc and $8000) <> 0 then
crc := (crc shl 1) xor $1021
else
crc := crc shl 1;
end;
WriteLn('CRC-16: $', HexStr(crc and $FFFF, 4));
end.
CRC catches most transmission errors — single-bit flips, burst errors, transposed bytes. It won’t catch deliberate tampering by someone who recalculates the check value, but neither will a wax seal stop someone with a matching die. Both systems assume a certain threat model: accidents, not adversaries.
The polynomial division happens to be reversible in interesting ways. Hardware implementations use linear feedback shift registers that can run the calculation backwards, which is how some protocols verify integrity without buffering the entire message first.
I pressed my third seal tonight — dark green, a geometric pattern I’m not yet skilled enough to centre properly. The impression came out slightly rotated, the wax too cool by the time I committed. But you can still read the pattern. You’d still know if someone broke it and tried to re-seal with different wax. That’s the whole point: not perfection, just evidence.