Classical cipher
Columnar Transposition Cipher
Encode or decode a single columnar transposition with stable keyword ordering, explicit text handling, and an inspectable grid.
Exact convention
- The normalized message is written left to right in rows as wide as the keyword.
- Keyword letters are compared as uppercase ASCII. Columns are read by ascending letter; ties keep their original left-to-right order.
- Encoding reads each selected column downward. Decoding calculates each original column length, fills columns in that same order, then reads rows.
Text handling
- Preserve every character does not normalize Unicode. Each Unicode code point occupies a cell; a combining mark can therefore move separately from its base character. Browser textareas expose line breaks as LF.
- ASCII letters only removes every non-ASCII-letter character and returns uppercase A-Z. Removed spacing cannot be recovered.
- The 20,000-unit limit uses JavaScript UTF-16 length. An emoji normally counts as two units toward the limit but occupies one grid cell.
Security note: Single columnar transposition is a historical hand cipher for learning and puzzles. It is not suitable for protecting sensitive information.