Porta Cipher Decoder, Encoder & Solver

Encode and decode Porta cipher text with a keyword, or paste ciphertext into the Crack tab to recover the key without it.

By · Updated

TL;DR: Porta cipher in brief

  • A Porta cipher is a reciprocal polyalphabetic substitution cipher.
  • One keyword selects paired alphabets such as AB, CD, EF, and onward.
  • The same tableau operation encrypts and decrypts the message.
  • No key? The Crack tab estimates the key length and the 13-table choice per position. In our test, 100 letters were enough for 3–5 letter keys; 10-letter keys needed about 200–300 letters.
  • The conversion runs in your browser; the converter does not send input to a server or save it in browser storage.

How to Use the Porta Cipher Tool

  1. Choose encrypt or decrypt.
  2. Enter a keyword such as PORTA or SECRET.
  3. Paste plaintext or ciphertext into the input box.
  4. Copy the result, download it, or swap it back for a reciprocal round trip.
  5. Without a key, open the Crack tab, paste the ciphertext and press Crack the key. Then use Use this key in the converter to check it.

How the Porta cipher works

A Porta cipher is a polyalphabetic cipher that changes substitution alphabets according to a repeated keyword. It belongs to the same broad family as Vigenère and Beaufort, but its alphabet table is designed to be reciprocal.

A reciprocal cipher is a cipher where the same operation can be used for encryption and decryption. In the Porta cipher, the keyword letters are grouped into pairs: A/B select one alphabet, C/D select the next, and so on through Y/Z.

A keyword is the shared secret text that chooses which paired alphabet applies to each letter. Non-letter characters are ignored by the key stream, while the tool can either preserve punctuation or output compact five-letter groups.

How to encrypt with the Porta cipher, step by step

1. Prepare and repeat the keyword

Start with a keyword such as PORTA. Use its letters in order, then return to the beginning whenever you reach the end. Write one key letter beneath each message letter. Spaces, digits, and punctuation do not take a key letter, and a new word does not restart the keyword. For ATTACK AT DAWN, the aligned key is PORTAP OR TAPO. This alignment must stay the same when you decrypt.

2. Choose one of the thirteen tables

Group key letters into A–B, C–D, E–F, and onward through Y–Z. Each pair selects one substitution alphabet. Numbering key letters A = 0 through Z = 25, divide that number by two and round down to obtain a row number from 0 to 12. P and O both select row 7, labeled O–P; R selects row 8, labeled Q–R. These pairs concern the key, not a merger of letters in the message alphabet.

3. Exchange the two alphabet halves

Split the alphabet into A–M and N–Z. In the first table, A pairs with N, B with O, and so on. In each following table, rotate the N–Z half one place to the left: the C–D table begins O, P, Q and ends N. A letter in A–M always becomes a letter in N–Z; a letter in N–Z returns to its partner in A–M. With table O–P, A becomes U and U becomes A. No letter can encrypt to itself.

4. Read the replacement and advance

In the full table below, find the input letter across the header and the key pair down the left edge. Their intersection is the output letter. Move to the next message letter and the next key letter, choosing the appropriate row each time. The right half of every row already contains the reverse mappings, so this exact lookup also works for ciphertext. There is no separate subtraction step.

Complete Porta cipher table (13 alphabets)

These thirteen alphabets use the same table data as the converter. Every row shows all twenty-six substitutions, including both directions of each pair. Scroll horizontally on a narrow screen to see the N–Z input columns.

Key pair at left; input letter above; output letter in the cell.
Key pairABCDEFGHIJKLMNOPQRSTUVWXYZ
A–BNOPQRSTUVWXYZABCDEFGHIJKLM
C–DOPQRSTUVWXYZNMABCDEFGHIJKL
E–FPQRSTUVWXYZNOLMABCDEFGHIJK
G–HQRSTUVWXYZNOPKLMABCDEFGHIJ
I–JRSTUVWXYZNOPQJKLMABCDEFGHI
K–LSTUVWXYZNOPQRIJKLMABCDEFGH
M–NTUVWXYZNOPQRSHIJKLMABCDEFG
O–PUVWXYZNOPQRSTGHIJKLMABCDEF
Q–RVWXYZNOPQRSTUFGHIJKLMABCDE
S–TWXYZNOPQRSTUVEFGHIJKLMABCD
U–VXYZNOPQRSTUVWDEFGHIJKLMABC
W–XYZNOPQRSTUVWXCDEFGHIJKLMAB
Y–ZZNOPQRSTUVWXYBCDEFGHIJKLMA

This matches the paired-half convention in the American Cryptogram Association Porta guide. The compact version of the tableau prints only A–M above the rotated N–Z half; reading those pairs in either direction gives the same full table.

Porta cipher example: ATTACK AT DAWN

Keep formatting enabled and enter the keyword PORTA. The twelve message letters use PORTAPORTAPO. Notice that the two adjacent T letters use different tables: the first uses key O and the second uses R. Identical plaintext letters need not produce identical ciphertext when their key positions differ.

One row per message letter; spaces consume no key letters.
PositionPlaintext letterKey letterTableCiphertext letter
1APO–PU
2TOO–PM
3TRQ–RL
4ATS–TW
5CAA–BP
6KPO–PR
7AOO–PU
8TRQ–RL
9DTS–TZ
10AAA–BN
11WPO–PC
12NOO–PG
Plaintext: ATTACK AT DAWN
Keyword: PORTA
Repeated key: PORTAP OR TAPO
Ciphertext: UMLWPR UL ZNCG
Same operation again: UMLWPR UL ZNCG → ATTACK AT DAWN

For a quick check, use Swap with the same keyword. The letters return to their starting values because every selected row is reciprocal. If formatting is off, the first output is UMLWP RULZN CG. Those spaces are five-letter group separators, not the original word boundaries, so a second pass cannot restore the original spacing or capitalization.

How to decrypt a Porta cipher by hand

Decrypting Porta means applying the same encryption lookup again with the same keyword. Begin at the first ciphertext letter and repeat PORTA beneath the letters, ignoring spaces. Do not reverse the keyword, reverse the text, or subtract a Vigenère shift. For the opening UML, the key letters are P, O, R:

The first three letters of the worked example in reverse.
Ciphertext letterKey letterTableRecovered letter
UPO–PA
MOO–PT
LRQ–RT

U is in the N–Z half and returns A under O–P. M is in A–M and returns T under that same table. L returns T under Q–R. Continue with key T for the next letter W; it returns A. If the result looks wrong, check the row and key alignment first. A wrong key still produces letters, so alphabetic output alone does not confirm a successful decryption.

What this Porta cipher tool does

  • Message letters: only A–Z and a–z are substituted. I and J are separate letters; there is no Polybius square or I/J normalization. With key A, I J becomes V W. Accented letters are not transliterated into English letters in the message.
  • Keyword cleanup: the keyword is uppercased first, then everything outside A–Z is removed. Thus p0-o!r t_a becomes PORTA. Duplicate letters stay, and the cleaned keyword repeats only across message letters. Uppercasing happens before filtering, so a character such as ß becomes SS in a keyword; accents such as é remain outside A–Z and are removed.
  • Preserve formatting on: the default keeps the case of each processed letter and copies every other character unchanged, including digits, punctuation, whitespace, and non-English characters. None of those copied characters advances the key. A lowercase input letter produces lowercase output.
  • Preserve formatting off: nonletters are discarded, output letters become uppercase, and spaces are inserted after each group of five letters. The final group may be shorter; no padding letters are added. Decrypting keeps this grouped format, so original formatting is lost.
  • Crack tab: needs at least 20 letters and tests key lengths 1–12. It assumes English plaintext and the standard 13-row table shown below; it cannot find a key longer than 12 letters, a different table, or a non-English message. It reports one letter per key position (the first letter of each pair), so PORTA comes back as OOQSA, an equivalent key.
  • Which Porta version: the standard 26-letter, 13-row reciprocal table printed below, for both the converter and the solver. Some other sites, such as dCode, also offer other Porta alphabets, including a 22-letter Italian one; this tool does not.
  • Empty input or key: an empty message returns an empty output. A keyword with no A–Z letters after cleanup also returns an empty output and displays a request for at least one key letter. A message containing only nonletters passes through in preserve mode if the key is valid, and becomes empty in grouped mode.
  • Modes and output: Encrypt and Decrypt change labels, while the underlying substitution stays identical. Conversion updates as you type. Swap moves output into input and switches the mode label. Copy copies just the result; Download creates a text file containing the mode, cleaned keyword, letter count, input, and output. The download therefore includes the keyword.

Conversion runs locally in this browser component without a conversion request to a server. It does not write messages to browser storage. Keeping processing local is useful for experimenting, but it does not change the security limits of the cipher itself.

How to solve a Porta cipher without the key

Porta belongs to the Vigenère family of polyalphabetic substitution ciphers. A short repeating keyword reuses the same table at regular intervals, so every n-th letter (where n is the key length) was encrypted with one fixed table. The attack has three steps, and the Crack tab above runs all three:

1. Estimate the key length

Split the ciphertext into n columns (letters 1, n+1, 2n+1, … go in column 1) and compute each column's index of coincidence, Σ n(n−1) / (N(N−1)) (the measure behind the Friedman test). Columns that share one table keep English-like statistics, about 0.066; the wrong length mixes tables and stays near 0.038. Kasiski examination of repeated sequences gives the same answer from a different angle.

2. Try the 13 tables on each column

Each column has only 13 possible tables, not 26 as in Vigenère. Decrypt the column with every table and keep the one whose letters are closest to English frequencies (a chi-squared score). Single-letter counts alone are not enough on short columns, so the solver then changes one column at a time and keeps any change that makes the whole text contain more common English letter pairs such as TH, HE and IN.

3. Read the result and the key

The output is a table per key position, for example K/L I/J A/B E/F Q/R S/T Y/Z for the sample. Either letter of a pair works, so the original word (LIBERTY here) cannot be proved from the ciphertext; KIAEQSY decrypts identically. A wrong key still produces letters, so check that the plaintext actually reads as English.

Try it: load the 160-letter sample (the Declaration's opening under key LIBERTY). Compare the shift-based attack in the Vigenère tool and the Beaufort, Gronsfeld and Autokey ciphers.

Measured: how many letters the Porta cipher solver needs

We encrypted 30 windows of the Declaration of Independence (the same transcription as our Beale cipher page, letters A–Z only, 6,534 letters), spread evenly from start to end, with four keys of different lengths. Then we ran this page's keyless solver on the ciphertext alone. Each cell shows the share of the 30 windows recovered exactly, and in brackets the share of all letters that came out right.

Exact recoveries (letters correct), 30 windows per cell.
Key (length)40 letters60 letters100 letters150 letters200 letters300 letters
KEY (3)43% (71%)77% (92%)100% (100%)100% (100%)100% (100%)100% (100%)
PORTA (5)27% (64%)80% (93%)100% (100%)100% (100%)100% (100%)100% (100%)
LIBERTY (7)20% (55%)43% (89%)83% (98%)97% (100%)100% (100%)100% (100%)
REVOLUTION (10)0% (55%)7% (78%)50% (93%)80% (98%)90% (99%)100% (100%)
  • With a 3- or 5-letter key, 100 letters were enough: 30 of 30 windows came back exactly. At 40 letters most attempts failed, although 64–71% of letters were right.
  • A 7-letter key needed about 150 letters (29 of 30 exact); a 10-letter key needed 300 letters for 30 of 30. Each column then holds only 10–30 letters.
  • "Letters correct" stays high even when the exact count is low: usually one column picked a neighbouring table, so the text is readable with every n-th letter wrong. Fixing that column by hand is quick.

Measured November 4, 2026 with this page's own code. Windows start at positions spread evenly from letter 1 to the last full window; there is no random choice, so the run repeats exactly. The solver settings (bigram weight, key-length penalty) were tuned on this text; a check on the 763-letter Beale No. 2 plaintext gave similar but slightly lower rates for 7- and 10-letter keys. Results depend on the language and style of the message; this is one English text, not a general guarantee. English letter frequencies: Lewand, as tabulated on Wikipedia: Letter frequency; letter pairs: Peter Norvig, English Letter Frequency Counts: Mayzner Revisited.

How to recognize a Porta cipher

  • Flat letter counts: the whole-text index of coincidence is low (near 0.04) because several tables are mixed, as with Vigenère. The sample above scores 0.040 at key length 1.
  • A clear key length: one column count stands out (0.082 at length 7 for the sample), while every other length stays between 0.028 and 0.040.
  • No letter maps to itself, and halves always swap: every Porta table sends A–M to N–Z and back. If you know a crib (a word in the plaintext), each plaintext letter in A–M must sit above a ciphertext letter in N–Z. A crib that breaks this rule at any position rules Porta out at that alignment; Vigenère and Beaufort have no such restriction.

Not sure which cipher you have? Run it through the cipher identifier or the frequency analysis tool first.

Paired key letters also mean distinct keywords behave identically: replacing P with O selects the same row. A longer keyword reduces repetition, but Porta remains a classroom and puzzle cipher. Use modern, vetted encryption for private messages, passwords, or files.

Porta cipher history: Bellaso's table and della Porta's book

According to Wikipedia's article on Giovan Battista Bellaso, Bellaso described a reciprocal table in his 1553 booklet La Cifra, formed by sliding the lower half of an alphabet against the upper half. In 1555 he shifted the lower halves regularly, giving 13 shifts for pairs of key letters. The same article says della Porta printed the table in 1563 without naming Bellaso, which is why it is now called the Porta (or della Porta) table.

The name is associated with Giovanni Battista della Porta, also called Giambattista della Porta, whose sixteenth-century cryptographic writing described related polyalphabetic methods. His book De furtivis litterarum notis appeared in 1563. The Stanford Encyclopedia of Philosophy biography identifies the work and describes its treatment of both enciphering and deciphering. This is a date for the book, not a claim that today's exact twenty-six-letter table was first printed in that form in that year.

The modern Porta convention used here is documented in the American Cryptogram Association guide linked above. It is useful for studying reciprocal substitutions by hand and comparing them with other keyword ciphers. For further historical reading, Helen Fouché Gaines's Elementary Cryptanalysis discusses classical systems and methods of solving them.

Where you will meet a Porta cipher

  • Cryptogram puzzles: Porta is one of the cipher types in the American Cryptogram Association's guide linked above, so it turns up in solver-club puzzles.
  • Puzzle hunts, geocaches and escape rooms: the reciprocal table is easy to print on one card, and the same lookup decodes it.
  • Cryptography lessons: it shows how a polyalphabetic cipher with only 13 alphabets is still broken by key-length and frequency analysis.

Frequently Asked Questions

How do you decrypt a Porta cipher by hand?

Repeat the same keyword beneath the ciphertext letters, skipping spaces and punctuation. Each key letter selects its paired table. Look up the ciphertext letter in that table exactly as you would for encryption. With key POR, UML becomes ATT. Continue the key across word boundaries; do not restart it at each word.

Can you solve a Porta cipher without the key?

Usually, if the message is long enough. Estimate the key length from the index of coincidence of every n-th letter, then pick one of the 13 tables for each key position by comparing the output with English letter and letter-pair frequencies. The Crack tab on this page does this for key lengths 1 to 12. In our test on the Declaration of Independence, 100-letter messages were recovered exactly in 30 of 30 windows with a 3- or 5-letter key, 25 of 30 with a 7-letter key and 15 of 30 with a 10-letter key.

What is the difference between Porta and Vigenère?

Both are polyalphabetic substitution ciphers that can use a repeating keyword. Standard Vigenère selects one of 26 shifts, adding for encryption and subtracting for decryption. Porta selects one of 13 reciprocal tables: A/B share a table, C/D share another, and so on. Porta always exchanges a letter in A–M with one in N–Z and uses the same operation in both directions.

Why is the Porta cipher reciprocal?

Every table consists of letter pairs that swap with each other. If one table maps A to U, that same table maps U to A. Applying the same sequence of tables twice therefore restores the letters. Keep the same key alignment. Formatting discarded in five-letter-group mode cannot be recovered by decryption.

How long does a Porta cipher key need to be?

This tool needs at least one A–Z letter after uppercasing and filtering the keyword. The key does not need to match the message length: it repeats automatically, and repeated key letters are retained. There is no fixed key-length requirement or maximum-length field restriction. A short repeating key is vulnerable to statistical analysis; a longer keyword does not turn Porta into modern secure encryption.

Why does the Porta cipher have only 13 alphabets?

The 26 possible key letters are grouped into 13 pairs, A–B through Y–Z. Both letters of a pair select the same substitution alphabet. The message alphabet still contains all 26 letters. I and J remain distinct message letters even though I and J, when used as key letters, select the same table.

Can Porta encrypt numbers, spaces, or punctuation?

This tool substitutes only English letters A–Z and a–z. With Preserve spaces, punctuation, and letter case enabled, digits, spaces, punctuation, and other characters pass through unchanged and do not advance the key. With it disabled, those characters are removed and the encrypted letters are uppercased and grouped in fives. Numbers and spaces are not encrypted.

Is the Porta cipher secure for private messages?

No. Repeated-key Porta preserves patterns that support key-period estimation and frequency analysis. It is useful for lessons, puzzles, and historical comparisons, not for passwords or sensitive messages. The converter runs locally in the browser, but local processing does not make this historical cipher cryptographically secure.