7.2 Coding, Decoding & Substitution Ciphers

Key Takeaways

  • Monoalphabetic substitution ciphers maintain fixed one-to-one character mappings, where reverse complementary pairs strictly obey the algebraic summation constant Position1+Position2=27\text{Position}_1 + \text{Position}_2 = 27.

  • Variable and progressive shift ciphers advance the transformation index by an incrementing parameter (such as +1,+2,+3,…+1, +2, +3, \dots or alternating +k,−m+k, -m), preventing naive single-shift Caesar analysis.

  • Positional letter-to-number coding schemes evaluate words through positional summation, scalar multipliers, letter-count weighting, or distinct consonant-vowel partition rules.

  • Fictitious language substitution puzzles are resolved systematically through set intersection and matrix comparison, isolating unique word-code correspondences by cross-referencing multiple linguistic statements.

Last updated: October 2026

7.2 Coding, Decoding & Substitution Ciphers

Cryptography is central to military command and control. From transmitting secure tactical call-signs over high-frequency combat net radio to verifying challenge-and-reply authentication matrices in field operations, officers must comprehend how alphabetic and numeric symbols are encrypted, obfuscated, and deciphered. On the Ghana Armed Forces (GAF) Officer Cadet Written Examination, coding-decoding questions test candidates' structured analytical deduction, working memory, and symbolic agility under tight time limits.


Letter-to-Letter Substitution Systems

In letter-to-letter coding, letters in an original message (plaintext) are transformed into target letters (ciphertext) following a deterministic rule. The primary challenge is identifying whether the shift is static, progressive, complementary, or structural.

1. Fixed Shifts (Caesar Ciphers)

In a fixed-shift cipher, every letter in the alphabet is displaced forward or backward by a constant integer offset kk: Ci≡(Pi+k−1)(mod26)+1C_i \equiv (P_i + k - 1) \pmod{26} + 1

  • If k=+3k = +3, ATTACK becomes DWWDFN (A →\to D, T →\to W, C →\to F, K →\to N).
  • If k=−2k = -2, PATROL becomes NYRPMJ (P →\to N, A →\to Y, T →\to R, R →\to P, O →\to M, L →\to J).

2. Variable & Progressive Shift Ciphers

Modern aptitude exams avoid trivial fixed shifts in favor of variable algorithms where the shift parameter changes with each letter's index position:

  • Incrementing Step Shifter (+1,+2,+3,+4,…+1, +2, +3, +4, \dots):
    • Word: GUARD
    • Letter 1: G(7)+1=8  ⟹  HG(7) + 1 = 8 \implies H
    • Letter 2: U(21)+2=23  ⟹  WU(21) + 2 = 23 \implies W
    • Letter 3: A(1)+3=4  ⟹  DA(1) + 3 = 4 \implies D
    • Letter 4: R(18)+4=22  ⟹  VR(18) + 4 = 22 \implies V
    • Letter 5: D(4)+5=9  ⟹  ID(4) + 5 = 9 \implies I
    • Resulting Ciphertext: HWDVI
  • Alternating Direction Shifter (+k,−m,+k,−m,…+k, -m, +k, -m, \dots): The operation alternates between forward and backward movements, such as +2,−1,+2,−1+2, -1, +2, -1.

3. Reverse Complementary Pairings (The Rule of 27)

In a complementary substitution cipher, each letter is replaced by its diametrical counterpart in the reversed alphabet. Two letters are complementary if and only if their numerical positions sum to exactly 2727:

Position(L)+Position(L′)=27\text{Position}(L) + \text{Position}(L') = 27

PairPositionsMnemonic AnchorPairPositionsMnemonic Anchor
A — Z1+26=271 + 26 = 27A to ZG — T7+20=277 + 20 = 27Ghana Telecom / GT Road
B — Y2+25=272 + 25 = 27Boy / ByH — S8+19=278 + 19 = 27High School
C — X3+24=273 + 24 = 27Coxswain / CXI — R9+18=279 + 18 = 27InfraRed / IR
D — W4+23=274 + 23 = 27Dew / DownJ — Q10+17=2710 + 17 = 27Jack-Queen
E — V5+22=275 + 22 = 27EVening / LoveK — P11+16=2711 + 16 = 27KeeP / KP
F — U6+21=276 + 21 = 27Full / FuelL — O12+15=2712 + 15 = 27LOve
M — N13+14=2713 + 14 = 27Man / Military-Navy———
Worked Example — Reverse Complementary Coding:
If DEFENSE is coded as WVUVMHV, how is ATTACK coded?

Check established pairs:
  D(4)  <-> W(23)  [4 + 23 = 27]
  E(5)  <-> V(22)  [5 + 22 = 27]
  F(6)  <-> U(21)  [6 + 21 = 27]
  E(5)  <-> V(22)  [5 + 22 = 27]
  N(14) <-> M(13)  [14 + 13 = 27]
  S(19) <-> H(8)   [19 + 8 = 27]
  E(5)  <-> V(22)  [5 + 22 = 27]

Apply Rule of 27 to ATTACK:
  A(1)  -> 27 - 1  = 26 -> Z
  T(20) -> 27 - 20 = 7  -> G
  T(20) -> 27 - 20 = 7  -> G
  A(1)  -> 27 - 1  = 26 -> Z
  C(3)  -> 27 - 3  = 24 -> X
  K(11) -> 27 - 11 = 16 -> P

Ciphertext: ZGGZXP

4. Transposition & Anagram Shuffling

Transposition ciphers do not alter the identity of characters; instead, they rearrange character positions according to a spatial permutation:

  • Bilateral Half-Reversal: A 6-letter word divided into two 3-letter segments, each reversed internally: VECTOR →\to Split: VEC | TOR →\to Reverse: CEV | ROT →\to CEVROT.
  • Odd-Even Interlacing: Extracting odd-indexed letters first, followed by even-indexed letters: BRIGADE (Indices 1 to 7) →\to Odd positions (1, 3, 5, 7: B, I, A, E) + Even positions (2, 4, 6: R, G, D)   ⟹  \implies BIAERGD.
  • Matrix Grid Transposition: Writing plaintext horizontally across fixed columns and reading vertically down rows.

Letter-to-Number Coding Methodologies

Letter-to-number problems map words to numerical values. Candidates must test whether the output represents a direct sum, a weighted calculation, or an operation involving word length.

Common Letter-to-Number Operational Rules

  1. Direct Positional Summation: Value=∑i=1nPos(Li)\text{Value} = \sum_{i=1}^n \text{Pos}(L_i) For example, CADET =3+1+4+5+20=33= 3 + 1 + 4 + 5 + 20 = 33.
  2. Sum Scaled by Word Length: Value=(∑i=1nPos(Li))+nor(∑i=1nPos(Li))×n\text{Value} = \left( \sum_{i=1}^n \text{Pos}(L_i) \right) + n \quad \text{or} \quad \left( \sum_{i=1}^n \text{Pos}(L_i) \right) \times n If CADET is coded as 3838, the rule is the positional sum (3333) plus the number of letters (n=5n = 5).
  3. Reverse Positional Summation: Value=∑i=1n(27−Pos(Li))\text{Value} = \sum_{i=1}^n (27 - \text{Pos}(L_i)) For CADET: (27−3)+(27−1)+(27−4)+(27−5)+(27−20)=24+26+23+22+7=102(27-3) + (27-1) + (27-4) + (27-5) + (27-20) = 24 + 26 + 23 + 22 + 7 = 102.
  4. Vowel-Consonant Partitioning: Vowels are assigned sequential indices (A=1,E=2,I=3,O=4,U=5A=1, E=2, I=3, O=4, U=5) while consonants retain standard alphabetical positions, or consonants and vowels are summed into separate multipliers.
Worked Example — Weighted Number Coding:
In a signal code, SQUAD is coded as 67 and TEAM is coded as 43. What is the code for PLATOON?

Step 1: Test the plain positional sum.
  SQUAD: S(19) + Q(17) + U(21) + A(1) + D(4) = 62, but the code is 67 (difference 5)
  TEAM:  T(20) + E(5) + A(1) + M(13) = 39, but the code is 43 (difference 4)

Step 2: Explain the differences.
  SQUAD has 5 letters and its difference is 5.
  TEAM has 4 letters and its difference is 4.
  Rule: code = positional sum + number of letters.

Step 3: Apply the rule to PLATOON (7 letters).
  P(16) + L(12) + A(1) + T(20) + O(15) + O(15) + N(14) = 93
  Code = 93 + 7 = 100

Always confirm a rule on every given example before applying it.

Fictitious Language Decryption (Matrix Comparison Technique)

Fictitious (artificial) language questions present three or four statements in an unfamiliar mock language alongside English translations. The word order in the cipher statements is scrambled relative to the English sentences. To solve these, candidates must use set intersection to cross-reference statements and isolate individual word meanings.

Worked Example — Fictitious Language Matrix Deduction:
Given the following intelligence intercepts:
  Statement 1: "moko tari veda" means "advance forward platoon"
  Statement 2: "tari belo zuni" means "platoon secure perimeter"
  Statement 3: "veda zuni koba" means "advance perimeter armor"

Objective: Determine the exact code word for "armor".

Step 1: Compare Statement 1 and Statement 2:
  Common coded word: "tari"
  Common English word: "platoon"
  Deduction: "tari" = "platoon"

Step 2: Compare Statement 1 and Statement 3:
  Common coded word: "veda"
  Common English word: "advance"
  Deduction: "veda" = "advance"

Step 3: Resolve Remaining Term in Statement 1:
  Statement 1 has only "moko" remaining.
  English translation has only "forward" remaining.
  Deduction: "moko" = "forward"

Step 4: Compare Statement 2 and Statement 3:
  Common coded word: "zuni"
  Common English word: "perimeter"
  Deduction: "zuni" = "perimeter"

Step 5: Resolve Statement 3 to Isolate "armor":
  Statement 3 elements: "veda" (advance) + "zuni" (perimeter) + "koba"
  English elements: "advance" + "perimeter" + "armor"
  Eliminating "advance" and "perimeter" leaves: "koba" = "armor"

Conclusion: The code word for "armor" is "koba".

Grid, Matrix & Coordinate Ciphers

Coordinate ciphers map characters into a two-dimensional grid, converting each letter into a row-column coordinate pair.

The Polybius Square (5×55 \times 5 Grid)

The letters of the alphabet are arranged in a 5×55 \times 5 grid, combining II and JJ into a single cell:

12345
1ABCDE
2FGHI/JK
3LMNOP
4QRSTU
5VWXYZ

Each letter is encrypted as a two-digit number (Row, Column):

  • C   ⟹  13\implies 13
  • A   ⟹  11\implies 11
  • D   ⟹  14\implies 14
  • E   ⟹  15\implies 15
  • T   ⟹  44\implies 44
  • CADET   ⟹  13 11 14 15 44\implies 13\ 11\ 14\ 15\ 44

Historically, the German ADFGVX cipher of the First World War replaced the row and column numbers with the letters A, D, F, G, V, and X, but the lookup logic is identical.


Tactical Communications & Field Signal Authentication

Military operations require robust communications security (COMSEC). In field environments, junior officers must apply cipher principles across several core procedures:

  • Challenge-and-Reply Authentication: A radio operator transmits a two-letter challenge (e.g., "Delta Hotel"). The receiving station locates "Delta" on the vertical axis of the daily authentication matrix, tracks horizontally to column "Hotel", and reads the reciprocal authentication letter to confirm friendly identity.
  • Brevity Codes & Prowords: Standard operational words (such as Roger, Wilco, Sunray, Sitrep) eliminate ambiguity and deny adversaries contextual information during unencrypted tactical VHF bursts.
  • Transmission Security (TRANSEC): Keeping transmissions as short as possible and rotating pre-assigned daily call-sign allocations to defeat electronic direction-finding and traffic analysis by hostile forces.

Cryptographic Systems Reference Table

Cipher MechanismOperating PrincipleAlgorithmic RulePrimary Detection Strategy
Caesar (Fixed Shift)Constant alphabetical translationCi=(Pi+k)(mod26)C_i = (P_i + k) \pmod{26}Constant distance between all plaintext/ciphertext pairs
Progressive ShiftIncrementing displacementCi=(Pi+i)(mod26)C_i = (P_i + i) \pmod{26}Differences expand by +1+1 across successive letters
Reverse ComplementReflection across midpoint (M/NM/N)Pos(Ci)=27−Pos(Pi)\text{Pos}(C_i) = 27 - \text{Pos}(P_i)Letter pairs sum invariant to 2727 (A↔Z,B↔YA \leftrightarrow Z, B \leftrightarrow Y)
TranspositionSpatial rearrangement of charactersPermutation matrixCharacter frequency matches natural language; letters are identical
Positional NumericValue mapping of lettersSum, product, or length-weightedCompare sum of forward coordinates against target integer
Artificial LanguageSymbolic token substitutionOne-to-one word mappingMatrix cross-comparison and set intersection across sentences
Loading diagram...
Systematic Cryptographic Cipher Decoding Workflow
Test Your Knowledge

In a military communications cipher, the word PATROL is encrypted as QCWVTR. Following the identical algorithmic rule, how is the tactical command SCOUT encrypted?

A

TDQWV

B

TEPWS

C

TERYY

D

UFRZX

Test Your Knowledge

In a signal corps numerical code, if SIGNAL is encoded as 68 (where the sum of the forward positional values 19 + 9 + 7 + 14 + 1 + 12 = 62, plus the word length of 6 letters equals 68), what is the encoded numerical value for PATROL?

A

88

B

82

C

86

D

94

Test Your Knowledge

An intelligence analyst reviews three intercepted coded transmissions: (1) 'bor lin sit' means 'hostile armor column'; (2) 'sit kal vad' means 'column recon unit'; (3) 'vad bor zep' means 'hostile unit retreat'. What is the exact coded term for 'recon'?

A

sit

B

bor

C

vad

D

kal

Sections you finish are checked off in the contents.