ForHosting KIT · Developer Utilities

Double columnar transposition

With the keys ZEBRAS and then STRIPE, WEAREDISCOVEREDFLEEATONCE becomes CAEENSOIAEDRLEFWEDREEVTOC: two keyword grids rearrange the text one after the other. Decrypting undoes them in reverse order with the same pair of keys. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
WEAREDISCOVEREDFLEEATONCE
Key1
ZEBRAS
Key2
STRIPE
Calculation mode
Encrypt
You get
Result
CAEENSOIAEDRLEFWEDREEVTOC
Encoding
columnar_double
Key1 length
6
Key2 length
6

This double columnar transposition tool encrypts or decrypts text by applying two keyword-ordered column permutations one after the other. You supply a message, a first key, a second key, and an optional mode; the engine runs a full columnar pass under the first keyword, then feeds that intermediate string through a second columnar pass under the second keyword. Decrypting reverses those passes in the opposite order so the same pair of keywords restores the original string bit for bit. A classic check is WEAREDISCOVEREDFLEEATONCE under keys ZEBRAS then STRIPE: the intermediate after the first pass matches single columnar under ZEBRAS, and the second pass yields the final double ciphertext that decrypts cleanly under the same pair.

What double columnar transposition is and what this tool returns

Double columnar transposition is a classical rearrangement cipher that stacks two single columnar passes instead of substituting letters. Each pass builds a grid whose width equals that pass keyword length, writes characters left to right and top to bottom, then reads columns top to bottom in the order obtained by sorting the key characters. When the last row is incomplete, left-hand columns simply hold one more character than right-hand ones, matching the usual length-preserving textbook rule without forced padding unless you put padding in the input yourself.

Encryption applies the first keyword fully, then applies the second keyword to that intermediate string; decryption undoes the second keyword first and only then undoes the first, so order of the two keys is part of the secret. Tie-breaking is stable on each pass: if two key characters are equal, the left column is taken first so repeated letters do not invent an ambiguous order. This page always applies that fixed two-pass rule and never silently switches to a single columnar, route transposition, rail fence, or a substitution cipher.

Where double transposition shows up in lessons and puzzles

Developers and educators meet double columnar transposition in capture-the-flag challenges that deliberately raise the bar above a single keyword grid, textbook chapters on classical cryptology that introduce multi-stage rearrangements, and demos that show why even two permutations are not enough against modern cryptanalysis once message structure is known. Frontend teams can scramble sample phrases for screenshots with a two-key story, then recover them with decrypt under the same pair.

Backend services encode short challenge strings for puzzle APIs or teaching sandboxes where students must rebuild both grids in the correct order to unlock the next step. Quality engineers generate deterministic encrypt and decrypt pairs for contract tests so a middleware that claims double columnar support cannot silently switch to a single pass, a rail-fence pattern, or drop spaces. Contest organizers precompute answer keys for modest English phrases without trusting opaque web toys that force uppercase-only output or insert padding X characters you never asked for.

Product and education tools use the transform when a learner pastes ciphertext and the UI must show the recovered plaintext under two documented keywords. Pair it with single columnar and other classical encoding helpers when you are building a small lab of free, deterministic text tools, and never treat double columnar transposition as a substitute for modern authenticated encryption.

CTF and advanced classical cipher practice

Encrypt and decrypt two-key double columnar phrases for harder puzzles, classrooms, and capture-the-flag warm-ups beyond a single grid.

History-of-crypto multi-stage lessons

Demonstrate sequential row-write column-read passes, intermediate strings, and reverse-order decrypt with two keywords and stable repeated-key letters.

What does the double columnar transposition tool cost?

It is free in your browser on this page.

How do I decrypt a double columnar ciphertext?

Send the ciphertext as text, the same two keywords as key1 and key2, and set mode to decrypt (or dec, decode, d). Encryption is the default when mode is omitted. Decrypt undoes key2 first, then key1.

How does this differ from single columnar transposition?

Single columnar uses one keyword and one grid pass. Double columnar applies two full columnar passes in sequence with key1 then key2 on encrypt, and reverses that order on decrypt.

Is double columnar transposition secure for real secrets?

No. It is a classical teaching cipher. Use modern authenticated encryption such as AES-GCM for real confidentiality.

Does the order of the two keys matter?

Yes. The first key is applied in full before the second, and decryption undoes the second key first. Swapping the keys gives a different result, so their order is part of the secret.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/enc/columnar-double

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/enc/columnar-double \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"WEAREDISCOVEREDFLEEATONCE","key1":"ZEBRAS","key2":"STRIPE"}'
{
  "text": "WEAREDISCOVEREDFLEEATONCE",
  "key1": "ZEBRAS",
  "key2": "STRIPE"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "enc.columnar_double",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

All characters move together—spaces, digits, and punctuation keep their places in the sequence and are never stripped—so textbook worksheets and CTF payloads stay faithful. Use it free in the browser for history-of-crypto lessons, double-transposition puzzles, and reversible lab demos, or call the API at $0.002 per successful request when pipelines need reproducible two-key columnar transforms.

What double columnar transposition is and what this tool returns

The JSON response includes result for the final rearranged string, encoding fixed to columnar_double, mode set to encrypt or decrypt, key1 and key2 echoing the keywords you supplied, key1_length and key2_length, column_order1 and column_order2 as the zero-based original indices in read order for each pass, intermediate showing the string after the first encrypt pass or after the first decrypt undo, input_length and output_length which always match because each transform only permutes, and a formula string that restates the double-pass contract for documentation and tests. There is no streaming path and no silent fallback to Vigenère or Base64: either you supply non-empty text and two non-empty keys, or the request fails with invalid_input naming the missing field. If you need a single keyword only, polyalphabetic shifts, or modern encryption, use those dedicated endpoints; this landing answers only the classical double columnar two-key contract that crypto history chapters and advanced CTF warm-ups already describe.

How text, two keys, and mode are read and how results stay reproducible

The entire non-empty string of each key defines that pass columns, including digits and symbols if you include them, because ordering uses Unicode character comparison rather than stripping to A–Z only. The intermediate field lets teachers and graders show the first-pass grid without re-implementing columnar packing. The preferred payload fields are text for the message, key1 for the first keyword, key2 for the second keyword, and optional mode for encrypt or decrypt. Text accepts aliases such as input, value, s, message, plaintext, and ciphertext so forms and SDK clients can reuse existing column names without renaming every call site. Key1 accepts key_1, first_key, keyword1, and k1; key2 accepts key_2, second_key, keyword2, and k2. A missing or empty key1 or key2 is rejected with invalid_input and a clear message that names the field so operators can fix the right password without guessing. Mode defaults to encrypt when omitted and also accepts short aliases such as enc, encode, e for encrypt and dec, decode, d for decrypt; any other string fails validation. Missing text, empty text, non-string types, and unknown modes all raise invalid_input so a blank form does not look like a successful no-op. Column orders are computed once from each key, then the same heights formula is used on encrypt and decrypt so a full round trip always restores the original payload for any non-empty string under that key pair. Pair the free browser run on this page with the priced API when you need the identical double permutation inside an automated pipeline. Invalid inputs return invalid_input and are not charged, which keeps validation cheap while successful transforms remain a fixed item price.

Where double columnar transposition fits in lessons, puzzles, and test fixtures

On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the rearranged result.

Deterministic CI fixtures for two-pass ciphers

Generate reproducible double columnar ciphertext and plaintext pairs for unit tests, golden files, and contract checks.

What happens if one key is missing or empty?

The request fails with invalid_input and a message that names the missing field (key1 or key2). Both keywords must be non-empty strings.

Read the full KIT documentation →