[{"data":1,"prerenderedAt":699},["ShallowReactive",2],{"navigation_docs":3,"-ciphers-book":276,"-ciphers-book-surround":694},[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":112,"body":278,"description":687,"extension":688,"links":689,"meta":690,"navigation":691,"path":113,"seo":692,"stem":114,"__hash__":693},"docs\u002F2.ciphers\u002F18.book.md",{"type":279,"value":280,"toc":679},"minimark",[281,285,289,395,398,403,420,424,445,459,462,466,472,504,514,547,553,571,575,578,602,605,609,636,640,675],[282,283],"cipher-facts",{"name":284},"book",[286,287,288],"p",{},"The key is a whole text. A novel, a song, a founding document. Both sides own the same copy, and the ciphertext is just numbers pointing into it. Beale hid a treasure description this way, or so the pamphlet says.",[290,291,296],"pre",{"className":292,"code":293,"language":294,"meta":295,"style":295},"language-ts shiki shiki-themes ciphers ciphers ciphers","const book = create(\"book\");\nconst verse =\n  \"Ask, and it shall be given you; seek, and ye shall find; knock, and it shall be opened unto you.\";\nbook.encode(\"seek and ye shall find\", { book: verse }).text; \u002F\u002F \"8 2 10 4 12\"\nbook.decode(\"13 3 4 20\", { book: verse, pick: \"letter\" }).text; \u002F\u002F \"KISY\"\n","ts","",[297,298,299,329,340,349,370],"code",{"__ignoreMap":295},[300,301,304,308,312,315,319,322,326],"span",{"class":302,"line":303},"line",1,[300,305,307],{"class":306},"skH_V","const",[300,309,311],{"class":310},"s38Sx"," book ",[300,313,314],{"class":306},"=",[300,316,318],{"class":317},"sK71F"," create",[300,320,321],{"class":310},"(",[300,323,325],{"class":324},"shU9J","\"book\"",[300,327,328],{"class":310},");\n",[300,330,332,334,337],{"class":302,"line":331},2,[300,333,307],{"class":306},[300,335,336],{"class":310}," verse ",[300,338,339],{"class":306},"=\n",[300,341,343,346],{"class":302,"line":342},3,[300,344,345],{"class":324},"  \"Ask, and it shall be given you; seek, and ye shall find; knock, and it shall be opened unto you.\"",[300,347,348],{"class":310},";\n",[300,350,352,355,358,360,363,366],{"class":302,"line":351},4,[300,353,354],{"class":310},"book.",[300,356,357],{"class":317},"encode",[300,359,321],{"class":310},[300,361,362],{"class":324},"\"seek and ye shall find\"",[300,364,365],{"class":310},", { book: verse }).text; ",[300,367,369],{"class":368},"scIB-","\u002F\u002F \"8 2 10 4 12\"\n",[300,371,373,375,378,380,383,386,389,392],{"class":302,"line":372},5,[300,374,354],{"class":310},[300,376,377],{"class":317},"decode",[300,379,321],{"class":310},[300,381,382],{"class":324},"\"13 3 4 20\"",[300,384,385],{"class":310},", { book: verse, pick: ",[300,387,388],{"class":324},"\"letter\"",[300,390,391],{"class":310}," }).text; ",[300,393,394],{"class":368},"\u002F\u002F \"KISY\"\n",[286,396,397],{},"That verse is Matthew 7:7, the key a spy uses in The Imitation Game. Good taste in keys.",[399,400,402],"h2",{"id":401},"whats-a-word","What's a word?",[286,404,405,406,409,410,413,414,416,417,419],{},"Letters and digits in a row, in any script, with the marks that sit on them. An apostrophe inside keeps it whole, so ",[297,407,408],{},"Nature's"," is one word. Anything else splits, so ",[297,411,412],{},"self-evident"," is two. Beale counted ",[297,415,412],{}," as two, and the dCode examples only add up with ",[297,418,408],{}," as one. So that's the rule.",[399,421,423],{"id":422},"words-or-letters","Words or letters",[286,425,426,429,430,433,434,437,438,441,442,444],{},[297,427,428],{},"pick: \"word\""," hands back the word itself, spelled as the book spells it. ",[297,431,432],{},"pick: \"letter\""," takes its first letter. That's the Beale trick: word 115 is ",[297,435,436],{},"instituted",", so it means I. Words come back with spaces between them. Letters come back uppercase and glued together. ",[297,439,440],{},"ß"," stays ",[297,443,440],{},", since its capital is two letters.",[286,446,447,448,450,451,454,455,458],{},"Encoding looks up each word, or each letter with ",[297,449,432],{},", and ignores case. ",[297,452,453],{},"STRAẞE"," finds ",[297,456,457],{},"straße",". Everything that isn't a letter or a digit is dropped.",[286,460,461],{},"Why not always the first match? Five Es with the same number is the first thing anyone attacking it looks for. So a repeat takes the next word that fits, and after the last one it starts over.",[399,463,465],{"id":464},"lines-and-pages","Lines and pages",[286,467,468,471],{},[297,469,470],{},"address"," sets how many numbers one place takes:",[473,474,475,486,495],"ul",{},[476,477,478,481,482,485],"li",{},[297,479,480],{},"word"," is the place in the whole book, like ",[297,483,484],{},"305",".",[476,487,488,491,492,485],{},[297,489,490],{},"line-word"," is the line, then the word in it, like ",[297,493,494],{},"12-3",[476,496,497,500,501,485],{},[297,498,499],{},"page-line-word"," is the page, the line on it and the word, like ",[297,502,503],{},"4-12-3",[286,505,506,507,510,511,513],{},"A line without a word doesn't count. A page ends at a form feed, which is exactly what ",[297,508,509],{},"pdftotext"," puts between PDF pages. Got a PDF of the right edition? Run it through ",[297,512,509],{}," and hand over the file.",[290,515,519],{"className":516,"code":517,"language":518,"meta":295,"style":295},"language-bash shiki shiki-themes ciphers ciphers ciphers","ciphers decode book \"4-12-3 4-12-7\" --book-file edition.txt --address page-line-word\n","bash",[297,520,521],{"__ignoreMap":295},[300,522,523,526,529,532,535,538,541,544],{"class":302,"line":303},[300,524,525],{"class":317},"ciphers",[300,527,528],{"class":324}," decode",[300,530,531],{"class":324}," book",[300,533,534],{"class":324}," \"4-12-3 4-12-7\"",[300,536,537],{"class":324}," --book-file",[300,539,540],{"class":324}," edition.txt",[300,542,543],{"class":324}," --address",[300,545,546],{"class":324}," page-line-word\n",[286,548,549,552],{},[297,550,551],{},"start: 0"," counts every word, line and page from zero. For puzzles written by programmers.",[286,554,555,556,559,560,563,564,567,568,570],{},"Decoding doesn't care how the numbers are dressed. ",[297,557,558],{},"12-3-5",", ",[297,561,562],{},"12.3.5"," and ",[297,565,566],{},"(12, 3, 5)"," read the same. Every number counts, in order, and ",[297,569,499],{}," takes them three at a time.",[399,572,574],{"id":573},"same-book-same-split","Same book, same split?",[286,576,577],{},"Not always. One copy has a preface, the other doesn't. One keeps the title, one starts at the first sentence. So every result says how the book split:",[290,579,581],{"className":292,"code":580,"language":294,"meta":295,"style":295},"book.decode(\"8\", { book: verse }).options;\n\u002F\u002F { address: \"word\", pick: \"word\", start: 1, words: 20, lines: 1, pages: 1 }\n",[297,582,583,597],{"__ignoreMap":295},[300,584,585,587,589,591,594],{"class":302,"line":303},[300,586,354],{"class":310},[300,588,377],{"class":317},[300,590,321],{"class":310},[300,592,593],{"class":324},"\"8\"",[300,595,596],{"class":310},", { book: verse }).options;\n",[300,598,599],{"class":302,"line":331},[300,600,601],{"class":368},"\u002F\u002F { address: \"word\", pick: \"word\", start: 1, words: 20, lines: 1, pages: 1 }\n",[286,603,604],{},"Compare those counts before you blame the cipher. The book itself stays out of the result. It can be a whole novel, and nobody needs it echoed back.",[399,606,608],{"id":607},"checked-against","Checked against",[286,610,611,612,615,616,618,619,622,623,618,626,629,630,633,634,485],{},"The dCode book cipher page, over the Declaration of Independence as the National Archives transcribes it, counted from \"When\". ",[297,613,614],{},"15 4 12 52 7"," with ",[297,617,432],{}," is ",[297,620,621],{},"DCODE",". ",[297,624,625],{},"221 132 136 305",[297,627,628],{},"by of of King",", or ",[297,631,632],{},"BOOK"," in letters. And the Wikipedia page on the Beale ciphers: word 115 is ",[297,635,436],{},[399,637,639],{"id":638},"errors","Errors",[286,641,642,643,646,647,650,651,653,654,656,657,660,661,664,665,559,667,670,671,674],{},"A number past the end is a ",[297,644,645],{},"CipherError"," that says what it looked for and how many there are: ",[297,648,649],{},"Word 40 is out of range: the book has 20 words, numbered from 1",". Numbers that don't split into whole addresses are a ",[297,652,645],{}," too. So is a word the book doesn't have. No ",[297,655,284],{}," is a ",[297,658,659],{},"MissingOptionError",". A book without a single word is an ",[297,662,663],{},"InvalidOptionError",", and so is an ",[297,666,470],{},[297,668,669],{},"pick"," or ",[297,672,673],{},"start"," it doesn't know.",[676,677,678],"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":295,"searchDepth":331,"depth":331,"links":680},[681,682,683,684,685,686],{"id":401,"depth":331,"text":402},{"id":422,"depth":331,"text":423},{"id":464,"depth":331,"text":465},{"id":573,"depth":331,"text":574},{"id":607,"depth":331,"text":608},{"id":638,"depth":331,"text":639},"Each word or letter as the place of a word in a text both sides own. By word number or by page and line.","md",null,{},true,{"title":112,"description":687},"X1r6Ph-UmEOLvWENAgu4nlylXFb89t4Boqm51JkUnp4",[695,697],{"title":108,"path":109,"stem":110,"description":696,"children":-1},"A is 1 and Z is 26. Every letter as its place in the alphabet. Plus the single digit form where letters stand for digits.",{"title":116,"path":117,"stem":118,"description":698,"children":-1},"The 1918 German field cipher. A 6×6 grid writes each letter or digit as two of A D F G V X, then a second key shuffles the columns.",1791184042412]