§ TOOLS / CIPHER LAB / PORTA
Porta cipher
The Porta cipher is a polyalphabetic substitution: a keyword is written over the message, repeating, and the keyword letter above each position chooses which row of a thirteen-row table to use. The same ciphertext letter can stand for different plaintext letters two positions apart, which is what makes it stronger than a simple substitution, and it appears on Science Olympiad Codebusters papers from the elementary level through Division B.
What the Porta cipher is
The Porta table has thirteen rows, one for each pair of key letters: A and B share the first row, C and D the second, and so on to Y and Z. Every row pairs the first half of the alphabet with the second half, so a letter from A to M always encodes to a letter from N to Z and the other way round. The rows differ only in how far the second half is rotated. Under the first row A becomes N and N becomes A; under the second, A becomes O and O becomes A; each row down moves the pairing along by one.
The cipher is named for Giovanni Battista della Porta, a Neapolitan scholar of the sixteenth century who described it in a book on secret writing, and it is commonly counted among the first polyalphabetic ciphers to be published. Its useful property is that it is reciprocal: because every row is made of letter pairs, the step that encodes a letter also decodes it. A solver with the table and the keyword does one lookup per letter and never has to reverse anything.
To decode, write the keyword over the ciphertext with no spaces, repeating it as many times as needed. For each letter, find the key letter’s row, find the ciphertext letter in that row, and read the plaintext letter it is paired with. Most printed tables show the letters A to M across the top and the pairs in the body, so a ciphertext letter from N to Z is found in the row and its plaintext read from the column heading, while a ciphertext letter from A to M is found in the heading and its plaintext read from the row.
There is no inference in Porta, only bookkeeping, and the mistakes are bookkeeping mistakes. The common one is losing track of which keyword letter is active, usually after a word break, since the keyword runs over the letters only and skips the spaces. Writing the repeated keyword above the ciphertext before any lookup prevents it. The other is reading the wrong row because two key letters share each row: C and D both use the second row, which is a convenience once known and a trap before.
How to solve a Porta cipher
A polyalphabetic substitution cipher with a KEYWORD. Same plaintext letter can encrypt to different ciphertext letters depending on which key letter is "active" at that position. Porta is simple but slow — pure lookup with no inference, but you do it once per ciphertext letter, so the bottleneck is just speed.
- STEP 1: Write the key above the ciphertext with NO SPACES, repeating until you run out of room.
- STEP 2: Find the first letter of the KEY in the FAR LEFT column of the Porta table.
- STEP 3: Find the first letter of the CIPHERTEXT in the TOP ROW.
- STEP 4: Find the intersection of that row and column — that's your plaintext letter.
- Repeat for each ciphertext letter, advancing the key letter each time.
- "What if it's not on the chart?" — flip the lookup direction (find ciphertext in the body, read plaintext from the top row above it).
A worked example
Decode QYZNE UDT OSWGS (key CODE)
Step 1 — write the key over the ciphertext, repeating, no spaces: C O D E C O D E C O D E C Q Y Z N E U D T O S W G S Q under C: C is in row CD. Q is not on the top row, so find it in that row — it sits under C. → C Y under O: row OP. Y sits in the row under E. → E Z under D: row CD again. Z sits under L. → L N under E: row EF. N sits under L. → L E under C: E IS on the top row, so read down its column to row CD. → S The same steps turn UDT into ARE and OSWGS into ALIVE. Plaintext: CELLS ARE ALIVE
Porta in Codebusters
On the Codebusters papers OlyPrep has read, Porta comes with its keyword given, and the table is usually printed on the resource sheet the organizers provide, so the question is a test of speed and care rather than of cleverness. The Bay Area elementary rules and Division B’s both name it; it is commonly worth more than the warm-up ciphers and less than the Aristocrat, and it takes longer than its value suggests because every letter is a separate lookup.
Scoring is usually by the letters of the decoded message, often with a small allowance for errors, and a decoded quotation with up to two wrong letters is commonly counted as solved. The practical advice is to do the keyword line first, then work through the message in one steady pass, saying each key letter and row aloud if it helps. A student who rushes Porta and keeps losing the key position typically spends longer than one who goes steadily from the start.
The lab below hands out a keyword with every challenge and shows it beside the ciphertext. It encodes a science sentence from its own list, so the message is worth reading back as a check: a decoded word that is not English usually means the key position slipped a letter earlier. A kid who has done thirty of these reads the table as fast as the sheet allows, which on the day is the whole skill.
Practice the Porta cipher
The lab below is set to the Porta cipher alone. Pick a difficulty, generate a challenge, decode it, then check your answer or reveal the solution. It runs in your browser, needs no account, and is unlimited on every OlyPrep plan.
Scoped to Porta · 1 cipher type. Generate a challenge, solve it, and we'll track what you've cracked.
Your first decode is the hardest.
Pick a cipher above and give it a shot — we'll keep track of what you've solved.
Where the Porta cipher is tested
The Science Olympiad rule sets OlyPrep has read that name this cipher:
- Bay Area Elementary Science Olympiad — on the Codebusters list; the table is on the reference sheet in the rules
- Science Olympiad Division B — on the Codebusters list, with the key given
- Milpitas Elementary Science Olympiad (MESO) — on the Codebusters list; the table is on the resource sheet
Bay Area ESO never asks teams to encode; five to ten of its twenty questions are multiple choice or fill-in on how the ciphers work.
Cipher lists change with each season’s rules; a tournament’s own rulebook is the authority on what it tests.
Questions about the Porta cipher.
- Q·01Why does the Porta table have thirteen rows instead of twenty-six?
- Because each row serves two key letters: A and B use the first row, C and D the second, through Y and Z on the last. Thirteen rows cover the alphabet, and every row pairs A to M with N to Z, which is what makes the cipher reciprocal.
- Q·02Is the Porta cipher the same as the Vigenère cipher?
- They are cousins, not the same. Both use a repeating keyword to change the substitution at every position, but Vigenère shifts the whole alphabet by the key letter, while Porta swaps the two halves of the alphabet using a fixed thirteen-row table. Porta is reciprocal; Vigenère is not.
- Q·03How does the OlyPrep lab check a Porta answer?
- The lab encodes a science sentence with a keyword it shows you, and compares your decoded sentence against the original letter by letter, ignoring spaces and punctuation. Check says whether every letter matches; Reveal shows the solution.
- Q·04Is OlyPrep affiliated with Science Olympiad?
- No. OlyPrep is independent and is not affiliated with Science Olympiad, Inc. or any state or regional Science Olympiad organization. Whether a Porta table is provided on the day is set by each tournament’s own rules.