[{"data":1,"prerenderedAt":669},["ShallowReactive",2],{"navigation_docs":3,"-ciphers-route":276,"-ciphers-route-surround":664},[4,36],{"title":5,"path":6,"stem":7,"children":8,"icon":35},"Guide","\u002Fguide","1.guide\u002F01.index",[9,11,15,19,23,27,31],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"Encode and decode","\u002Fguide\u002Ftransform","1.guide\u002F02.transform",{"title":16,"path":17,"stem":18},"Analysis","\u002Fguide\u002Fanalysis","1.guide\u002F03.analysis",{"title":20,"path":21,"stem":22},"CLI","\u002Fguide\u002Fcli","1.guide\u002F04.cli",{"title":24,"path":25,"stem":26},"Agents","\u002Fguide\u002Fagents","1.guide\u002F05.agents",{"title":28,"path":29,"stem":30},"Custom ciphers","\u002Fguide\u002Fcustom","1.guide\u002F06.custom",{"title":32,"path":33,"stem":34},"Playground","\u002Fguide\u002Fplayground","1.guide\u002F07.playground","i-lucide-book-open",{"title":37,"path":38,"stem":39,"children":40,"icon":275},"Ciphers","\u002Fciphers","2.ciphers\u002F00.index",[41,43,47,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139,143,147,151,155,159,163,167,171,175,179,183,187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255,259,263,267,271],{"title":42,"path":38,"stem":39},"Overview",{"title":44,"path":45,"stem":46},"Classical","\u002Fciphers\u002Fclassical","2.ciphers\u002F01.classical",{"title":48,"path":49,"stem":50},"Caesar","\u002Fciphers\u002Fcaesar","2.ciphers\u002F02.caesar",{"title":52,"path":53,"stem":54},"ROT-13","\u002Fciphers\u002Frot13","2.ciphers\u002F03.rot13",{"title":56,"path":57,"stem":58},"ROT-47","\u002Fciphers\u002Frot47","2.ciphers\u002F04.rot47",{"title":60,"path":61,"stem":62},"Atbash","\u002Fciphers\u002Fatbash","2.ciphers\u002F05.atbash",{"title":64,"path":65,"stem":66},"Affine","\u002Fciphers\u002Faffine","2.ciphers\u002F06.affine",{"title":68,"path":69,"stem":70},"Vigenère","\u002Fciphers\u002Fvigenere","2.ciphers\u002F07.vigenere",{"title":72,"path":73,"stem":74},"Beaufort","\u002Fciphers\u002Fbeaufort","2.ciphers\u002F08.beaufort",{"title":76,"path":77,"stem":78},"Autokey","\u002Fciphers\u002Fautokey","2.ciphers\u002F09.autokey",{"title":80,"path":81,"stem":82},"Trithemius","\u002Fciphers\u002Ftrithemius","2.ciphers\u002F10.trithemius",{"title":84,"path":85,"stem":86},"Alberti","\u002Fciphers\u002Falberti","2.ciphers\u002F11.alberti",{"title":88,"path":89,"stem":90},"Playfair","\u002Fciphers\u002Fplayfair","2.ciphers\u002F12.playfair",{"title":92,"path":93,"stem":94},"Polybius square","\u002Fciphers\u002Fpolybius","2.ciphers\u002F13.polybius",{"title":96,"path":97,"stem":98},"Morse code","\u002Fciphers\u002Fmorse","2.ciphers\u002F14.morse",{"title":100,"path":101,"stem":102},"Bacon's cipher","\u002Fciphers\u002Fbacon","2.ciphers\u002F15.bacon",{"title":104,"path":105,"stem":106},"Tap code","\u002Fciphers\u002Ftap-code","2.ciphers\u002F16.tap-code",{"title":108,"path":109,"stem":110},"A1Z26","\u002Fciphers\u002Fa1z26","2.ciphers\u002F17.a1z26",{"title":112,"path":113,"stem":114},"Book cipher","\u002Fciphers\u002Fbook","2.ciphers\u002F18.book",{"title":116,"path":117,"stem":118},"ADFGVX","\u002Fciphers\u002Fadfgvx","2.ciphers\u002F19.adfgvx",{"title":120,"path":121,"stem":122},"Bifid","\u002Fciphers\u002Fbifid","2.ciphers\u002F20.bifid",{"title":124,"path":125,"stem":126},"Straddling checkerboard","\u002Fciphers\u002Fstraddling-checkerboard","2.ciphers\u002F21.straddling-checkerboard",{"title":128,"path":129,"stem":130},"Rail fence","\u002Fciphers\u002Frail-fence","2.ciphers\u002F22.rail-fence",{"title":132,"path":133,"stem":134},"Columnar transposition","\u002Fciphers\u002Fcolumnar","2.ciphers\u002F23.columnar",{"title":136,"path":137,"stem":138},"Route transposition","\u002Fciphers\u002Froute","2.ciphers\u002F24.route",{"title":140,"path":141,"stem":142},"Enigma M3","\u002Fciphers\u002Fenigma","2.ciphers\u002F25.enigma",{"title":144,"path":145,"stem":146},"Block","\u002Fciphers\u002Fblock","2.ciphers\u002F26.block",{"title":148,"path":149,"stem":150},"AES (ECB)","\u002Fciphers\u002Faes","2.ciphers\u002F27.aes",{"title":152,"path":153,"stem":154},"AES (CBC)","\u002Fciphers\u002Faes-cbc","2.ciphers\u002F28.aes-cbc",{"title":156,"path":157,"stem":158},"AES (CFB)","\u002Fciphers\u002Faes-cfb","2.ciphers\u002F29.aes-cfb",{"title":160,"path":161,"stem":162},"AES (OFB)","\u002Fciphers\u002Faes-ofb","2.ciphers\u002F30.aes-ofb",{"title":164,"path":165,"stem":166},"AES (CTR)","\u002Fciphers\u002Faes-ctr","2.ciphers\u002F31.aes-ctr",{"title":168,"path":169,"stem":170},"AES (CCM)","\u002Fciphers\u002Faes-ccm","2.ciphers\u002F32.aes-ccm",{"title":172,"path":173,"stem":174},"AES (OCB)","\u002Fciphers\u002Faes-ocb","2.ciphers\u002F33.aes-ocb",{"title":176,"path":177,"stem":178},"AES (LRW)","\u002Fciphers\u002Faes-lrw","2.ciphers\u002F34.aes-lrw",{"title":180,"path":181,"stem":182},"AES (XTS)","\u002Fciphers\u002Faes-xts","2.ciphers\u002F35.aes-xts",{"title":184,"path":185,"stem":186},"AES (CBC-MAC)","\u002Fciphers\u002Faes-cbc-mac","2.ciphers\u002F36.aes-cbc-mac",{"title":188,"path":189,"stem":190},"AES (passphrase)","\u002Fciphers\u002Faes-passphrase","2.ciphers\u002F37.aes-passphrase",{"title":192,"path":193,"stem":194},"Rijndael (ECB)","\u002Fciphers\u002Frijndael","2.ciphers\u002F38.rijndael",{"title":196,"path":197,"stem":198},"DES (ECB)","\u002Fciphers\u002Fdes","2.ciphers\u002F39.des",{"title":200,"path":201,"stem":202},"DESX (ECB)","\u002Fciphers\u002Fdesx","2.ciphers\u002F40.desx",{"title":204,"path":205,"stem":206},"Triple DES (ECB)","\u002Fciphers\u002Ftriple-des","2.ciphers\u002F41.triple-des",{"title":208,"path":209,"stem":210},"Triple DES (CBC)","\u002Fciphers\u002Ftriple-des-cbc","2.ciphers\u002F42.triple-des-cbc",{"title":212,"path":213,"stem":214},"Blowfish (ECB)","\u002Fciphers\u002Fblowfish","2.ciphers\u002F43.blowfish",{"title":216,"path":217,"stem":218},"IDEA (ECB)","\u002Fciphers\u002Fidea","2.ciphers\u002F44.idea",{"title":220,"path":221,"stem":222},"Lucifer (ECB)","\u002Fciphers\u002Flucifer","2.ciphers\u002F45.lucifer",{"title":224,"path":225,"stem":226},"MARS (ECB)","\u002Fciphers\u002Fmars","2.ciphers\u002F46.mars",{"title":228,"path":229,"stem":230},"Serpent (ECB)","\u002Fciphers\u002Fserpent","2.ciphers\u002F47.serpent",{"title":232,"path":233,"stem":234},"CAST5 (ECB)","\u002Fciphers\u002Fcast5","2.ciphers\u002F48.cast5",{"title":236,"path":237,"stem":238},"OpenPGP (passphrase)","\u002Fciphers\u002Fopenpgp","2.ciphers\u002F49.openpgp",{"title":240,"path":241,"stem":242},"Stream","\u002Fciphers\u002Fstream","2.ciphers\u002F50.stream",{"title":244,"path":245,"stem":246},"Rabbit","\u002Fciphers\u002Frabbit","2.ciphers\u002F51.rabbit",{"title":248,"path":249,"stem":250},"RC4","\u002Fciphers\u002Frc4","2.ciphers\u002F52.rc4",{"title":252,"path":253,"stem":254},"XOR","\u002Fciphers\u002Fxor","2.ciphers\u002F53.xor",{"title":256,"path":257,"stem":258},"Salsa20","\u002Fciphers\u002Fsalsa20","2.ciphers\u002F54.salsa20",{"title":260,"path":261,"stem":262},"XSalsa20","\u002Fciphers\u002Fxsalsa20","2.ciphers\u002F55.xsalsa20",{"title":264,"path":265,"stem":266},"ChaCha20","\u002Fciphers\u002Fchacha20","2.ciphers\u002F56.chacha20",{"title":268,"path":269,"stem":270},"XChaCha20","\u002Fciphers\u002Fxchacha20","2.ciphers\u002F57.xchacha20",{"title":272,"path":273,"stem":274},"ChaCha20-Poly1305","\u002Fciphers\u002Fchacha20-poly1305","2.ciphers\u002F58.chacha20-poly1305","i-lucide-library",{"id":277,"title":136,"body":278,"description":657,"extension":658,"links":659,"meta":660,"navigation":661,"path":137,"seo":662,"stem":138,"__hash__":663},"docs\u002F2.ciphers\u002F24.route.md",{"type":279,"value":280,"toc":649},"minimark",[281,285,289,294,297,309,385,388,396,400,430,512,518,522,525,568,575,579,582,608,612,619,623,645],[282,283],"cipher-facts",{"name":284},"route",[286,287,288],"p",{},"Write the text into a grid, row by row. Then walk through it along some path and read what you pass. Nothing gets replaced, every letter just ends up somewhere else. The key is the shape. How wide is the grid, where do you start, which way do you walk?",[290,291,293],"h2",{"id":292},"which-way-is-decode","Which way is decode?",[286,295,296],{},"Here it's the one that reads the path. Wikipedia and dCode do it the other way round. There the plaintext fills the rows and the ciphertext is the walk. So why flip it?",[286,298,299,300,304,305,308],{},"Because of how puzzles hand you the grid. You get a picture or a block of rows. The message shows up only once you walk it. That's decoding from where you're sitting. So ",[301,302,303],"code",{},"decode"," lays the text out in rows and reads the path. ",[301,306,307],{},"encode"," writes along the path and gives you the rows back.",[310,311,316],"pre",{"className":312,"code":313,"language":314,"meta":315,"style":315},"language-ts shiki shiki-themes ciphers ciphers ciphers","const route = create(\"route\");\nroute.decode(\"ABCDEFGHIJKL\", { width: 4 }).text; \u002F\u002F \"ABCDHLKJIEFG\"\nroute.encode(\"ABCDHLKJIEFG\", { width: 4 }).text; \u002F\u002F \"ABCDEFGHIJKL\"\n","ts","",[301,317,318,348,368],{"__ignoreMap":315},[319,320,323,327,331,334,338,341,345],"span",{"class":321,"line":322},"line",1,[319,324,326],{"class":325},"skH_V","const",[319,328,330],{"class":329},"s38Sx"," route ",[319,332,333],{"class":325},"=",[319,335,337],{"class":336},"sK71F"," create",[319,339,340],{"class":329},"(",[319,342,344],{"class":343},"shU9J","\"route\"",[319,346,347],{"class":329},");\n",[319,349,351,354,356,358,361,364],{"class":321,"line":350},2,[319,352,353],{"class":329},"route.",[319,355,303],{"class":336},[319,357,340],{"class":329},[319,359,360],{"class":343},"\"ABCDEFGHIJKL\"",[319,362,363],{"class":329},", { width: 4 }).text; ",[319,365,367],{"class":366},"scIB-","\u002F\u002F \"ABCDHLKJIEFG\"\n",[319,369,371,373,375,377,380,382],{"class":321,"line":370},3,[319,372,353],{"class":329},[319,374,307],{"class":336},[319,376,340],{"class":329},[319,378,379],{"class":343},"\"ABCDHLKJIEFG\"",[319,381,363],{"class":329},[319,383,384],{"class":366},"\u002F\u002F \"ABCDEFGHIJKL\"\n",[286,386,387],{},"That's this grid, read clockwise from the top left.",[310,389,394],{"className":390,"code":392,"language":393,"meta":315},[391],"language-text","A B C D\nE F G H\nI J K L\n","text",[301,395,392],{"__ignoreMap":315},[290,397,399],{"id":398},"the-paths","The paths",[286,401,402,405,406,409,410,413,414,417,418,421,422,425,426,429],{},[301,403,404],{},"width"," is the number of cells in a row. It's the one option you have to give. ",[301,407,408],{},"corner"," picks where the walk starts: ",[301,411,412],{},"top-left"," (default), ",[301,415,416],{},"top-right",", ",[301,419,420],{},"bottom-left"," or ",[301,423,424],{},"bottom-right",". ",[301,427,428],{},"path"," picks the walk.",[431,432,433,447],"table",{},[434,435,436],"thead",{},[437,438,439,444],"tr",{},[440,441,442],"th",{},[301,443,428],{},[440,445,446],{},"From the top left of the grid above",[448,449,450,464,476,488,500],"tbody",{},[437,451,452,459],{},[453,454,455,458],"td",{},[301,456,457],{},"spiral-clockwise"," (default)",[453,460,461],{},[301,462,463],{},"ABCDHLKJIEFG",[437,465,466,471],{},[453,467,468],{},[301,469,470],{},"spiral-counterclockwise",[453,472,473],{},[301,474,475],{},"AEIJKLHDCBFG",[437,477,478,483],{},[453,479,480],{},[301,481,482],{},"snake-rows",[453,484,485],{},[301,486,487],{},"ABCDHGFEIJKL",[437,489,490,495],{},[453,491,492],{},[301,493,494],{},"snake-columns",[453,496,497],{},[301,498,499],{},"AEIJFBCGKLHD",[437,501,502,507],{},[453,503,504],{},[301,505,506],{},"columns",[453,508,509],{},[301,510,511],{},"AEIBFJCGKDHL",[286,513,514,515,517],{},"A spiral turns inward until it runs out of cells. From another corner it starts along the edge its direction points to. Clockwise from the top right goes down first. So does counterclockwise from the top left. Columns and snakes start along the column under their corner, ",[301,516,482],{}," along the row.",[290,519,521],{"id":520},"the-gsmgio-opening","The GSMG.IO opening",[286,523,524],{},"The GSMG.IO puzzle opens with a 14 by 14 grid of colored squares. Black and blue are 1, white and yellow are 0. Copy it row by row, then walk it counterclockwise from the top left. Down the left column first.",[310,526,528],{"className":312,"code":527,"language":314,"meta":315,"style":315},"const grid = \"0011010010110011110011101011110111010010010110100001...\"; \u002F\u002F all 196 cells\nroute.decode(grid, { width: 14, path: \"spiral-counterclockwise\" }).text;\n\u002F\u002F \"01100111011100110110110101100111...\" as 8-bit ASCII is \"gsmg.io\u002Ftheseedisplanted\"\n",[301,529,530,548,563],{"__ignoreMap":315},[319,531,532,534,537,539,542,545],{"class":321,"line":322},[319,533,326],{"class":325},[319,535,536],{"class":329}," grid ",[319,538,333],{"class":325},[319,540,541],{"class":343}," \"0011010010110011110011101011110111010010010110100001...\"",[319,543,544],{"class":329},"; ",[319,546,547],{"class":366},"\u002F\u002F all 196 cells\n",[319,549,550,552,554,557,560],{"class":321,"line":350},[319,551,353],{"class":329},[319,553,303],{"class":336},[319,555,556],{"class":329},"(grid, { width: 14, path: ",[319,558,559],{"class":343},"\"spiral-counterclockwise\"",[319,561,562],{"class":329}," }).text;\n",[319,564,565],{"class":321,"line":370},[319,566,567],{"class":366},"\u002F\u002F \"01100111011100110110110101100111...\" as 8-bit ASCII is \"gsmg.io\u002Ftheseedisplanted\"\n",[286,569,570,571,574],{},"The first 192 bits say ",[301,572,573],{},"gsmg.io\u002Ftheseedisplanted",". The last four are leftovers. Nice opening, right?",[290,576,578],{"id":577},"cells","Cells",[286,580,581],{},"Every character is a cell, spaces and punctuation too. Line breaks aren't, they only lay the grid out. Paste the grid one row per line, it reads the same as one long string.",[286,583,584,585,588,589,592,593,596,597,600,601,604,605,607],{},"A short last row just ends in empty cells, and every path skips them. ",[301,586,587],{},"decode(encode(x))"," is ",[301,590,591],{},"x"," for any length. ",[301,594,595],{},"stripNonAlpha"," and ",[301,598,599],{},"preserveCase"," work as in every ",[301,602,603],{},"classical"," cipher. But ",[301,606,595],{}," throws digits out too. Leave it off for a grid of bits.",[290,609,611],{"id":610},"checked-against","Checked against",[286,613,614,615,618],{},"The Wikipedia route cipher example. Its grid, read clockwise from the top right, gives ",[301,616,617],{},"EJXCTEDECDAEWRIORFEONALEVSE",". And the GSMG.IO opening grid above, which gives the puzzle's first URL. Every path from every corner is pinned on the 3 by 4 grid, both ways.",[290,620,622],{"id":621},"errors","Errors",[286,624,625,626,628,629,632,633,635,636,639,640,421,642,644],{},"No ",[301,627,404],{}," is a ",[301,630,631],{},"MissingOptionError",". A ",[301,634,404],{}," below 2 or not a whole number is an ",[301,637,638],{},"InvalidOptionError",". So is a ",[301,641,408],{},[301,643,428],{}," that isn't on the lists above.",[646,647,648],"style",{},"html pre.shiki code .skH_V, html code.shiki .skH_V{--shiki-light:var(--shiki-token-keyword);--shiki-default:var(--shiki-token-keyword);--shiki-dark:var(--shiki-token-keyword)}html pre.shiki code .s38Sx, html code.shiki .s38Sx{--shiki-light:var(--ui-text-highlighted);--shiki-default:var(--ui-text-highlighted);--shiki-dark:var(--ui-text-highlighted)}html pre.shiki code .sK71F, html code.shiki .sK71F{--shiki-light:var(--shiki-token-function);--shiki-default:var(--shiki-token-function);--shiki-dark:var(--shiki-token-function)}html pre.shiki code .shU9J, html code.shiki .shU9J{--shiki-light:var(--shiki-token-string);--shiki-default:var(--shiki-token-string);--shiki-dark:var(--shiki-token-string)}html pre.shiki code .scIB-, html code.shiki .scIB-{--shiki-light:var(--shiki-token-comment);--shiki-default:var(--shiki-token-comment);--shiki-dark:var(--shiki-token-comment)}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":315,"searchDepth":350,"depth":350,"links":650},[651,652,653,654,655,656],{"id":292,"depth":350,"text":293},{"id":398,"depth":350,"text":399},{"id":520,"depth":350,"text":521},{"id":577,"depth":350,"text":578},{"id":610,"depth":350,"text":611},{"id":621,"depth":350,"text":622},"Text in a grid, read along a spiral, a snake or the columns. Decoding reads the path, so a grid copied off a puzzle page goes straight in.","md",null,{},true,{"title":136,"description":657},"X-10uBo2PCvCJKHRgwLEt4CViygZNvGwfpEGOCPz37s",[665,667],{"title":132,"path":133,"stem":134,"description":666,"children":-1},"The text fills rows under a keyword, columns are read out in the keyword's alphabetical order. Whitespace survives the round trip.",{"title":140,"path":141,"stem":142,"description":668,"children":-1},"The Wehrmacht machine with rotors I, II, III and reflector B. Rotor positions, ring settings, a plugboard. Reciprocal, so one setting works both ways.",1791184042728]