Calculator
Key tools
The columns in the order they are read, counted from the left starting at 1. Entering an order directly uses it as the key, with no keyword.
Advanced search settings
Grid filling above says how the ciphertext was made. With Pad to rectangle only column counts that divide its length are tried. No padding also covers a padded ciphertext, since the two layouts are the same whenever the column count divides the length.
Short ciphertext may admit several plausible column orders. Longer messages usually improve automatic recovery.
Background searching is not available here, most likely because this page was opened as a file instead of from a web server. The search still works, but the page pauses while it runs, shows no progress, and cannot be stopped; Strong and Maximum effort can take a long while.
Other candidates
Search details
Column grid
How was this decrypted?
How was the key recovered?
Short keys. With few columns there are few orders, so every one is tried and its text read: 720 orders for 6 columns, 40,320 for 8, 362,880 for 9. That search is exhaustive.
Longer keys. The orders soon number in the millions, so they cannot all be tried. First the orders that the words of a word list give as keywords are tried, since keys are often words. Then a search over orders begins from several starting points, changing one a little at a time, keeping what reads better and sometimes what reads worse, so as not to settle too early. It tries a small part of the orders and can miss.
English scoring. Every order gives a text. The text whose runs of four letters look most like English wins, and the best few are then checked against a dictionary. Counting single letters would not help: every order gives the same letters.
The attack recovers the order in which the columns are read. It cannot tell which of the many keywords with that order was used.
How does the keyword determine column order?
Each letter of the keyword heads a column. Sort the letters alphabetically: the place of each letter in the sorted keyword is the rank of its column, and the columns are read in the order of their ranks. The keyword only serves to remember that order.
Why are repeated keyword letters allowed?
Every letter of the keyword is a column, so a repeated letter is kept: dropping it would change the number of columns. When two columns have the same letter, the one further left is read first. That makes the order definite whatever the keyword.
What is the difference between padded and irregular transposition?
A message rarely fills its last row. Irregular transposition leaves that row short, so some columns are one character longer than others. Padded transposition completes the row with a filler letter, so that the grid is a full rectangle and every column has the same length.
After decryption the padding is still there. Padding cannot always be distinguished from genuine message characters, since a message can really end in X, so this page marks what may be padding and removes nothing.
How is the message decrypted?
The shape of the grid depends only on the length of the text and the number of columns. Dividing the length by the number of columns gives the full rows; the remainder says how many columns, counted from the left of the grid, have one character more. Those lengths go by where a column stands in the grid, not by its rank.
The ciphertext is then cut into stretches of those lengths in the order the columns were read, each stretch is written down its column, and the rows are read from left to right. In Encrypt and Decrypt mode the first collapsed section shows these steps for the current text.
Why is this cipher vulnerable?
The letters are all still there; only the column order is secret. For a short key every order can be tried. For a longer one, the right order betrays itself little by little: putting two columns side by side correctly makes every row join in a likely pair of letters, so an attacker can improve a guess step by step instead of trying everything.
Related topics
Rail Fence follows a zigzag path, while Columnar Transposition uses a keyword to determine the order in which columns are read. Both move letters without changing them; the Substitution, Vigenère, Playfair and Hill ciphers change the letters instead.