Skip to main content

Codebusters - Porta

Last reviewed October 12, 2026

On this page(8 sections)
Type: Inquiry
Divisions: B, C
Participants: Up to 3
Approx. Time: 50 minutes
Allowed Resources: Writing utensils only: no notes and no calculator. The supervisor hands out a resource sheet (the Div B sheet adds an Atbash table).

Porta is a polyalphabetic substitution cipher: the key picks one of 13 reciprocal alphabets at each position, so the same plaintext letter can become different ciphertext letters across a message. Once you know the rule, decryption is a fixed sequence of lookups, so your points come from accuracy and from catching a wrong key pair early.

What the rules cover

Porta appears on both 2027 lists with the same structure in Division B and Division C. At Regional tournaments you get the key and decrypt. State and National exams keep that task and add cryptanalysis: you get the ciphertext and a crib (a short run of known plaintext) and must recover enough of the key to read the message.

LevelTaskDivision BDivision C
RegionalDecrypt a Porta message when the key is supplied3.e.vi3.e.vii
State and NationalThe Regional task, plus Porta cryptanalysis from a crib of at least 3 plaintext characters3.f.iii3.f.iii
All levelsA Porta table is on the resource sheet each team member receives2.d2.d
Crib problemsThe crib's position on the ciphertext is clearly marked3.j3.j

Codebusters is a written (or computer-based) exam for teams of up to 3, lasting about 50 minutes. You bring only writing utensils: no notes, no binder and no calculator. Each member gets a resource sheet with the Porta table, so you need to read the tableau quickly, not memorize it.

How Porta works

Porta numbers the letters A = 0 through Z = 25 and splits them into two halves: the top half A–M (0–12) and the bottom half N–Z (13–25). Each half has 13 letters, so a letter's offset is its position within its half, from 0 to 12. Porta never sends a letter to its own half. A top-half letter always becomes a bottom-half letter, and the reverse.

The key is a word. Its letters pair up as AB, CD, EF, GH, IJ, KL, MN, OP, QR, ST, UV, WX and YZ. Each pair gets a pair index k from 0 (AB) to 12 (YZ). Each pair index defines one of the 13 alphabets:

Pair index kKey lettersTop-half A maps toPair index kKey lettersTop-half A maps to
0A, BN7O, PU
1C, DO8Q, RV
2E, FP9S, TW
3G, HQ10U, VX
4I, JR11W, XY
5K, LS12Y, ZZ
6M, NT

The pair index is a shift between halves. Pair k moves the top-half letter at offset i to the bottom-half letter at offset (i + k) mod 13. Pair CD (k = 1) therefore sends A to O and B to P, while pair EF (k = 2) sends A to P.

Reciprocity. Applying the two rules in turn with the same k gives (i + k − k) mod 13 = i, so a letter sent through a pair and back returns to where it started. Encryption and decryption are therefore the same operation, and one table serves both.

Encryption, step by step

  1. Remove spaces and punctuation unless the question says to keep them. Convert each letter to its number, A = 0 to Z = 25.
  2. Write the key and repeat it over the letters only. Each key letter's pair index is k = floor(n / 2), where n is its letter number.
  3. For each plaintext letter, note its half and its offset.
  4. Apply the formula for that half, using the k of the key letter that lines up with it.
  5. A top-half result is the letter at that offset. For a bottom-half result, add 13 to the offset to get the letter number.
  6. Regroup the ciphertext the way the question asks.

Decryption, step by step

Use the same six steps with ciphertext letters as input. Because the operation is reciprocal, you do not need a separate inverse table.

Worked example: encrypting SCIENCE with the key KEY

K, E and Y have pair indices 5 (KL), 2 (EF) and 12 (YZ). The key repeats over the seven letters, so the key letters are K, E, Y, K, E, Y, K.

PosPlainHalf, offsetKeykCalculationCipher
1Sbottom, 5K5(5 − 5) mod 13 = 0A
2Ctop, 2E2(2 + 2) mod 13 = 4R
3Itop, 8Y12(8 + 12) mod 13 = 7U
4Etop, 4K5(4 + 5) mod 13 = 9W
5Nbottom, 0E2(0 − 2) mod 13 = 11L
6Ctop, 2Y12(2 + 12) mod 13 = 1O
7Etop, 4K5(4 + 5) mod 13 = 9W

Rows 1 and 5 start in the bottom half, so offsets 0 and 11 are top-half A and L. The other rows give bottom-half letters: offset 4 is 13 + 4 = 17, which is R. The ciphertext is ARUWLOW.

The two Es in positions 4 and 7 both fall under K, so both become W. Equal plaintext letters under the same key letter always give equal ciphertext letters, and solvers exploit that repetition.

Worked example: decrypting ZTXQM with the key KEY

Read each ciphertext letter's half first: Z, T, X and Q are bottom-half, M is top-half. Each result lands in the opposite half.

PosCipherHalf, offsetKeykCalculationPlain
1Zbottom, 12K5(12 − 5) mod 13 = 7H
2Tbottom, 6E2(6 − 2) mod 13 = 4E
3Xbottom, 10Y12(10 − 12) mod 13 = 11L
4Qbottom, 3K5(3 − 5) mod 13 = 11L
5Mtop, 12E2(12 + 2) mod 13 = 1, bottomO

Offsets 7, 4 and 11 are H, E and L in the top half. Row 5 is the exception: M is top-half, so the result is bottom-half offset 1, which is O. The plaintext is HELLO.

Solving without the key

At State and National a crib tells you the pair index at each of its positions; you need not recover the whole key first.

For one crib letter and its ciphertext letter, one letter is in the top half and the other is in the bottom half. If both are in the same half, the alignment is wrong. Otherwise the pair index is:

Worked crib example. Suppose the ciphertext ARUWLOW has the crib SCI at its start. Pair each crib letter with its ciphertext letter:

  • S with A: A is top offset 0 and S is bottom offset 5. k = (5 − 0) mod 13 = 5, which is pair KL.
  • C with R: C is top offset 2 and R is bottom offset 4. k = (4 − 2) mod 13 = 2, which is pair EF.
  • I with U: I is top offset 8 and U is bottom offset 7. k = (7 − 8) mod 13 = 12, which is pair YZ.

The three positions give KL, EF and YZ. You do not need the exact key letters to decrypt, only the pairs. Next, test a key length. If the key has length 3, position 4 uses the same pair as position 1. The ciphertext letter there is W, which is bottom offset 9, and (9 − 5) mod 13 = 4 gives E. So the length-3 hypothesis predicts E at position 4, and SCIENCE has E there, which supports it. Continue through the message with the three pairs in turn.

The crib's placement is marked, so you never search for it. Habits for tournament conditions:

  • Check the half rule first. Each crib letter and its ciphertext letter must lie in opposite halves. If a pair fails, you have misread the marked position.
  • Write the pair list above the message. Keep one pair per position, so a bad pair is easy to spot.
  • Use the crib length. A crib at least as long as the key reveals every pair. A shorter crib reveals only some, so test key lengths by checking whether a later position repeats a known pair, as in the example.
  • Rebuild the keyword from the pairs. Keys are usually English words and each pair offers only two letters, so write both letters of each pair. KL, EF, YZ spells KEY; AB, IJ, GH spells BIG. A candidate word gives you the key length and the pairs the crib did not reach.
  • Guess words. Letters under unknown pairs stay unreadable, but the decrypted fragments around them often suggest the missing word. Each guess tells you that position's pair.
  • Verify early. Check two or three letters with each pair before decoding everything.

Timing, scoring and the rules

Porta never affects the timing bonus. Under 3.h the timed first question is always an Aristocrat, so the bonus is earned on a different question type.

Porta answers fall under the general error rule (4.d): two or fewer plaintext errors still earn full credit, and each additional error costs 100 points, with the question never dropping below 0. One wrong key pair breaks every letter enciphered under that key position, so a single bad pair can wipe out a whole question, while two stray slips cost nothing. Spend your checking effort on the pairs.

Up to three questions that are not Aristocrats, Patristocrats or Xenocrypts can be marked as special bonus questions (3.i). In 2027 at least one of them must be a Homophonic cipher, so Porta can appear only in the remaining (at most two) slots. Watch the packet markings: a special bonus only counts when the question is solved with no penalty points at all, and the bonus is 150 for one, 400 for two and 750 for three. On a marked Porta, re-verify every letter, because even the two "free" errors cost you the bonus.

Common pitfalls

  • A key letter is not a Caesar shift

    A pair does not add one fixed amount to every letter. Pair CD maps A to O, but pair EF maps A to P. Solve each position with its own pair.

  • Stay in the opposite half

    A letter never becomes a letter from its own half, and it never becomes itself. If your output lands in the same half as its input, or equals the input, recheck the pair before you go on.

  • Pair indices start at zero, and the modulus is 13

    AB is pair 0, not 1; an off-by-one shifts every letter by one pair. Offsets run 0 to 12 within a half, so reduce mod 13, never mod 26.

  • Read the table on your resource sheet, not your memory

    This guide uses the tableau in which pair CD sends A to O, which matches the formulas above. Some printed tableaux shift the rows the other way (pair CD sends A to Z). If your resource sheet's CD row does not start with O, use the sheet: read each pair straight from its row rather than from the formula.

  • Count key positions over letters only, unless told otherwise

    If the question is silent about spaces and punctuation, assume the key advances only on letters, as the examples in this guide do. Follow any instruction the packet gives.

How tournaments test this

There are no Porta questions in the scio.ly archive yet, so this section rests on the 2027 rules rather than question counts. Regional exams give a keyed decryption; State and National exams can add a crib problem with at least 3 marked letters. With no calculator allowed, the arithmetic is mental mod 13 work, so drill the pair formula and also practice reading the resource-sheet table directly.

Practice

References and further reading

  • Science Olympiad, 2027 Division B and Division C rules manuals, Codebusters (pages B14–B15 and C18–C19), at soinc.org. The official manual is the authority on scope and scoring.
  • American Cryptogram Association, cryptogram.org, for cipher history and practice material.
  • Giambattista della Porta, De furtivis literarum notis (1563), the origin of the reciprocal tableau that bears his name.