Wiggles, part 12


Just a little ongoing story to give you something to play with until the next blog post.

AZT PISIDTJT TKWUNIVTDA UJD’A QTIVVL TKWUNIVTDA. IA RUXXTQTDA AUCTJ, AZT 100 LTD BFUD UJ IYFWA EFQAZ $1, YWA UA PWJA ZIJ “100” FD AZT XQFDA IDR I XVFETQ FD AZT YIBH. AZT XUQJA SISTQ YUVV UJ 1000 LTD, IYFWA $10, IDR AZIA ZIR DIAJWCT JFJTHU FD AZT XQFDA XFQ I EZUVT, YWA BZIDOTR AF ZURTLF DFOWBZU IXATQ 2004 FQ JFCTAZUDO. JFJTHU UJ FDT FX PISID’J YTJA HDFED EQUATQJ, YWA U IVEILJ ZIATR ZINUDO AF QTIR ZUC UD JBZFFV YTBIWJT ZT EQFAT UD I JAUXX, FVRTQ PISIDTJT JALVT AZIA UJ ZIQR AF EIRT AZQFWOZ. DFOWBZU EIJ I QTJTIQBZTQ AZIA RUJBFNTQTR AZT BIWJIAUNT IOTDA FX JLSZUVUJ, YWA CFJA FX ZUJ QTJTIQBZ EIJ XIHTR. YIJUBIVVL, PISIDTJT CFDTL RFTJD’A QTIVVL XTTV VUHT CFDTL. ET VUHT ZINUDO CFDTL, YTBIWJT UA CTIDJ AZIA LFW BID JSTDR UA. ET RFD’A VUHT AIVHUDO IYFWA CFDTL, YTBIWJT AZIA JZFEJ I VIBH FX BVIJJ. JF, UDJATIR FX YQIOOUDO IYFWA ZFE CWBZ ET CIHT, ET JZFE FXX EUAZ ZFE CWBZ ET JSTDR FD YUO-AUBHTA UATCJ VUHT BIQJ, ZFWJTJ IDR TVTBAQFDUBJ. IDLEIL, RUR CFC HTTS ZTQ XUQJA 100 LTD BFUD, FQ 1,000 LTD DFAT, JZT CIRT XQFC ZTQ YIQ? FX BFWQJT DFA. JZT WJTR UA AF YWL CFQT DISHUDJ XFQ AZT AIYVTJ. RF U ZINT CL XUQJA 1,000 LTD DFAT XQFC EZTD U JAIQATR YWJHUDO? FQ, RF U HTTS I 100 LTD BFUD UD CL JZFT XFQ “TCTQOTDBUTJ?”

Advertisements

Thinking About Encryption, Part 15


It’s time to move on. I’d like to look at a few very well-known substitution ciphers – the Dancing Men, Pigpen, Goldbug, and Jules Verne’s runes. There’s nothing particularly useful that I can add to them that no one else has said, except that I want to approach them as an actual font system. Arthur Conan Doyle wrote The Adventure of the Dancing Men as part of The Return of Sherlock Holmes between 1903-04. It’s a simple substitution cipher, and Holmes goes through the entire process of frequency analysis to show how to break it. The thing is, it’s much easier to assign letters (A-R) to the dancing figures, and then do the frequency counts on the those, especially if you use ASCII-based software ala En/De.

If you standardize the heights of the figures, you can save them as individual image files, and substitute the filenames for the symbols themselves, although I expect that making a simple figure grid and writing the program in Java may be the best approach for something like this. I’ve noticed that Blogspot.com messes up the spacing between the individual character images, but wordpress seems to handle the images just fine. It’s clumsy, having to save the image files to a hosting site and then link to them in a blog like this. It would make a lot more sense to keep the images on the local PC, and make the filenames short (i.e. – “a.jpg”, “b.jpg”, etc.)

Doyle didn’t use every letter in the alphabet, and he didn’t assign symbols to digits. I have seen full tables on the net for “A-Z” and “0-9”, but they may not be canon. In the name of full disclosure, I do have to say that I used one of the images I found on the net for most of the characters. But that image had errors and missing text from the Doyle story. I then went to the Gutenberg Project for error checking, and the scans used in the HTML version of the short story there had mistakes, too. I’m reprinting the Dancing Men ciphertexts below, with the image files used on a letter-by-letter basis (without the errors, I hope) just to illustrate how this would work if you had a Dancing Man font. You could do a frequency count on the .jpg filenames to break the cipher, if you wanted.

The only thing I should mention about a “font approach” to the Dancing Men is the trickiness of handling spaces between words. The idea is that a man holding a flag is followed by a space. Obviously, Doyle rigged his figures so that the only letters holding flags in his story were those that had their arms extended out to the right of the reader. That allowed me to create two dedicated flag markers, one with the flag at the top, and the other with the flag at the bottom. This approach won’t work for figures that don’t have their arms out in the matching position. The only real alternative is to have two sets of alphabetic images – ones with the flags and ones without. Enciphering will then require checking letter pairs – if the second character of the pair is a space, replace both of them together with the corresponding figure holding the flag. Inelegant, but that’s part of Doyle’s legacy.

A similar approach is exhibited with the Pigpen cipher. Again, just replace the symbols with the letters “A-Z”, and treat it as you would any random substitution cipher. As described in the wiki article, this is also known as the masonic cipher, Freemason’s cipher, Napoleon cipher, and tic-tac-toe cipher. If you do use a photo hosting site to hold the image files, it’s a simple matter to write a VBScript file to store the direct image links in an array, and just substitute them into an html file for uploading to the net, if desired. There’s nothing fundamentally different between the Pigpen, and the Dancing Men ciphers.

Poe published The Gold-Bug in 1843. In 1840, he supposedly challenged his readers to send him any monoalphabetic cipher they wanted, and he claimed to have cracked the over one hundred submissions he received (a claim that William Friedman (who I will talk about later) says was probably horribly exaggerated). The Gold-Bug was written in response to the American public’s interest in cryptograms. The story itself doesn’t stand up well with time, but it is one of the earliest works of fiction to feature a cipher as being central to the story, as well as showing Poe’s development as a detective writer. I’m having trouble finding scans of the actual book page with the cipher on it. Most of the images on the net are second-hand copies, and the text used in the HTML version of the story on the Gutenberg Project has mistakes in it. If you can find a copy of The Works of Edgar Allan Poe, use that. The reason is that Poe used a slight trick where some of the characters are jammed up against each other to show a sentence break, and this trick is not replicated in any of the electronic copies of the cipher I can find.

As with the Dancing Men, it’s easier to crack this cipher by substituting the characters with the letters “A-Z” and then running the results through a decipher app. You have to add the word breaks yourself, but that’s a trivial thing. One or two words might be difficult to solve because a couple of the letters only show up once each, but you can take guesses as to what they’re supposed to be. Otherwise, there’s nothing really difficult about the Gold-Bug cipher. There’s no real point in creating a special font for it, since the symbols and numbers can be found in the Unicode-16 character set.

This is the cipher on the official Edgard Allan Poe Society website, and in the wiki entry.

53‡‡†305))6*;4826)4‡.)4‡);806*;48†8¶60))85;;J8*;:‡*8†83(88)5
*†;46(;88*96*?;8)*‡(;485);5*†2:*‡(;4956*2(5*—4)8¶8*;4069285); )6†8)4‡‡;1(‡9;48081;8:8‡1;48†85;4)485†528806*81(‡9;48;88;4 (‡?34;48)4‡;161;:188;‡?;

This is the version from the Gutenberg Project HTML version of the story, with corrections.

53‡‡†305))6*;4826)4‡)4‡.);806*;48†8¶60))85;1‡);:‡*8†83(88)5
*†;46(;88*96*?;8)*‡(;485);5*†2:*‡(;4956*2(5*—4)8¶8*;4069285);
)6†8)4‡‡;1(‡9;48081;8:8‡1;48†85;4)485†528806*81(‡9;48;(88;4
(‡?34;48)4‡;161;:188;‡?;

Note that while the official version of the instructions is “TWENTY ONE DEGREES AND THIRTEEN MINUTES NORTHEAST”, the Gutenberg version says “FORTY ONE DEGREES AND THIRTEEN MINUTES NORTHEAST”. I’m not sure if this difference is because of changes in editions between printings, or if it was an intentional alteration made by whoever typed up the Gutenberg version of the story.

Any symbolic substitution cipher can be implemented easily in VBScript as long as the symbols are stored as individual images in a path that VBScript can reach. In the following example, I assigned the letters “A-z” plus some punctuation to the cards in a playing card deck. I hardcoded my plaintext in the script, ran through the string one character at a time, looked up the characters in a matching array, and output the ciphertext in the form of “img src=” statements that I incorporated into an html file. I then screencapped that, and cropped it to another .jpg file using Gimp. You wouldn’t want to do this to send serious messages to your recipient, but as a challenge to your readers it’s ok. As with any symbolic substitution cipher, it may help to replace the symbols with letters or numbers, and then apply frequency analysis as you would with a normal substitution cipher.

Jules Verne apparently loved ciphers, and used them in a few of his stories, although he really wasn’t an expert in them. The first case for this was the “runic cipher” that appeared in his 1864 Journey to the Center of the Earth.


(From the wiki page)

The runes are in 21 groups of symbols, initially arranged 3×7, which isn’t important to the code. Essentially, Verne treats the “Icelandic runes” as a substitution cipher, where almost all of the runes have a single corresponding western letter, although one of them is a double-upped “mm”. I’ve gone through the wiki entry on runes, and the unicode rune tables, and while some of the characters do match up to Verne’s transliterations, the one he uses for “mm” is pretty much “kk” in all of the tables I’ve seen. I also had trouble finding some of the other characters. So, either Verne used an “official” runic character set that I haven’t found yet (he writes that it’s “in the magnificent idiomatic vernacular”), or he made up some of the runes. In the latter case, we just treat them as a simple random substitution cipher into Latin. (Letter frequencies here.)

ᛯ.ᛦᚳᛚᛚᛋ ᛅᛋᛦᛅᚢᛅᛚ ᛋᛅᛅᚴᛁᚦᛚ
ᛋᛇᛏᛋᛋᛘᚩ ᚢᚿᛅᛅᛁᛅᚩ ᚿᛁᛏᚦᛦᚴᛅ
ᚴᛏ,ᛋᛐᛘᚿ ᛐᛏᛦᛐᛏᛅᛋ ᛋᚤᚨᚦᛦᛦᚿ
ᛅᛘᛏᚿᛐᛅᛁ ᚿᚢᛐᛅᚴᛏ ᛦᛦᛁᛚᛋᛐ
ᛆᛏᚢᛐᛐᛦ .ᚿᛋᚴᛦᚴ ᛁᛅᛐᛐᛒᛋ
ᚴᚴᚦᛦᛘᛁ ᛅᛅᚢᛏᚢᛚ ᚨᛦᛐᚿᛏᚢ
ᚦᛏ,ᛁᛐᚴ ᚭᛋᛅᛁᛒᚭ ᚴᛅᚦᛁᛁᛁ
(From the Unicode table)

A few of the runes are thicker in some cases than others, implying that they are upper case versions of those letters, something I didn’t bother trying to emulate with the Unicode version. And, I faked a couple characters that aren’t in the tables, which I hope isn’t that obvious at first glance. But, none of these little details really matter because Verne immediately follows his runes with his letter substitutions.

mm.rnlls esrevel seecIde
sgtssmf vnteief niedrke
kt,samn atrateS saodrrn
emtnaeI nvaect rrilSa
Atsaar .nvcrc ieaabs
ccdrmi eevtVl frAntv
dt,iac oseibo KediiI

I actually had a little difficulty understanding the next step, because Verne gives an unsupported hint that there’s a Scytale transposition here, but leaves the details to the reader to figure out. Essentially, we’re just to put the columns one after the other, like this:

mm.rnlls
esrevel
seecIde
sgtssmf
vnteief
niedrke
kt,samn
atrateS
saodrrn
emtnaeI
nvaect
rrilSa
Atsaar
.nvcrc
ieaabs
ccdrmi
eevtVl
frAntv
dt,iac
oseibo
KediiI

Then read down the columns one character at a time (“mm” = one character), top to bottom, left to right. Note that some groups are 7 characters wide, others are 6. Ignore the shorter groups when you run out of letters. This gives us:

mmessvnkasenrA.icefdoK.segnittamvrtnecertse
rrette,rotaisvadvA,ednecsedsadnelacartniii
lvIsiratracSarbmVtabiledmekmeretarcsilvcoI
sleffenSnI

This is the stage that gives the Professor the biggest headache, but to me it was automatic to ask, “is the message reversed?” And of course, it was.

InSneffelsIocvliscrateremkemdelibatVmbra
ScartarisIvliiintracalendasdescende,Avdaxviator,
etterrestrecentrvmattinges.Kodfeci.Arnesaknvssemm

A couple notes that may or may not be useful: Latin doesn’t have a letter “j”, it is often rendered as “i”; plus, “v” is generally treated as “u” (i.e. – Ivlivs Caesar = Julius Caesar). Plus, “k” turns into “qu.”

Making these substitutions and adding word breaks, we get:

In Sneffels Joculis craterem quem delibat Umbra Scartaris Julii intra kalendas descende, Audas uiator, et terrestre centrum attinges. Quod feci. Arne saknussemm

I’m noticing a few inconsistencies between the text in the wiki entry and that on Online-literature.com. There is definitely a mistake in the ciphertext on Online-lit, where “ccrmi” should be “ccdrmi.” This has a big impact on the transposition step.

Finally, the translation from Latin to English is partly a matter of taste. Online-lit gives it as:

“Descend, bold traveller, into the crater of the jokul of Sneffels, which the shadow of Scartaris touches before the kalends of July, and you will attain the centre of the earth; which I have done, ArneSaknussemm.”

In the wiki entry, it’s:

“Descend, bold traveller, into the crater of the jökull of Snæfell, which the shadow of Scartaris touches (lit: tastes) before the Kalends of July, and you will attain the centre of the earth. I did it. Arne Saknussemm”

In keeping with the symbolic substitution font theme of this entry, just go to the Unicode rune table and grab the characters you want to use, create a random substitution look-up table and knock yourself out.

Just some final notes regarding chronology and timelines. According to the wiki entry, the first recorded use of Pigpen was in 1531, it was referred to as “The Kabbalah of the Nine Chambers,” and originally used Hebrew characters.

The Vigenere cipher was first described by Giovan Battista Bellas in 1553.

The Freemasons started using a variant of Pigpen in the early 1700’s.

Supposedly, Thomas Beale hides a mass of gold and jewels somewhere in Virginia in 1822, and has three letters placed in a lockbox in an inn, with orders that it not be opened unless no one claimed it within 10 years. (See below.)

Edgar Allen Poe issued his monoalphabetic cipher challenge in 1840, and published The Gold Bug in 1843.

Vigenere was finally cracked by Charles Babbage in 1854 (it was being used at the time by lovers to send secret messages to each other through the classifieds in London newspapers).

George Washington’s army knew about Pigpen, and it was used during the American Civil War (1861-1865) by Union soldiers held in Confederate prisons. The Confederacy used a brass cipher disk to implement the Vigenere cipher, but it was constantly being broken by the Union.

Jules Verne published Journey to the Center of the Earth in 1864.

Lewis Carroll described Vigenere as “unbreakable in his 1868 piece “The Alphabet Cipher” in a children’s magazine.”

James B. Ward publishes The Beale Papers in 1885, describing Thomas Beale’s supposed treasure. Only letter #2 is ever deciphered.

Arthur Conan Doyle ran The Return of Sherlock Holmes between 1903 and 1904, which included The Adventure of the Dancing Men. Doyle then used a book cipher for The Valley of Fear (1914-1915).

While I haven’t talked about the Beale Cipher yet, I’m including it here to show that there was enough public interest in ciphers up to 1885 as to explain why the theory that James Ward may have published his pamphlet as a hoax to make a quick buck may hold true. He could have been imitating the plot line (i.e. – a search for buried treasure) from The Gold-Bug.

Wiggles, part 11


Just a little ongoing story to give you something to play with until the next blog post.

ZMYGUEVT QH HKEYVWZ… EC’Z UEVW QH HDVVN. IGXU AOYV E AGZ KYGJJN NQDVT, E AGZ ZECCEVT GC QVY QH COY IGXU CGIJYZ QH LN LQL’Z ZVGXU IGK, WQEVT LN OQLYAQKU, AOEJY LN LQL GVW WGW AYKY QSYK GC COY IGK. WGW AGZ VDKZEVT GV EXY CYG GVW LQL AGZ HQJWEVT VGMUEVZ COY AGN ZOY GJAGNZ WEW CQ IY MDC QDC QV COY CGIJYZ. QVY QH COY QCOYK ZYKSEXY LYV XGLY EVCQ COY IGK CQ CGJU QSYK G IYYK. COY TDN VQCEXYW COY JECCJY TQQW JDXU ZOKEVY OETO DM QV COY AGJJ QSYK COY WQQK OY’W RDZC XQLY COKQDTO, GVW ZGEW, “EZ COGC AOYKY NQD UYYM NQDK HEKZC WQJJGK?” LN WGW RDZC ZLEKUYW, IDC LQL JQQUYW G IEC XQVHDZYW GC COY FDYZCEQV. “AON AQDJW E UYYM LN LQVYN COYKY? EH NQD WQV’C ZMYVW EC, EC’Z VQC AQKCO GVNCOEVT.” NYGKZ JGCYK, E GZUYW WGW GIQDC COGC, GVW OY CQJW LY GV GLYKEXGV COEVT GIQDC OQA ZLGJJ ZOQM QAVYKZ AQDJW HKGLY COYN HEKZC WQJJGK, QK HEKZC CYV-WQJJGK IEJJ, COYN’W LGWY GZ G TQQW JDXU ZNLIQJ. COYV OY ZOQAYW LY ZQLY GLYKEXGV LQVYN, AECO COYEK MEXCDKYZ QH AGZOEVTCQV, GVW AOQYSYK COQZY QCOYK TDNZ AYKY. “HQDVWEVT HGCOYKZ,” OY XGJJYW OEL. ODO.

Thinking About Encryption, Part 14


Why make your life any harder to deal with than it needs to be?
In other words, why create algorithmic ciphers that go way overboard on the complexity, require impossible to remember keys to use, and take longer than normal to encrypt and decrypt messages?

What’s the purpose of ciphers, anyway?

We can say that the use of ciphers falls into three broad categories. First is that it can be a hobby. People like making and breaking ciphers because it’s a mental activity that can be challenging and stimulating. Crypto-quips in the newspaper are much like Sudoku and the New York Times crossword puzzles. An author makes a message harder to read, and their audience attempts to read it anyway. It’s a good, clean game.

Then there’s the need to send data back and forth without it being intercepted and read by a third party. This is the more common interpretation of encryption, and is generally implemented through public key systems ala RSA and PGP. With these systems, we want encryption to be fast, seamless, and near-unbreakable (within the limits set by the government). We want the encrypted file to be relatively small so that it doesn’t impact file transfer times, and we want the decryption process to also be fast and seamless.

This is why we don’t see private key ciphers being used on a mass scale such that individual users would be attacking Vigenere or Playfair ciphers every day. Actually, public key systems (where the encryption key is made available to anyone that wants to send you a message) only encrypt the key that the software then uses on the message proper. So, if a software package did implement Vigenere for enciphering and deciphering your email, the Vigenere key would be encrypted with the public key cipher and sent to your recipient, before your message proper was sent. This is because the public key methodology is so slow. It’s fine for sending small packets, such as keys intended for other cipher systems, but not for larger 1-2 meg files. If you could intercept the actual encrypted message, you might be able to decipher it, if you know the algorithm the software package uses. The idea being, though, that the main encryption method is still going to kill you on a bruteforce approach.

Which brings me to the third reason, and this is central to the usage (or continued usage) of anything algorithmic like the Great Cipher.

The Rossignols were not only responsible for developing the nomenclators used by French diplomats and ambassadors living in other countries and sending missives back and forth to the court. They also ensured that the King’s personal letters, records and other documents would remain safe in the archives. If the Rossignols were the only ones that had a copy of the King’s nomenclator, then the court records could be retrieved and made human-readable again if necessary, but otherwise they were closed black boxes to everyone else.

This raises a different question – what do you do with your files to keep other people from reading them? During file transfer from one computer to another (or to a server and then to someone else), you want a simple, effective transfer encryption system, and RSA or PGP is fine for that. A unique system key is generated each time, and the message gets encrypted, sent, and then decrypted again on receipt. But, before and after transmission, anyone that has a copy of your file can read it, and that defeats the point of any system that is for “archival” use.

You can password protect your computer, or your portable drive media (USB memory sticks, or removable hard drives), but drives are prone to file or media corruption, and the last thing you want is to have so many back-up devices that you no longer know which device uses which password. Or, for the drive to get corrupted and become unreadable. You can put your files on the cloud, but cloud servers can be hacked. Even if you do password protect your PC, it’s still conceivable that someone could get their hands on it, pull the drive from the case, and use BIOS-level software to ghost the drive and access your files independently of the operating system.

Which brings us back to the Great Cipher. The GC’s main weakness laid with the sheer volume of documents that were archived using that one code. The advantage is that, if you’re going to archive your files, and you’re the only one that you want to be able to read them, you can create a software package that does all the work for you for encryption and decryption. A fully insane algorithmic cipher could have a 1024-code nomenclator with whatever traps you want to work into it, and rules that even you don’t understand anymore (as long as they’re repeatable). A “seamless” system would basically have to be drag and drop at the folder level. You could create any kind of directory structure you like, and you would drop a file anywhere along that structure. The nomenclator program would ask for a password, and you’d always use the same password every time, along with some verification method to ensure that the password is not mis-entered. Because the nomenclator is so complex, even if you encoded the same source document twice, you wouldn’t get the same ciphertext back out, so generating a massive amount of ciphertext with just one nomenclator/key won’t make it any easier to break that nomenclator. The reason for entering the password at all would be to let the nomenclator know that the authorized person was using it. Too many wrong entries and it could overwrite itself. You’d then just want to make sure that no one else knows that you’re using a nomenclator, while giving yourself protection somehow in case the nomenclator itself gets corrupted. And, maybe keep paper copies of all the documents you archive this way, so they’re harder to analyze in bulk.

Theoretically speaking, of course.

Wiggles, part 10


Just a little ongoing story to give you something to play with until the next blog post.

ZJWM WM UBQ UD ZJQ ZJWBXM DUNQWXBQNM JCZQ CLUVZ ZJWM POCFQ. BQCNOE QIQNE MWBXOQ UBQ UD HE FNCH MFJUUO QBXOWMJ ZQCFJQNM AUVOR FUHPOCWB CLUVZ JUA ZJQE’R DWBCOOE DUVBR MUHQ DNVWZ RNWBS, FCBRE LCN, UN MBCFS DUUR, MUHQZJWBX ZJQE FUVOR BU OUBXQN RU AWZJUVZ, ZJCZ ZJQE FUVORB’Z DWBR CBEAJQNQ CBEHUNQ. JQNQ, ZJQB XUBQ. LVZ, HE KCPCBQMQ DNWQBRM AUVOR KVMZ MJNVX CBR MCE “MJUVXCBCW” (“AJCZ FCB EUV RU CLUVZ WZ”). MU, AJCZ RU HE DNWQBRM RU? ZJQE ACWZ DUN MUHQZJWBX BQA, XQZ NQCOOE QYFWZQR, ACMZQ C OUZ UD ZWHQ ACWZWBX WB OWBQM ZU LQ CLOQ ZU ZNE WZ, ZNE WZ UBQ UN ZAU ZWHQM, ZCOS CBWHCZQROE AWZJ QCFJ UZJQN CLUVZ AJCZQIQN WZ ACM, ZJQB HUIQ UB AWZJ ZJQWN OWIQM, VBZWO ZJQ BQYZ ZWHQ. AJCZ AUNSM DUN PNURVFZM AUNSM DUN PQUPOQ. AJQB W XQZ ZU C BQA ZUAB, W POCE HEMQOD VP C OUZ, XQZ C DQA HUNQ FVMZUHQNM ZJCB BUNHCO WBZU ZJQ LCN W’H LUUSQR CZ, POCE C DQA HUNQ BQWXJLUNWBX LCNM, CBR ZJQB OQCIQ LQDUNQ ZJQ MJWB-JCZMVLCW ZJWBX AQCNM UDD. WZ’M C OUVME ACE ZU HCSQ OUBX-ZQNH DNWQBRM, LVZ W’IQ BQIQN LQQB UBQ DUN DNWQBRM.

True Gakken Kit for Adults


New DIY kit going up next door.

Partial construction of the ramp section. Notice that the wall beams aren’t anchored on one end yet. This is subassembly A.

All of the other parts have been taken out of the box and sorted prior to assembly.
Estimated time to complete the kit – 90 minutes.

Thinking About Encryption, Part 13


Generally, ciphers are considered to be of two types – transposition and substitution. In both cases, the cipher is usually treated as being separate from the plain and cipher texts. That is, you have the algorithm that is applied to the plaintext message in order to get the ciphertext out, or you have the reverse process that is applied to the ciphertext to get the plaintext back. The algorithm then is a set of rules independent of your plain- and ciphertexts.

But, with the introduction of the Great Cipher, we kind of get a code where the text includes instructions that modify the output as you decipher it. This code is not really present in the encryption phase, and in general there’s no good reason to want it to be. But, with the Great Cipher, in decryption we can have nulls (ignore this character code; i.e. – NOPs), and backspaces (delete last group).

I haven’t investigated every kind of cipher ever invented, so I don’t know if there’s a recognized third cipher type that’s called “algorithmic,” but that’s the name I’m going to use here. Theoretically, algorithmic ciphers can get as insane, convoluted and impractical as you want, and in fact, the more-so the better. Because the point is to implement them in software, it’s irrelevant as to whether a cipher algorithm can be understood by humans as long as the process can be replicated without error, and it regenerates the plaintext within some reasonable period of time.

This means that we can easily have two classes of algorithmics – “game theory types” (GTs) as described in the last blog entry, and nomenclators ala the Great Cipher. With GTs, you can think of a playing board or other surface that contains a substitution table of any size, including homophones, 2- and 3- letter combinations and whole words, and the ciphertext then contains the instructions for moving from one cell of the table to the next. Movement can be a single action (go north 3 cells), or a series of jumps with some kind of terminator (go NE 1 cell, north 3 cells, then SE 2 cells, and write whatever is in that last cell).

I’d now like to suggest a Logo turtle algorithm. Take the random substitution table (treat it like a 16×16 square checker board if you like) and place the turtle somewhere at random on the board (this is part of your key). I’m picking the UCBLogo implementation simply as an example, where PENDOWN tells the algorithm to write out whatever is in the cell below the marker, and PENUP means that writing is disabled during turtle movement. It is possible that some letters or letter-groups could be in adjacent cells (unlikely, but possible), in which case the turtle could cause the contents of several cells to be written out while the pen is down. Encryption is then a matter of taking the plaintext and deciding which turtle instructions you want to use to go from letter to letter on the substitution board. With decryption, you put the turtle on the correct starting square of the random substitution checkerboard table, pointing in the correct direction, and just follow the instructions in the ciphertext, recording the contents of the cells when the pen is “down.”

Ok, that was a game theory algorithmic. We’ve already seen nomenclators in the form of the Great Cipher, but let’s go full-out batcrap crazy. Think of a Turing Machine, or a CPU with a dedicated machine code set, and a programmable look-up table (the random substitution table, plus homophones and codes for 2- and 3- letter groups and full words). The cipher will be a combination of machine instructions and codes pointing into the look-up table. Our machine can also have a scramble table that takes a cipher code value (65h or 2FDh) and determines whether it is machine code or table data (although, in a pure sense, it’s ALL table data).

Within the machine, we could have something that looks like:
JMP – Jump to absolute address
JMR – Jump to a relative address
OFF – Set the table offset
ERA – Erase the last character
INC – Increment the table offset
DEC – Decrement the table offset
STO – Store the next value to the accumulator
XOR – XOR the next value against the accumulator
WRI – Write the next value unchanged.

0 = “A”
1 = “a”
2 = “B”
3 = “b”
4 = “the”
5 = “The”
6 = “ll”
7 = “ed.”

For amusement value, let’s make JMP = 100, JMR =101, OFF = 102, etc.

So, if the ciphertext looks like:
0 2 101 3 0 0 102 1 2 4

Then, the process would look as follows:

The first code (0) points to the lookup table, and comes out as “A”.
The second code (2) points to “B”.
The third code is jump relative + 3, moving the program pointer 3 more positions to the right.
The fourth code, programmatically, is 102, which sets the table offset to 1.
The fifth code is 2, but becomes 3 because of the offset, and we write “b”.
The final code is 4, which is offset to 5, and we write “The.”

The plaintext we get back out is “ABbThe”. It’s nonsense, but only because I’m just trying to illustrate the concept. The full nomenclator would provide a more “practical” version of the cipher. This is still the same approach as the Great Cipher, just updated to the computer age.

The keys would then consist of the nomenclator, whatever values you want preloaded to the accumulator and offset register, and even a “boot loader” for modding the machine code aspect of the nomenclator.

Like I said, because this cipher is only expected to be implemented in software, (and we’re not limited by message sizes or processing times), we can in effect make up all new human un-readable languages with every single message we send.

Would anyone in their right minds use such a thing when you have RSA, PGP and whatever other professional products are on the market? That’s the question for the next blog entry.

Wiggles, part 10


Just a little ongoing story to give you something to play with until the next blog post.

ZJWM WM UBQ UD ZJQ ZJWBXM DUNQWXBQNM JCZQ CLUVZ ZJWM POCFQ. BQCNOE QIQNE MWBXOQ UBQ UD HE FNCH MFJUUO QBXOWMJ ZQCFJQNM AUVOR FUHPOCWB CLUVZ JUA ZJQE’R DWBCOOE DUVBR MUHQ DNVWZ RNWBS, FCBRE LCN, UN MBCFS DUUR, MUHQZJWBX ZJQE FUVOR BU OUBXQN RU AWZJUVZ, ZJCZ ZJQE FUVORB’Z DWBR CBEAJQNQ CBEHUNQ. JQNQ, ZJQB XUBQ. LVZ, HE KCPCBQMQ DNWQBRM AUVOR KVMZ MJNVX CBR MCE “MJUVXCBCW” (“AJCZ FCB EUV RU CLUVZ WZ”). MU, AJCZ RU HE DNWQBRM RU? ZJQE ACWZ DUN MUHQZJWBX BQA, XQZ NQCOOE QYFWZQR, ACMZQ C OUZ UD ZWHQ ACWZWBX WB OWBQM ZU LQ CLOQ ZU ZNE WZ, ZNE WZ UBQ UN ZAU ZWHQM, ZCOS CBWHCZQROE AWZJ QCFJ UZJQN CLUVZ AJCZQIQN WZ ACM, ZJQB HUIQ UB AWZJ ZJQWN OWIQM, VBZWO ZJQ BQYZ ZWHQ. AJCZ AUNSM DUN PNURVFZM AUNSM DUN PQUPOQ. AJQB W XQZ ZU C BQA ZUAB, W POCE HEMQOD VP C OUZ, XQZ C DQA HUNQ FVMZUHQNM ZJCB BUNHCO WBZU ZJQ LCN W’H LUUSQR CZ, POCE C DQA HUNQ BQWXJLUNWBX LCNM, CBR ZJQB OQCIQ LQDUNQ ZJQ MJWB-JCZMVLCW ZJWBX AQCNM UDD. WZ’M C OUVME ACE ZU HCSQ OUBX-ZQNH DNWQBRM, LVZ W’IQ BQIQN LQQB UBQ DUN DNWQBRM.

Thinking About Encryption, Part 12


In thinking about the Great Cipher algorithmic approach, I’d linked up mentally with a different idea I’d been playing with. As mentioned last time, I want to find ways of relating ciphers to the math and physics stuff I’ve read about and don’t really understand. Initially, I visualized sine and cosine waves and I tried to find some way to have them tie to a transposition cipher, or positions in a substitution table. From there, I tried visualizing movements along a torus (topology) or a hypercube, or returning to sines and cosines and some way to crowbar in the Fourier transform. This last idea is not that farfetched, maybe, if the plaintext is represented as an infinitely repeating string of magnitudes of fixed width (i.e. – using ASCII values 0-127 to get a plaintext of: 84 104 101 32 119 111 114 108 100 32 105 115 32 102 108 97 116 46). The ciphertext would consist of frequency bin magnitudes, and the key could be either the “sampling rate” or the value of the time domain magnitude. I haven’t explored this idea enough to identify limitations, but the precision of the calculations and the number of terms in the ciphertext are going to be important.

A second option could be to divide a circle or sphere into 255 elements of varying width or volume. Random substitution tables could be mapped along the circumference or surface to make a homophonic distribution (the letters “e”, “t”, “a” and “i” would map to the larger elements), and the ciphertext would then be an angle for the circle, and two angles for the sphere.

Alternatively, the circle could be made into a kind of jigsaw puzzle, and the sphere into 3D blocks, and the ciphertext would be a set of vectors pointing to different “character spaces.” The key could be a combination of the substitution mapping table, and an initial rotational offset to create a “relative origin” for the circle or sphere.

I think, though, that one approach that could yield multiple variations would be the chessboard.

Starting with a regular 8×8 board, we could represent both the upper and lowercase letters (A-Z, a-z), the digits (0-9), the space and the period. Create a random substitution table and map it to each square of the board. The algorithm would be something as follows:

Establish the key as the starting square of the board, and which edge of the board is “White” or “Black.”
To get to each letter of the plaintext in sequence, pick a chess piece (i.e. – white Queen’s Bishop (WQB) or black knight (BKn)) and specify a move, or series of moves for a token placed on the starting square.

Moving the token in the direction of the White edge makes it a “black” move, and away from the White edge a “white” move.
If “White” is north, then moving “east” would be “King’s side” and “west” would be “Queen’s side.”
Finally, the key can also establish whether the edges of the board wrap, or reflect the token as it moves.

For example, say we have the above random substitution table, where the top edge of the table is the White player, and the bottom edge is the Black player. Moving to the right is “King’s side” and to the left is “Queen’s side.” The key is “44W,” meaning that the “token” is placed on square 4,4, which is the letter “D”, and moving past the edge of the board wraps you to the other side.

If the message is “This is a pain”,
then we can use a white pawn, white queen, or a white rook move for 2 spaces forward, or the white king for 2 moves of 1 space each, to get to “T” (WP2).
To get to “h” (4,2), we could move the token as a black rook or queen forward 4 spaces, or a black knight twice for f2,r1 and f2,l1. (BKn2ks1,2qs1).
To reach “e” (3,7), we could move the token left with a white knight move (f2,l1) followed by a white rook forward move by 3 spaces (Wkn2qs1,WR3). Or, a white rook or queen move left 1 and forward 5 (WQqs1,5). OR… a black knight forward move (f2,l1) to wrap around the board, followed by a black pawn move forward 1 (BKn2Qs1,BP1).
And so on.

To employ the entire ASCII set, make the board 16×16, but keep the rest of the rules the same.

If the chess moves make the encrypted file too big, then just encode the pieces (0=white pawn; 1=white rook; F=black knight) and directions as hex.

A second option is closer to having a checker, a direction spinner, and a square counter. We still keep the random substitution table on the 8×8 board, but now we number the cardinal direction points as N=1, NE=2, E=3, SE=4, S=5, SW=6, W=7, NW=8 (or assign the numbers randomly and make that part of the key). The last part of the key would be specifying the starting square for our checker.

Example:
66W (the checker starts on “F”, wrapping is allowed).
To get to “T”, we can go left (W=7) 2 spaces (72).
For “h”, north (N=1) 4 spaces (14).
For “e”, west 1, then south 5 (7155), OR west 1 and north 3 (7113) (wrapping).

Again, for the entire ASCII set, we can make the table 16×16.

An extra twist would be that after every “move,” the new “North” is whatever direction the checker had been moving in. That is, if you’re at “T” (4,6), and you go south 4 squares to “h” (4,2), then “north” is down. And, to get to “1” (3,2), you’d need to go east 1 square (31) or west 7 squares (77).

For anyone that loves 3D Tic-tac-toe, 3D checkers or 3D chess, we can add extra 8×8 boards (1 new substitution table per board), and allow for switching boards by making 0 “down” and “9” up, or whatever, followed by the number of boards to switch. I.e. – up 3 boards, allowing for wrapping = 93. For simplification, instead of random substitution tables, you could use Vigenere distributions for each board (1,1,1 = “A”; 2,1,1 = “B”, 3,1,1 =”C”, etc.). Then just implement the checker-and-spinner algorithm.

One last variation could be the “Cube.” You have 6 faces (8×8 boards), and each face is a separate substitution table. Going off the edge of one board takes you to the adjacent board. The key would be the table assignments, the starting position for the checker, and which direction on the starting board is “North.” Then, just use the checker-and-spinner rules.

And, as always, these ideas are all just theoretical, and are for the casual hobbyist to contemplate late at night over a glass of sherry and a fine cigar.

Wiggles, part 9


Just a little ongoing story to give you something to play with until the next blog post.

MDVL TZ MILLXTRO, XCYAOC. XCDX’Z XCL XCTRO DKYAX XCTZ BIDPL – XCL “ZCTR-CDXZAKDT LMMLPX.” TR VYZX YXCLS PYARXSTLZ, VDSNLXTRO JLBDSXVLRXZ WTII ZBLRJ VTIITYRZ YR SLZLDSPC, JLELIYBVLRX, MYPAZ OSYAB XLZXTRO, DRJ BAXXTRO RLW BSYJAPXZ YAX XY XLZX VDSNLXZ KLMYSL SLILDZTRO XCLV XY XCL SLZX YM XCL PYARXSG, YS XCL SLZX YM XCL WYSIJ. DRJ LELR DMXLS XCDX, XCLZL BSYJAPXZ WTII ZXDG YR XCL VDSNLX MYS GLDSZ TR D BSLJTPXDKIL “TRXSYJAPXTYR, OSYWXC, VDXASTXG, JLPITRL” ITMLPGPIL. RYX FDBDR, XCYAOC. CLSL, BLYBIL WTII KAG ZXAMM ZTVBIG KLPDAZL TX’Z RLW. ZY, PYVBDRTLZ WTII JAVB DII XCLTS VDSNLXTRO VYRLG TRXY DJELSXTZTRO, SLILDZL XCLTS RLW BSYJAPX, SLDB XCL ITXXIL KAVB TR ZDILZ XCLG OLX KLPDAZL, CLG, “ZCTR-CDXZAKDT” (ZCTR = “RLW”, CDXZAKDT = “YR-ZDIL”), DRJ XCLR BAII XCL BSYJAPX YMM XCL ZCLIELZ D MLW WLLNZ IDXLS XY VDNL SYYV MYS XCL RLQX RLW XCTRO.