Beaufort cipher
View on WikipediaThis article needs more citations. (October 2009) |
The Beaufort cipher, created by Sir Francis Beaufort, is a substitution cipher similar to the Vigenère cipher, with a slightly modified enciphering mechanism and tableau.[1] Its most famous application was in a rotor-based cipher machine, the Hagelin M-209.[2] The Beaufort cipher is based on the Beaufort square which is essentially the same as a Vigenère square but in reverse order starting with the letter "Z" in the first row,[3] where the first row and the last column serve the same purpose.[4]
Using the cipher
[edit]
To encrypt, first choose the plaintext character from the top row of the tableau; call this column P. Secondly, travel down column P to the corresponding key letter K. Finally, move directly left from the key letter to the left edge of the tableau, the ciphertext encryption of plaintext P with key K will be there.
For example if encrypting plain text character "d" with key "m" the steps would be:
- find the column with "d" on the top,
- travel down that column to find key "m",
- travel to the left edge of the tableau to find the ciphertext letter ("K" in this case).
To decrypt, the process is reversed. Unlike the otherwise very similar Vigenère cipher, the Beaufort cipher is a reciprocal cipher, that is, decryption and encryption algorithms are the same. This obviously reduces errors in handling the table which makes it useful for encrypting larger volumes of messages by hand, for example in the manual DIANA crypto system, used by U.S. Special Forces during the Vietnam War (compare DIANA-table in the image).
In the above example in the column with "m" on top one would find in the reciprocal "d" row the ciphertext "K". The same is true for decryption where ciphertext "K" combined with key "m" results in plaintext "d" as well as combining "K" with "d" results in "m". This results in "trigram" combinations where two parts suffice to identify the third. After eliminating the identical trigrams only 126 of the initial 676 combinations remain (see below) and could be memorized in any order (e.g. AMN can be memorized as "man" and CIP as "pic") to speed up encoding and decoding.[5]
AAZ ABY ACX ADW AEV AFU AGT AHS AIR AJQ AKP ALO AMN
BBX BCW BDV BEU BFT BGS BHR BIQ BJP BKO BLN BMM BZZ
CCV CDU CET CFS CGR CHQ CIP CJO CKN CLM CYZ
DDT DES DFR DGQ DHP DIO DJN DKM DLL DXZ DYY
EER EFQ EGP EHO EIN EJM EKL EWZ EXY
FFP FGO FHN FIM FJL FKK FVZ FWY FXX
GGN GHM GIL GJK GUZ GVY GWX
HHL HIK HJJ HTZ HUY HVX HWW
IIJ ISZ ITY IUX IVW
JRZ JSY JTX JUW JVV
KQZ KRY KSX KTW KUV
LPZ LQY LRX LSW LTV LUU
MOZ MPY MQX MRW MSV MTU
NNZ NOY NPX NQW NRV NSU NTT
OOX OPW OQV ORU OST
PPV PQU PRT PSS
QQT QRS
RRR Algebraic description
[edit]The Beaufort cipher can be described algebraically. For example, using an encoding of the letters A–Z as the numbers 0–25 and using addition modulo 26, let be the characters of the message, be the characters of the cipher text and be the characters of the key, repeated if necessary. Then Beaufort encryption can be written,
- .
Similarly, decryption using the key ,
- .
Decrypting as a Vigenere cipher
[edit]Due to the similarities between the Beaufort cipher and the Vigenère cipher it is possible, after applying a transformation, to solve it as a Vigenère cipher. By replacing every letter in the ciphertext and key with its opposite letter (such that 'a' becomes 'z', 'b' becomes 'y' etc.; i.e. an Atbash-transformation) it can be solved like a Vigenère cipher.
Distinguished from 'variant Beaufort'
[edit]The Beaufort cipher should not be confused with the "variant Beaufort" cipher. In variant Beaufort, encryption is performed by performing the decryption step of the standard Vigenère cipher, and likewise decryption is performed by using Vigenère encryption.
References
[edit]- ^ Franksen, Ole Immanuel, Babbage and cryptography. Or, the mystery of Admiral Beaufort's cipher. Mathematics and Computers in Simulation 35 (1993) 327-367
- ^ Mollin, Richard A., An Introduction to Cryptography, page 100. Chapman & Hall/CRC, 2001
- ^ Jörg Rothe (2006). Complexity Theory and Cryptology: An Introduction to Cryptocomplexity. Springer Science & Business Media. p. 164. ISBN 9783540285205.
- ^ Arto Salomaa (2013). Public-Key Cryptography: Volume 23 of Monographs in Theoretical Computer Science. An EATCS Series. Springer Science & Business Media. p. 31. ISBN 9783662026274.
- ^ Rijmenants, Dirk. "One-time Pad". Cipher Machines and Cryptology. Retrieved 28 December 2020.
Beaufort cipher
View on GrokipediaHistory
Invention and inventor
Sir Francis Beaufort (1774–1857) was an Irish-born hydrographer and rear-admiral in the Royal Navy, best known for devising the Beaufort scale, a standardized system for estimating wind force at sea based on observed effects on land or water.[1] Throughout his career, Beaufort advanced naval science and administration, serving as Hydrographer of the Navy from 1829 until his retirement in 1855.[6] Beaufort demonstrated a longstanding interest in cryptography, employing simple substitution ciphers in his personal diaries and correspondence as early as the 1790s and 1830s, often for concealing sensitive military or private matters.[3] In his official capacity, he played a pivotal role in modernizing cryptographic practices for British naval intelligence, advising on secure communication methods during conflicts such as the Crimean War (1853–1856).[7] This background reflected the era's growing need for reliable encryption amid expanding naval operations and geopolitical tensions. Although attributed to Beaufort, the Beaufort cipher's reciprocal principles trace back to earlier descriptions, such as that by Italian mathematician Giovanni Sestri in 1710.[3] The cipher emerged from this context as a manual polyalphabetic substitution cipher, likely developed in the mid-19th century during his later career, though no precise invention date is documented.[1] Designed specifically for secure naval communications, it drew inspiration from earlier polyalphabetic systems like the Vigenère cipher while introducing a reciprocal mechanism to streamline operations in resource-limited field environments.[3] This innovation addressed the challenges of transmitting confidential orders and intelligence at sea, where speed and ease of use were essential for military efficacy.[6]Publication and adoption
An earlier version appeared in The Nautical Magazine in 1855, edited by Beaufort's assistant A.B. Becher.[8] The Beaufort cipher was published posthumously in 1857 as a small card titled Cryptography, A System of Secret Writing, featuring a reversed Vigenère table.[3] A version adapted for telegrams and half-penny postcards by Beaufort's son, William Morris Beaufort, was advertised in 1870.[4][3] It gained early adoption in British naval communications during the 19th century, introduced in the Royal Navy in 1857 for secure messaging, including telegraphic exchanges.[3][4] The cipher's reciprocal nature, allowing the same process for both encryption and decryption, facilitated its implementation in mechanical devices.[1] Notably, it formed the basis of the Hagelin M-209 rotor machine, a portable pin-and-lug device that adapted the Beaufort mechanism for generating keystreams via six cipher wheels.[9] The M-209 was widely used by U.S. forces for tactical encryption during World War II, the Korean War, and the Vietnam War.[10][9] In the M-209, trigram keys from precomputed lists set the pin and lug positions, reducing the vast possible combinations to 126 unique effective settings for operational efficiency in field use.[11] A manual variant appeared in the DIANA cryptosystem, employed by U.S. Special Forces during the Vietnam War for clandestine communications.[12]Description
The Beaufort tableau
The Beaufort tableau is a 26×26 grid that forms the foundational substitution mechanism for the Beaufort cipher, distinct from the standard Vigenère square due to its reversed structure enabling reciprocal encryption and decryption.[13] Rows are labeled in reverse alphabetical order from top to bottom, starting with Z and descending to A along the left side, while columns are labeled A through Z from left to right across the top. Each row begins with its label letter followed by the remaining alphabet in reverse order, with subsequent rows created by shifting the previous row's content one position to the left (cyclic shift), wrapping the displaced letter to the end. This results in the first row (Z) reading Z, Y, X, ..., B, A from left to right; the second row (Y) reading Y, X, W, ..., C, B, A, Z; and so on, until the final row (A) reading A, Z, Y, ..., C, B. The construction employs rotations of the reversed alphabet (ZYX...A) to ensure the tableau's self-inverse property, where applying the same key twice returns the original text.[13][14] This backward-shifting design produces a reversed Vigenère square tailored for subtraction-based substitution, contrasting with the forward shifts in the Vigenère tableau.[15] The purpose of the tableau is to facilitate polyalphabetic substitution, where the ciphertext letter is determined by locating the row corresponding to the key letter and the column corresponding to the plaintext letter, then reading the letter at their intersection.[13] For clarity, a partial representation of the tableau's top rows and left columns (using uppercase letters for all positions) illustrates the pattern:| Key \ Plain | A | B | C | ... | Z |
|---|---|---|---|---|---|
| Z | Z | Y | X | ... | A |
| Y | Y | X | W | ... | Z |
| X | X | W | V | ... | Y |
| ... | ... | ... | ... | ... | ... |
| A | A | Z | Y | ... | B |
Key and message preparation
In the Beaufort cipher, a keyword consisting of one or more letters is selected to serve as the basis for encryption. This keyword is repeated cyclically until its length matches that of the plaintext, generating a keystream that aligns positionally with each plaintext letter.[16][2] The length of the keyword, denoted as the period $ t $, determines the repetition cycle; for instance, a keyword of length 3 repeats every three positions.[16] The plaintext is prepared by converting it to uppercase letters and typically removing spaces, punctuation, and other non-alphabetic characters, which are either ignored during encryption or preserved separately in the output to maintain message integrity.[17] Only the 26 letters of the English alphabet (A-Z) are processed, with each assigned a numerical value from 0 (A) to 25 (Z) for substitution.[16] This preparation ensures a uniform input stream compatible with the cipher's tableau-based mechanism. A longer keyword enhances security by increasing the period and reducing detectable repetition patterns in the keystream, making frequency analysis more challenging compared to shorter keys.[18] For example, with plaintext "HELLO" and keyword "KEY", the keystream becomes "KEYKE", aligning as follows:| Plaintext | H | E | L | L | O |
|---|---|---|---|---|---|
| Keystream | K | E | Y | K | E |
Encryption procedure
The encryption procedure of the Beaufort cipher employs a 26×26 tabula recta tableau, with rows labeled Z through A from top to bottom and columns labeled A through Z from left to right, where each row represents a Caesar shift of the alphabet to facilitate polyalphabetic substitution based on the keyword.[19] Assuming the plaintext and repeating keyword are prepared and aligned letter by letter, the process for each position proceeds as follows:- Identify the column corresponding to the plaintext letter in the top row of the tableau.
- Traverse downward in that column until locating the cell containing the key letter .
- The ciphertext letter is the label of the row (in the leftmost column) where appears in the column.[2]
Decryption procedure
The Beaufort cipher possesses a reciprocal property, whereby the encryption and decryption processes are identical in their algorithmic steps, with the roles of plaintext and ciphertext simply swapped while using the same key.[2][20] This self-inverse characteristic means that applying the cipher operation twice with the same key returns the original text, distinguishing it from non-reciprocal polyalphabetic ciphers like the standard Vigenère.[20] To decrypt, the recipient repeats the key across the ciphertext to align corresponding letters, then applies the identical procedure as in encryption: for each pair of ciphertext letter and key letter , identify the column corresponding to , traverse downward until locating the cell containing , and take the row label as the plaintext letter . This yields , mirroring the encryption formula but with inputs reversed.[21] For example, given ciphertext letter "K" (, assuming A=0) and key letter "M" (), the tableau lookup reveals plaintext "C" ().[21] Similarly, in a longer message, ciphertext "CKMPV" with repeating key "FORTI..." produces plaintext "DEFEN...".[2] This reciprocity simplifies implementation in field operations, requiring cryptographers to memorize and apply only a single procedure along with the shared key, thereby reducing errors and training demands in practical cryptographic use.[2]Mathematical formulation
Algebraic representation
The Beaufort cipher employs modular arithmetic in the ring to model its operations, with letters of the alphabet encoded as integers from 0 to 25, where A maps to 0, B to 1, ..., and Z to 25.[16] Encryption for the -th position is defined by the equationRelationship to the Vigenère cipher
The Vigenère cipher is a classic polyalphabetic substitution cipher that encrypts plaintext by adding the numerical equivalent of the key letter to the plaintext letter modulo 26, expressed as $ C_i = (P_i + K_i) \mod 26 $, where letters are mapped to numbers from 0 (A) to 25 (Z). The Beaufort cipher modifies this mechanism by using subtraction instead, yielding $ C_i = (K_i - P_i) \mod 26 $, which introduces reciprocity such that the same operation serves for both encryption and decryption. This alteration by Sir Francis Beaufort transforms the Vigenère's additive structure to enable self-inverse encryption, a key feature for practical applications requiring symmetric processes.[13] The Beaufort cipher is mathematically equivalent to a transformed version of the Vigenère cipher involving the Atbash substitution, which reverses the alphabet (A ↔ Z, B ↔ Y, etc.), corresponding to the map $ x \mapsto 25 - x \mod 26 $.[23] Specifically, applying Atbash to the plaintext and then encrypting with the Vigenère cipher produces output equivalent to the Beaufort ciphertext (up to a consistent modular shift inherent in the tableau construction).[23] In group-theoretic terms, Beaufort keys are compositions of Vigenère rotations with the Atbash reversal permutation, $ b_n = z \circ R_n = R_{-n} \circ z $, where $ z $ is the reversal and $ R_n $ is rotation by $ n $, distinguishing it from the Vigenère's pure rotational subgroup isomorphic to $ \mathbb{Z}_{26} $.[13] For decryption, a Beaufort ciphertext can be processed by applying Atbash to both the ciphertext and the key, followed by standard Vigenère decryption (subtraction of the transformed key modulo 26), directly recovering the plaintext.[21] Alternatively, applying Atbash solely to the ciphertext and then performing Vigenère decryption yields a result that, when further transformed, aligns with the original plaintext, underscoring the ciphers' structural interplay.[23] This equivalence highlights how Beaufort extends Vigenère principles while prioritizing operational symmetry.[13]Variants and relations
The variant Beaufort cipher
The variant Beaufort cipher, also known as the Vigenère variant or simply the variant, employs a standard forward Vigenère tableau rather than the reversed alphabets used in the original Beaufort cipher.[24][25] In this setup, the tableau consists of 26 rows where each row begins with a successive letter of the alphabet (A to Z) and shifts forward, forming a grid for polyalphabetic substitution.[25] For encryption in the variant Beaufort, the process begins by locating the key letter in the left-hand column of the tableau. From there, the encipherer traces horizontally across the row until locating the plaintext letter within that row; the ciphertext letter is then found by moving vertically upward to the label in the top row at that position.[24][25] Algebraically, this corresponds to subtracting the numerical value of the key letter from the plaintext letter (with A=0, B=1, ..., Z=25), modulo 26: $ C = (P - K) \mod 26 $.[26] A key distinction from the standard Beaufort is its lack of reciprocity; encryption and decryption are not interchangeable operations using the same procedure.[24] Decryption requires a separate method equivalent to the standard Vigenère encryption: locate the key letter in the left column, trace to the ciphertext letter at the top, and read the plaintext from the intersection in the row.[24][26] This results in the formula $ P = (C + K) \mod 26 $.[26] Historically, the variant Beaufort emerged as an adaptation of the original cipher, appearing in later cryptographic publications and sometimes being mislabeled or conflated with the standard form due to procedural similarities with the Vigenère cipher.[24][27] It was referenced alongside the Beaufort and Vigenère in mid-20th-century analyses of polyalphabetic systems, highlighting its equivalence to Vigenère decryption under random keys.[27] To illustrate the difference, consider plaintext letter D (3) and key letter M (12), using A=0 indexing. In the variant Beaufort, the ciphertext is $ (3 - 12) \mod 26 = 17 $, corresponding to R. In contrast, the standard Beaufort yields $ (12 - 3) \mod 26 = 9 $, or J.[25][26]| Plaintext | Key | Variant Beaufort Ciphertext | Standard Beaufort Ciphertext |
|---|---|---|---|
| D (3) | M (12) | R (17) | J (9) |