Code
The cryptography of computers: hashes, AES and HMAC, RSA’s weak keys, Diffie–Hellman, certificates, one-time passwords, Shor and Grover, ML-KEM, BB84, Shamir’s shares, time locks, passwords.
XOR & One-Time Pad
XORs a message with a key, text or hex; enciphers with a one-time pad; drags a guessed word along a ciphertext, or two ciphertexts' XOR, exposing a reused pad; and works a pad of figures by hand, as the GEE system's sheets were. Nothing typed is saved. Vernam patented the XOR teleprinter cipher (1919); Shannon (1949) proved a random pad as long as the message, used once, gives perfect secrecy.
Terms
History, how it works, how it was checked, limits
History
Gilbert Vernam patented the teleprinter cipher that combines message and key by exclusive or, US 1,310,719, granted on 22 July 1919. Claude Shannon (1949) proved that a random key as long as the message, used once, gives perfect secrecy. Used twice, the pad cancels in the two ciphertexts’ XOR, where a guessed word exposes both messages. By hand the pad was figures: the German Foreign Office added sheets of five-figure groups to its code groups without carrying (“The GEE System — I”, 1961).
How it works
XOR combines a message with a key, text or hex, byte by byte, a shorter key repeating, which it says. One-time pad enciphers a message with a pad, typed or drawn at random, or reads it back; a card shows a pad used twice on Unveil’s eye and name, each ciphertext noise and their XOR both. Crib drag XORs a guessed word with the hex at each position: on one ciphertext the key there, on two under one pad the other message, ranked by how it reads. By hand adds a pad’s groups to code groups digit by digit, the tens dropped, or subtracts them, each group stepped; letters may first be made figures by Military Cryptanalytics’ checkerboard, a joining no text read makes and the tab says is Unveil’s. Nothing is saved or shared.
How it was checked
Vernam brings a text with é and Hebrew back whole; bytes that are not text come out as hex; under two different pads two pictures’ ciphertexts XOR to the same; “Attack” crib-dragged on one ciphertext gives the key’s first six letters, on two under one pad the other message’s. Every message, key and pad field is inside [data-no-persist]. By hand reproduces the GEE article’s Fig. 3b, thirty code groups and thirty of additive to its thirty cipher groups, and back; Military Cryptanalytics’ trinomes 257, 831 and 662 and its Fig. 71’s E, T, N, G and Q.
The tests hold 29 checks of this tool; 8 rest on outside material:
- A print’s own example The GEE System — I (NSA Technical Journal, 1961), Fig. 3b: its 30 code groups plus its 30 additive groups without carrying are its 30 cipher groups, every digit as printed
- A print’s own example … and the additive subtracted without carrying from the cipher text gives the code text back (p. 11)
- A print’s own example … the text to be sent as Fig. 3b prints it, in lines of eight groups, is the cipher groups in order
- A print’s own example Military Cryptanalytics, Part I (1952), p. 110: the trinomes 257, 831 and 662, each third digit the non-carrying sum of the two before it
- A print’s own example Military Cryptanalytics, Part I (1952), p. 228, Fig. 71: E 0, T 1, N 8, G 74, Q 61 by the checkerboard, and a text read back from its figures
- A print’s own example The GEE System — I, Fig. 3c (p. 10): each sheet’s 48 groups between its own indicator, 8174 … 8174 6324 … 6324, and a group count after the last, three zeros and the groups since the last indicator (p. 11)
- A print’s own example The groups as sent read back as they stand, the indicators and the count set aside: Fig. 3b’s cipher text deciphered from its own framing
- A print’s own example Military Cryptanalytics, Part I (1952), p. 229, footnote 3: figures tripled between the asterisk, “HILL 865” as 75 2 77 77 66 888 666 555 66, and read back; an asterisk and a row-6 letter told from a tripled 6
Limits
A key shorter than the message repeats, which is no one-time pad; the tool says so but does not refuse. Its random pad is as good as the browser’s random source. Crib drag tries one word at a time and ranks short fragments by statistics made for longer text, so the right position is not always first; it neither finds a repeating key’s length nor breaks one without a crib. Nothing typed is saved, so a pad must be copied before leaving.
- G. S. Vernam, Secret Signaling System, US Patent 1,310,719 (granted 22 July 1919)
- C. E. Shannon, “Communication Theory of Secrecy Systems”, Bell System Technical Journal 28 (4), 1949, pp. 656–715
- “The GEE System — I”, NSA Technical Journal VI, No. 4 (1961), pp. 6–11, Figs. 3a and 3b; approved for release 2008
- W. F. Friedman and L. D. Callimahos, Military Cryptanalytics, Part I (NSA, 1952), pp. 110 and 228, Fig. 71