Porta Cipher
Use a repeating keyword and the 13 reciprocal Porta alphabets to encrypt or decrypt with the same substitution rule.
What is the Porta Cipher?
The Porta cipher is polyalphabetic: the substitution changes according to the current key letter. Key letters are paired—A/B use one alphabet, C/D the next, and so on through Y/Z.
Porta is reciprocal. With a fixed key alignment, the same tableau lookup operation can be used in both directions.
The cipher mechanics on this page are self-contained. Science Olympiad event formats, allowed variants, and tournament constraints can change by season; the current official Rules Manual and official clarifications take precedence.
No outside reference is assumed. Work through Foundations → Complete Reference → Encryption → Decryption in order, then use the competition and cryptanalysis sections.
What you need to know
- Repeat the keyword under the message letters.
- Convert each key letter to one of 13 pairs: AB, CD, EF, …, YZ.
- Use the corresponding reciprocal alphabet row for each position.
Beginner glossary
| Term | Meaning |
|---|---|
| Keyword | The repeating key written under the plaintext/ciphertext letters. |
| Key pair | Porta groups key letters into AB, CD, EF, …, YZ; both letters in a pair select the same row. |
| Tableau | The 13 substitution rows used by Porta. |
| Reciprocal | The same table operation reverses itself, so encryption and decryption use the same row lookup. |
Keep this beside you while solving
Key-pair substitution rows
| Key pair | Substitution under A–Z |
|---|---|
| AB | NOPQRSTUVWXYZABCDEFGHIJKLM |
| CD | OPQRSTUVWXYZNMABCDEFGHIJKL |
| EF | PQRSTUVWXYZNOLMABCDEFGHIJK |
| GH | QRSTUVWXYZNOPKLMABCDEFGHIJ |
| IJ | RSTUVWXYZNOPQJKLMABCDEFGHI |
| KL | STUVWXYZNOPQRIJKLMABCDEFGH |
| MN | TUVWXYZNOPQRSHIJKLMABCDEFG |
| OP | UVWXYZNOPQRSTGHIJKLMABCDEF |
| QR | VWXYZNOPQRSTUFGHIJKLMABCDE |
| ST | WXYZNOPQRSTUVEFGHIJKLMABCD |
| UV | XYZNOPQRSTUVWDEFGHIJKLMABC |
| WX | YZNOPQRSTUVWXCDEFGHIJKLMAB |
| YZ | ZNOPQRSTUVWXYBCDEFGHIJKLMA |
Each row shows the substitution output corresponding to plaintext A–Z for that key pair.
Key-pair index
| Row | Key letters | Row | Key letters |
|---|---|---|---|
| 0 | A/B | 7 | O/P |
| 1 | C/D | 8 | Q/R |
| 2 | E/F | 9 | S/T |
| 3 | G/H | 10 | U/V |
| 4 | I/J | 11 | W/X |
| 5 | K/L | 12 | Y/Z |
| 6 | M/N |
How encryption works
Repeat the key
Write the keyword repeatedly under alphabetic plaintext positions.
Find the key pair
A or B uses the AB row; C or D uses CD; etc.
Look up the plaintext letter
Use its A–Z position in that row.
Write the output
Continue with the next key letter.
How decryption works
Align the repeating key
Key alignment must match the ciphertext letters.
Use the same key-pair row
Porta substitutions are reciprocal.
Look up the ciphertext letter
Apply the same row relationship to recover plaintext.
Check alignment
One skipped key position will corrupt every later letter.
How to approach it in Codebusters practice
- When the key is given, write its repeated alignment before performing any substitutions.
- In crib-based cryptanalysis, test where the crib can align and which key-pair rows would be required.
- Remember that A/B act identically as a pair, C/D as a pair, etc.
What the problem gives you vs. what you produce
| Part | What to expect |
|---|---|
| You may be given | Ciphertext and a keyword, plaintext to encrypt, or a crib for cryptanalysis. |
| You must find | The opposite text by repeating the key and using the row selected by each key letter. |
| Fastest first move | Write/repeat the key directly under the letters and convert each key letter to its AB/CD/… pair row. |
How to attack an unknown or partially known key
- A crib provides equations between plaintext/ciphertext letters and possible Porta key pairs.
- Because each pair of key letters shares a row, recovered key information may initially identify a pair rather than an exact letter.
- Repeated-key periodicity can create patterns when the key length is short.
Follow one example from start to finish
SECRET
CODE
CODECO
CD OP CD EF CD OP
EYQCSM
Before moving on, make sure you can answer these without another site:
- Can you identify the same tableau row for A and B?
- Can you explain why Porta encryption and decryption use the same operation?
- Can you align a repeating key while ignoring spaces?
Common mistakes
Using 26 distinct key rows instead of 13 paired rows.
Advancing the key on spaces when the chosen convention advances only on letters.
Using Vigenère arithmetic instead of the Porta tableau.
Forgetting reciprocity.
Competition speed strategies
Write the 13 key pairs in order on your reference sheet.
Pre-write the repeated key under the message.
For cryptanalysis, test crib alignments before attempting to recover a whole keyword.
What to remember under time pressure
See every transformation
Use the lab to change inputs and keys, keep the relevant reference material visible, inspect each intermediate transformation, and then read the “How to reverse it” panel so encryption and decryption connect.