Thinking About Encryption, Part 27


I’m going to talk about Null ciphers this time. Both issues of the ACA Cm magazine I have contain Null ciphers, so I did wonder what they were, but not so much as to actually go read the description on the ACA website. I was more attracted to the idea of the Fractionated Morse cipher, which proved to be a lot more unpredictable than I’d expected. In order to have more examples to play with, I went to the ACA website and downloaded the archive PDF for years 2011 to 2015. At 6 issues a year, that gave me 30 issues to wade through, and 28 Frac. Morse ciphers to experiment on.

Then, I was glancing over all of the “how-to” articles in those issues, which included several related to Null, and its sister, the Sequence Null. The Sept.-Oct. 2018 issue of the Cm., which I’m still working on, has a Null cipher at the beginning of the Cipher Exchange section, marking it as one of the easier ciphers this time (the ciphers in any given department are sorted from easiest to hardest). So, why not?

So, Null ciphers are more mind bender puzzles than anything else, where the message is hidden in a series of plaintext words. One example could be:

PRETTY OBVIOUS NEW YEAR TRIAL ABUNDANT IDOL LADY

if you take the first letter of each word, you get “ponytail.”

conversely,

TRIGGER BARE SPREAD WISH FARE AREA DECLARED

uses the last letters to spell “redhead.”

However, while the ACA guidelines indicate that Null plaintext messages should not be longer than 25 letters, there can be exceptions. Just about any system can be employed: the letter immediately following or preceding a vowel, every second letter, every third letter, or every middle letter.

AGE BROOD DOG ADDLE ABE SAYER SPEED

gives “GOODBYE”.

As I went through the articles on Null, I compiled them in a VBScript. That covers the most obvious choices, but as the authors say, the attraction in creating new puzzles is in developing encryption methods that no one else has used before. That makes programming a solver an endless task. Everytime you think your solver is finally complete, someone finds another algorithm you’ve never seen before.

Really, I’m not good at mind benders. I want to see the answers, and then the next time I encounter something similar I’ll have enough experience to solve it then. But, no, usually I give them a pass if it takes more than a minute or two to solve. On the other hand, the Cm publishes the answers to the ciphers in the third issue after (so, the solutions to the Jan-Feb. issue appear in July-Aug.). The most recent archive PDF covers 2011-2015. While there’s nothing online after that, they do have PDFs for at least the 30 years before. That gives a massive amount of examples, plus solutions, to work with if I get stuck any time in the near future. And, as I say, when I find an encryption method I haven’t seen before, I’ll add it to the script. I’m just not in any rush to do all that homework right now.

So far, the Null patterns that I’ve collected from the 2001-2005 PDF archives include:

1, 2, 3, 4, 5 (one letter per word, repeat)
1, 2, 3 (one letter per word, repeat)
3, 4 (one letter per word, repeat)
1, 3, 2 (one letter per word, repeat)
1, 3, 5, 2, 4 (one letter per word, repeat)
Odd letter from groups of curved or straight letters (FNYL are straight, RUSO are curved)
3, 4, 5, 4 (one letter per word, repeat)
11235 Fibonacci (all words are 5 letters long, so take mod 5)
Letter before last E.
Second letter after second consonant
Unique letter from first or second half of alphabet
Third letters of each word.
3rd and 4th letters of each word.
Letter count: 1, 7, 7…
1st and 4th letter of words, read from back to front.

Despite my apparent waffling, I don’t actively dislike Null ciphers. I did solve the one in the Sept.-Oct. 2018 issue, so I am going to submit my answer for that for credit. As for next time? I’ll wait and see.

RIGID EAGER ALPHA LAUGH LOONY

Advertisements

Wiggles, part 23


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

WKYI MUJX KG YKFIYIJB HRPNZB YT RBBIJBUKJ KPB KG BZI HKVJIV KG YT AIGB ITI. UB DRW WYRAA RJX WUAFIVT. RB GUVWB, U BZKPNZB UB DRW R 500 TIJ HKUJ ($5), CPB U XUXJ’B ZIRV RJTBZUJN BZRB WKPJXIX AUMI R HKUJ GRAAUJN KV VKAAUJN RDRT. U NARJHIX UJ BZRB XUVIHBUKJ OPWB RW BZIVI DRW R “HAUHM.” BZRB WKPJXIX AUMI R XKKV HAKWUJN, CPB BZI KJI XKKV AIRXUJN KPBWUXI DRW AKHMIX RJX U DRW WBRJXUJN UJ BZI YUXXAI KG BZI KBZIV XKKVDRT. U AKKMIX CIZUJX YI, DZIVI BZI KDJIV RJX KBZIV WUJNIVW DIVI WBUAA WBRJXUJN KJ BZI WBRNI R GID TRVXW RDRT, BRAMUJN BK BZI RPXUIJHI RJX LKWUJN GKV YKVI LZKBKW. U AKKMIX CRHM RB BZRB HKVJIV, ZUXXIJ UJ BZI WZRXKDW CIZUJX WKYI CKSIW RJX KAX CVKKYW. BZRB GARWZ HKPAX ZRFI CIIJ R YKPWI, ISHILB U’X JIFIV WIIJ R YKPWI KPBWUXI KG BZI P.W. CRWI – ORLRJ UW HKYLAIBIAT KFIVVPJ CT GIVRA HRBW. UB DRW YKVI AUMIAT BK CI R HKHMVKRHZ, CPB BZI HKAKV DRW DVKJN. KV, YRTCI R DIUVX VIGAIHBUKJ KG BZI WBRNI AUNZBW KGG BZI XUWHK CRAA ZRJNUJN GVKY BZI HIUAUJN CIZUJX YI. CPB, BZIVI DRW BZRB HAUHM WKPJX…

Thinking About Encryption, Part 26


I have to admit, I’ve spent a LOT of time trying to implement only a handful of new cipher types as VBScript solvers, to the exclusion of writing these blog entries. At some point, I’m going to run out of stuff to post to this blog. At that time, I’ll have to apologize that there’s going to be nothing new to post here until I can back to it. Right now, I’ve got two more algorithms to discuss.


(The Portax system. Line A1/1 is keyed to C-D.)

The first one is Portax. This is a periodic substitution cipher similar to Vigenere in some respects, except that it doubles up half the alphabet. For encryption, you start with four rows, the top one of which slides left and right, and the bottom 3 stay fixed (or, depending on your terminology, it’s the other way around). To prepare, pick a keyword, and write your plaintext in rows under it.


(The pair B over U becomes J over E.)

GEORGE
——
icanno GALSKS
tellal XIPBBD
iewhic ACCDAI
hiswhy XMTEXJ
ileftp EDKBRO
olitic WBWBME
s….. Y
x….. L

The text is taken off in vertical pairs (i-t, c-e, a-l, …), and each key letter represents the starting position of the slider (A1/1). The first letter of the pair is placed in the grid in line A1, and the second letter is placed in line A2, to form opposite corners of a rectangle (the red squares in the example images). The ciphertext is taken off the grid from the other corners, the A1 character first, then A2 (the blue letters). So, if the key offset letter is C or D, and the plaintext pair is B-U, then the matching ciphertext pair is J-E. The only exception is when the pair is in the same column and there’s no rectangle. In this case, the cipher pair are the other two letters in the same column. In the below example, T-N becomes F-M. If the last row is incomplete, then use padding as necessary. Keep in mind, if you pad out the entire row, you’re giving a hint about the key width.


(X over H becomes Q over V.)

After all of the cipher pairs have been made, read off the cipher message in rows. Format in groups of 5.

GALSK SXIPB BDACC DAIXM TEXJE DKBRO WBWBM EYL


T over N is in the same column, so we use F over M.)

Deciphering is just the reverse process. Write down the key, write the cipher text in rows under the key, look up the rectangle corners in the table for the vertical pairs, sliding the A1/1 line in accordance with the corresponding key word letter, and read the plaintext off in rows.


(For the cipher pair T over D, the plaintext pair are independent of the key, and can be immediately read out as O over N.)

Now, the fun part comes in breaking this algorithm. I got this method from the Sept.-Oct. 2018 issue of the ACA Cm magazine, about a week after I’d sent in my answers for the ciphers I’d solved up to that point. The weakness of the Portax method is that the upper letters of the pair are not Vigenere-shifted if they’re between “N” and “Z”. This means that if you know the key width, you can immediately decipher any pair that starts with “N” through “Z”. (With the exception of pairs that are in the same column, and you’ll figure that out as you create more of the key). To get the key width, first check the length of the cipher text. The ACA guidelines say that the message length is period times 16-24 lines. For 100 characters, that’s a key between 4 and 7 letters. Try plugging in the plaintext for pairs starting with “N”-“Z” for each key width, and pick the width that generates the more recognizable English plaintext.

We could have just as easily started out by using Fig. 5 for the encryption and decryption phases, but it really works out well for cracking Portax. Note that if the cipher pair is T over D, then the plaintext pair is going to be O over N, completely independent of whatever key had been chosen.

GALSKS ___N_O
XIPBBD ___L_L
ACCDAI ______
XMTEXJ ______
EDKBRO ____TP
WBWBME ____IC
Y_____ S
L_____ X

Granted, my example is too short, but this is where I’d probably rely on the crib (a word that appears in the plaintext, provided as a hint). If the crib was “politics”, then that would obviously fit with the “P” at the end of line 5, up to the S at the beginning of line 7. And that can help reveal a large block of the keyword.

……
GALSKS ___N_O
XIPBBD ___L_L
ACCDAI ______
XMTEXJ ______
EDKBRO ____TP
WBWBME OLITIC
Y_____ S
L_____ X

With this much of the key, we can get the other letters in those blanks. Note that the key letter for a particular column represents the amount of shift of the A1/1 slider line in order to make the corners of the rectangle work out. So, if we look at blank over L on lines 5 and 6, which matches up with cipher letters D over B, L and B have to be in the same column. That happens with the third line down for A1/1, where the key letter would be E or F. The plaintext letter for the missing corner is then “L”.

…… GEOR
GALSKS ___N_O
XIPBBD ___L_L
ACCDAI ______
XMTEXJ ______
EDKBRO ILEFTP
WBWBME OLITIC
Y_____ S
L_____ X

I should mention that there are two choices for each key letter. The first letter of the key could be G or H. The second E or F. The third O or P. The fourth Q or R. Then G or H, and E or F again. If we run the letters through a Scrabble word finder, we’d probably only get “GEORGE” back out. But, in the ACA article on cracking Portax, the key used there could have been “RUBIK” or “QUAIL.”

…… GEOR__
GALSKS ICAN_O
XIPBBD TELL_L
ACCDAI IEWH__
XMTEXJ HISW__
EDKBRO ILEFTP
WBWBME OLITIC
Y_____ S
L_____ X

LIEWH___HISW hints at “which”, which may point to “whichiswhy”, and that would be enough to give us the rest of the key, “GEORGE,” and by extension, the rest of the plaintext. And yes, I intentionally left the typo in there.
“I CANNO TELL A LIE WHICH IS WHY I LEFT POLITICS”

Summary:
1) Portax is a poly-alphabetic substitution cipher similar to Vigenere.
2) The plaintext is written in rows under the key, and taken off in vertical pairs.
3) The pair of letters (i.e. – A over B) represent opposite corners of a rectangle.
4) The cipher text pair are the other two corners, in the order of top over bottom.
5) The alphabet slider (line A1/1) only covers the first half of the alphabet for the top letter of the pair.
6) If the pair are in the same column, then take the other two letters in the same column, top over bottom.
7) Portax has a huge weakness, in that if the top letter is “N” through “Z”, encryption is independent of the A1/1 slider, and can be used to display plaintext as-is.
8) This weakness can also be used to determine the key width – the correct width will produce the most readable plaintext from point 7.
9) Use Fig. 5 to get the key shifts for any plaintext words you can guess at, or for the crib if there is one.

Wiggles, part 22


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

OBJXJ QJXJ 4 DJXHZXGJXM HZX OBVO NKUBO, VNR OBJ ZOBJX OQZ BVR VIXJVRE RZNJ OBJKX MJOM VNR QJXJ VO ZNJ ZH OBJ OVYIJM, NSXMKNU OBJKX RXKNLM, MGZLKNU VNR QVOFBKNU LVQVUSGK-MVN MKNU. VO OBJ JNR, MBJ YZQJR, VNR JWJXEZNJ MOVXOJR VDDIVSRKNU VNR MBZSOKNU ZSO “LVQVKK” (“EZS’XJ FSOJ”). MBJ YISMBJR VNR OXKJR OZ QVWJ ZHH OBJ FZGDIJGJNOM, QBKFB TSMO GVRJ OBJ VSRKJNFJ MBZSO KO ZSO IZSRJX. K IZZLJR VXZSNR – OBJ ZQNJX QVM QZXLKNU BKM QVE SD OZ OBJ MOVUJ OZ GVLJ OBJ HKNVI VNNZSNFJGJNOM VNR DZMJ HZX DBZOZM QKOB LVQVUSGK. K LNJQ OBVO GE QZXL QVM ZWJX, MZ K JRUJR GE QVE VXZSNR OBJ MKRJ QVII OZ UJO OZ OBJ XKUBO MKRJ ZH OBJ MOVUJ, VNR OBJ RZZX OZ OBJ “UXJJN XZZG” VO OBJ YVFL JRUJ ZH OBJ MOVUJ. OBJ RXJMMKNU XZZG QVM TSMO IVXUJ JNZSUB OZ BZIR OBJ KNMOXSGJNOM ZH OBJ YVNRM NZO ZN MOVUJ, VNR GVEYJ 2-3 DJZDIJ, SNFZGHZXOVYIE, TSMO DXKZX OZ OBJKX UZKNU SD. OBJXJ’M V MJFZNR RZZX OBVO ZDJNM OZ OBJ MOVKXM SD OZ OBJ VXFVRJ, YSO OBVO QVM IZFLJR OZ LJJD DJZDIJ HXZG UJOOKNU KNMKRJ QBJN NZ ZNJ’M QVOFBKNU OBJ MOVKXM. K UZO OZ OBJ UXJJN XZZG, VNR OSXNJR OZ IZZL HZX GE USKOVX FVMJ.

Thinking About Encryption, Part 25


Two blog entries ago, I gave the impression that I’d covered all the transposition ciphers that the ACA (American Cryptogram Association) had to offer. Or, at least the ones I had any interest in. And, initially, that’s the impression I had as well. I only have two issues of The Cryptogram magazine right now, so I don’t have a lot of practical material to draw from. And, when you write up a bunch of solutions from any given issue, you have 4 months from the date of release to send in the answers for getting credit for finishing them (the ACA publishes everyone’s statistics in each issue). So, right after I sent in my answers for the July-August ciphers in September, I noticed that there was a Sequence Transposition cipher in the Expert Corner section. I went to the ACA website and looked in the Cipher Types page, but it wasn’t listed there. I posted a comment asking for help on the Facebook page, and was told to visit Bion’s pages (Bion has put together a number of explanations for different cipher types). Sequence Transposition is not one of the 60 standard types generally used by the ACA, which is why it wasn’t included in the regular cipher section of the Cm.

Anyway, according to Bion’s explanation, the basic idea is that you’re creating a string of decimal digits (0-9) that is used to sort the plaintext into 10 columns. To start this string, you pick a 5-digit primer number, and then sum the left two digits to create the next digit in the string on the right (if the sum is two digits, then drop the 10’s digit). Repeat this process for the length of the plaintext. Once this is done, you pick a 10-character key for establishing the sort order of the columns. This can be either a word or phrase, or pick the one’s digit from the letter position in the alphabet (K = 11 -> 1; L = 12 -> 2, etc.), or just make a 10-digit number with no repeating digits. Write the key out, write the plaintext in columns under the key, assigning letters to the columns based on the primer string, reorder the columns based on key order 0-9, and finally, take off the cipher text in columns from left to right.

For example, let’s use the plaintext: “I was wondering what the point is, after it’s been erased.”
I’ll pick 42983 as the primer, and 4681573902 as the key.

Step 1: Write out the plain text (no spaces or punctuation), and extend the primer underneath it. Start with “4” and “2” to get “6”, and append “6” to the right of the primer. Next, take “2” and “9” to get “11”, and append “1” to the right of “6”. Add “9” and “8” to get “17”, and put “7” to the right of “1”, and keep repeating for the length of the plaintext.

Iwaswonderingwhatthepointisafteritsbeenerased
429836171978806568611447258197390602962215843

Step 2: Write out the 10-digit key, and put the plaintext letters in the columns under the associated digits, based on the related digits from the primer string.

4681573902
Iosnadwaww
ohneiierit
itgeandfsb
ehtp.t.r.n
.tsa...e.e
.esr......

Step 3: Put the columns in order (either 0-9, 1-0, 9-0 or 0-1) and pull them off from left to right. I’ll use 0-9 order.

wisneeparwtbnewedIoieaiaohthtedintsngtssarfre

Step 4: (Which I didn’t mention before), place the primer at the beginning of the message, and put the characters in groups of five for readability. You can capitalize everything if you want. I just didn’t feel like making the extra effort.

42983 wisne eparw tbnew edIoi eaiao hthte dints ngtss arfre

Now, the decryption phase is actually a bit kludgy. When you have the primer, pull it out of the message, placing it on the line above or below the ciphertext, and extend it for the full length of the message.

429836171978806568611447258197390602962215843
wisneeparwtbnewedIoieaiaohthtedintsngtssarfre

Then do a frequency count for each digit.

0 - 3
1 - 6
2 - 5
3 - 3
4 - 4
5 - 3
6 - 6
7 - 4
8 - 6
9 - 5

The message recipient knows the cipher key, and now they’ve got the digit frequencies. Break the cipher message up in lengths based on those frequencies and the digit ordering (0-9 or 1-0)

0 - wis
1 - neepar
2 - wtbne
3 - wed
4 - Ioie
5 - aia
6 - ohthte
7 - dint
8 - sngtss
9 - arfre

Finally, go through the primer string one digit at a time, and write down the left-most letter of the string for that digit, while crossing it out from that string. That is, the first five primer string digits are 42983, so the first five letters of the plaintext become:

Iwasw

And the remaining letters in the queue are:

0 - wis
1 - neepar
2 - tbne
3 - ed
4 - oie
5 - aia
6 - ohthte
7 - dint
8 - ngtss
9 - rfre

Just keep doing this until you run out of cipher text.

Attacking Sequence Transposition is actually very simple, but you still need to use brute force against the key.

Given the ciphertext:

42983 wisne eparw tbnew edIoi eaiao hthte dints ngtss arfre

You know 2 things right away. First, you’re given the primer and the text length. Expand out the primer string. Second, with the primer string, you can get the frequency counts for each digit in the primer. This is all identical to the decryption phase, and you only need to do this once.

What we don’t know is the 10-digit key, which means we don’t know the order to pull the letters out from each row above. Was it 0-9, 9-0, 1-0 or 0-1? Also, what would things look like if we had used a different key? If the key was 1357908642, the string would be:

1357908642
Iosnadwaww
ohneiierit
itgeandfsb
ehtp.t.r.n
.tsa...e.e
.esr......

dintIoiewtbneohthtewissngtssarfreneeparwedaia

The strings are still intact, just out of order. So where does this leave us? Well, one option is to take the ciphertext and try slicing it up into different lengths based on the digit frequencies, and shuffle those bits about until the plaintext comes back out. Doable, but a bit complicated.

My approach is, again, to encipher the positions. We have the primer string, so we can do the following:

000000000011111111112222222222333333333344444
012345678901234567890123456789012345678901234
---------------------------------------------
429836171978806568611447258197390602962215843

0: 13, 32, 34
1: 06, 08, 19, 20, 27, 40
2: 01, 24, 35, 38, 39
3: 04, 30, 44
4: 00, 21, 22, 43
5: 15, 25, 41
6: 05, 14, 16, 16, 33, 37
7: 07, 10, 23, 29
8: 03, 11, 12, 17, 26, 42
9: 02, 24, 35, 36

I follow this with my permutating incrementer (123, 132, 213, 231, 312, 321) to run through all of the 10-digit key permutations, and unravel the ciphertext in numeric order. For Sequence Transpositions, the ACA members will include a “crib” (a word that appears in the plaintext). After unravelling the ciphertext using a given key, I can check if the crib exists in the string. If not, I just go to the next key value. If it does, I print out the string. It may be partially garbled, but that can give me a hint as to more of the plaintext, and I can refine the crib to reduce the number of false positives. Even with a 10-digit key, this brute force approach can find the solution in under an hour. That’s not too bad.

Summary:
1) Sequence Transposition starts with a 5-digit primer, and the transposition string is created by adding the digits 4 and 5 places to the left of the right edge of the string, and appending the 1’s digit of the sum to the right end of the string, and repeating for the length of the plaintext.
2) The key is a 10-digit number with no repeating digits. It is used to reorder the plaintext characters identified by the corresponding digits in the primer.
3) The primer is included as part of the cipher message.
4) The security of the encryption is based on the time needed to test all 10! permutations of the key.
5) It’s a fun algorithm to play with, but fairly easy to break.
6) Encrypting the plaintext positions and unravelling the cipher text in position order works pretty well for cracking ST.

Wiggles, part 21


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

W EPCU W UXH VGYER, FCYXGHC BSC FXL AUPCL SXI X YAGZVC ABSCL TGRH UALEWPT DAL SWQ, XPI APC AD BSCQ UAGVI SXJC BA YVCXP GZ XDBCL BSC ILGPE. FGB, NGHB AP BSC ADD-YSXPYC, W LXP GZ BSC HBXWLH XPI VAAECI GZ XPI IAUP BSC XLYXIC. WB UXH TCBBWPT YVAHC BA 10 ZQ, XPI BSCLC UXH X YSXPYC BSXB APC AD BSC VAYXV FCXB YAZH QWTSB FC ZXBLAVVWPT BSC XLCX HZCYWDWYXVVR DAL BSWH YXHC. BSC AIIH UCLC XTXWPHB QC, FGB QWLXYGVAGHVR W TAB GZ BA BSC XLYXIC NGHB XH X BXVV, BSWP TGR XPI SWH HSALBCL ZXLBPCL, FABS WP BSC VWTSB FVGC HSWLBH XPI IXLE FVGC ZXPBH BSXB QXLE X YAZ, BGLPCI BSC YALPCL DLAQ X PCXLFR YLAHH HBLCCB. W UXJCI BSCQ AJCL XPI ZAWPBCI IAUP XB BSC ILGPE, XPI HXWI, “XPA, YSABBA…” VWBCLXVVR, BSWH WH NGHB “GQ… X VWBBVC…) FGB WB XYBGXVVR BLXPHVXBCH BA “YAGVI RAG SCVZ QC, BSCLC’H X ZLAFVCQ SCLC.” BSC HSALBCL, HBAYEWCL AD BSC BUA WQQCIWXBCVR LCZVWCI, “UXEXBBX. QXEXHCLG.” (“TAB WB. VCXJC BSWH BA GH.”) FABS YAZH ZLAYCCICI BA ZLAI BSC TGR UWBS BSCWL FXBAPH, BLRWPT BA TCB SWQ BA UXEC GZ. W UCPB FXYE IAUP BA BSC FABBAQ AD BSC HBXWLH BA HWB NGHB WPHWIC BSC IAAL, ZXLBVR BA VCB BSCQ IA BSCWL NAFH, XPI ZXLBVR BA TCB XUXR DLAQ BSC HBWPE AD JAQWB XPI GLWPC.

Thinking About Encryption, Part 24


Cryptarithms are enciphered arithmetic problems, where the numbers are replaced by letters, often in a way as to make funny short sayings or jokes. In general, the ACA guidelines state that all ten digits (0-9) are used, and each letter represents one, and only one digit. Which means, for a problem using all ten digits, there will be 10 unique letters. The key to the problem is found by solving the equation(s), getting the values for each letter, and then writing out the letters in numeric order (either 1-9 and 0, 0-9, 9-0, or 0 and 9-1).

To reduce space in the ACA newsletter, The Cryptogram (Cm), the editors use a notation that I initially found confusing, and had to have explained to me by one of the more senior members. Addition is easy. The following is 2 parts of the same puzzle.

BANTER + ANNOYS = TSBYSGR. ANGERS + GANGSTER = GABYGBOR. (Two words, 0-9)

These are two separate sums and can be expressed as below (periods used to overcome wordpress’ stupid formatting limitations). The part in parentheses above says that the key will be two words, and the letters will be in order from 0 to 9.


..BANTER
+.ANNOYS
--------
.TSBYSGR

and
...ANGERS
+GANGSTER
---------
.GABYGBOR

Most people would use logic to solve this with paper and pencil. Not me. I’m too lazy, so I spent a week writing a VBScript program to autosolve this for me. Again, I repurposed my permutation incrementer (123, 132, 213, 231, 312, 321) to test the equations with each number combination, and stopped when the parts above the total line matched the answer beneath, To make this work, I developed a little algorithmic language for framing the problem. I put each part of the problem into an array, and then step through the array to solve each part one at a time. Syntax:

addToAry(N1, Operator, N2, Total)

Example:
addToAry(“BANTER”, “+”, “ANNOYS”, “TSBYSGR”)
addToAry(“ANGERS”, “+”, “GANGSTER”, “GABYGBOR”)

The script starts with the key (“0123456789”), determines what the unique letters are in the puzzle, and loops through the array, converting the letters to numbers, and trying to get the answers right. If the letters are in the order of BANTEROYSG, then the key value of 0123456789 would give the first equation as:

012345 + 122678 = 3807895

This is obviously wrong, so the script would ignore ANGERS + GANGSTER and increment to the next value to try again. The solution is STRANGEBOY (S=0, T=1, etc.).

Multiplication confused me at first, but it’s not that bad to figure out.

BRAINY * CUB = YCKBIN; + BIUCUCN; + INMBCBN; = IAIKAKKIN (Two words, 9-0)

Here, we need to rewrite the puzzle as:

...BRAINY
....* CUB
---------
...YCKBIN
.BIUCUCN
INMBCBN
---------
IAIKAKKIN

I frame this as:
addToAry(“BRAINY”, “*”, “B”, “YCKBIN”)
addToAry(“BRAINY”, “*”, “U”, “BIUCUCN”)
addToAry(“BRAINY”, “*”, “C”, “INMBCBN”)

All of the letters appear in these three lines, so there’s no real point in worrying about testing for “IAIKAKKIN”. The solution is MURKYCABIN.

Division could be considered a bit more complex, but it’s just a question of how you frame it. The answer is COLDNIGHTS

THINGS / GOOD = GH; – TTDNO = LCNS; – LLLH = TLO (Two words, 9-0)


.........GH
.....______
GOOD/THINGS
.....TTDNO
.....------
.......LCNS
.......LLLH
.......----
........TLO

addToAry(“GOOD”, “*”, “G”, “TTDNO”)
addToAry(“GOOD”, “*”, “H”, “LLLH”)
addToAry(“THING”, “-“, “TTDNO”, “LCN”)
addToAry(“LCNS”, “-“, “LLLH”, “TLO”)

Finally, we get to roots. The ACA puzzles use an old-style long-hand approach to finding a square, or cube root of a number. There are many youtube videos showing how this works. You can try watching this one, or any of the others. The main thing to keep in mind is that the number you’re taking the root of will have the digits grouped in pairs (for square roots) or triplets (for cube roots), for “ease of use.”

AC’RE gives root HU; – KH = ORE; – UTC = EFR (Two words, 0-1)

Again, framing is everything. I did have to develop a new notation for handling taking a number to a power (for finding cube roots), but that’s trivial to understand. The solution is: FOURTHCAKE = 0987654321

addToAry(“H”, “*”, “H”, “KH”)
addToAry(“AC”, “-“, “KH”, “O”)
addToAry(“ORE”, “-“, “UTC”, “EFR”)

What’s interesting here is that it’s not necessary to really understand the long division method, as long as you understand how the puzzle is framed to find out what the digits are for each letter, and that all of the letters are included in the framing. To show that I haven’t missed anything:

H = 5, and H^2 = KH = 25
AC – KH = O = 34 – 25 = 9
ORE – UTC = EFR = 971 – 864 = 107

Right here, this covers 60-70% of the AC cryptarithm puzzles. The majority of the rest involve non-base10 counting systems, such as octal or duodecimal (base-12). Some of the harder ones will have 20 letters (double key). Converting my script for other counting systems wouldn’t be that hard – I just haven’t sat down to do it. The double key ones might need another approach, because brute force will take too long. As it is, I’m happy with the solver right now. I even have a parser written to take the puzzles directly from the digital version of the magazine, and convert them into my format in bulk. That’s good enough for me.

On a related subject, the cryptorithms also include sudoku puzzles in letter form. The interesting thing here is that, somewhere in the solution, is the keyword for representing all 9 digits. That is, if the puzzle is:
-A——O T–O-L-N- NL-IV—- —-E—V A-LT–I–
–R-O—- -E——N R—–T– O—N–EC

when you’ve solved it, somewhere, forward or backward, either on one row, in a column, or in one of the 3x3s, will be an English word spelled out. Identify this location, and you have proof that you’ve solved this puzzle.

(Note that all of the above examples are meant to illustrate the types of Cryptarithms created by the ACA members, and I am in no way claiming ownership of them. If you would like to play with them yourself, visit the ACA website and become a member.)

Wiggles, part 20


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

ZRSOYV CRZ ZHMZ GE VSROT PRAZCGYS HMVO’Z KCZZYO MFF ZHMZ NMS LYNCSY JMAAUOK CRZ. ZHY LMS DMA FCPMZYV UO M PCIYSYV AHCJJUOK MSPMVY, DUZH HROVSYVA CN PMNYA, SYAZMRSMOZA, PFCZHUOK AZCSYA, KSCPYSE AHCJA MOV BYDYFSE AHCJA MFF BMGGYV UO M 6-LFCPT AQRMSY MSYM. ZDC DUVY DMFTDMEA, ZHY DUVZH CN M ZDC-FMOY AZSYYZ, PRZ ZHSCRKH ZHY MSPMVY, NCSGUOK 4 SCRKH AQRMSYA CN LRUFVUOKA. ZHUA ZCDO UA MZ AYM FYIYF, AC UZ VCYAO’Z HMIY M ARLDME AEAZYG, MOV IYSE NYD JFMPYA HMIY LMAYGYOZA. MPZRMFFE, GCAZ CN ZHY LRUFVUOKA HMIY MLCRZ 15 NYYZ CN ACFUV PCOPSYZY MOV SYLMS NCS MOZU-YMSZHQRMTY LMAYA, AC UZ’A SMSY ZC HMIY AJMPYA LYFCD KSCROV. LRZ, UO ZHY MSPMVY UZAYFN, ACGY CN ZHY LRUFVUOKA HMIY LMAYGYOZA, DUZH 2-3 AHCJA PCOOYPZYV LE M HMFFDME. ZHUA LMS DMA COY CN ZHY NYD UO M LMAYGYOZ, MOV ZCCT RJ ZHY YOZUSY NFCCS. ZHY AZMUSA SMO RJ NSCG ZHY NSCOZ VCCS ZC CJYO RJ MZ ZHY MSPMVY. GE VSROT HMV ZSUYV PSMDFUOK LMPT VCDO ZC ZHY LMS, MOV HMV JMAAYV CRZ UO M JCCF CN NUFZH M NYD AZMUSA VCDO.

Thinking About Encryption, Part 23


Implementing a solver for Redefence was as trivial as I’d hoped. This cipher type just takes Rail Fence and assigns a numeric key to the rails. The rails are pulled off in number order.


3 T---i---e
1 -h-s-s-t-s
2 --i---a---t

= hsstsiatTie (offset = 0)

Using the position enciphering approach gives me:


3 1---5---9
1 -2-4-6-8-A
2 --3---7---B

2468A37B159

As mentioned in the last blog post, my solver just needs an extra For-loop to generate each of the key permutations one at a time. And I then test the results of each permutation for how often the most common English 2-, 3- and 4-letter words show up. I do have to tweak the thresholds for each cipher message, because sometimes a partially scrambled message can have a higher hit count than the real plaintext message does. But that’s a minor issue.

For a key of length three, that’s: 123, 132, 213, 231, 312 and 321 potential key values to test.

For the ACA, the guidelines state that Redefence ciphers are 3-7 rows, with a character length of 10-15 times the number of rows. So, if the message is 47 characters long, that suggests a width of 4. However, the editors of the Cryptogram (Cm) magazine do occasionally stress that these are guidelines and that there’s no reason that the key width couldn’t be 3 (max. 45 characters long) or 5 (min. 50 characters). This does limit the search space for a brute force solver, but even with a key width of 7, my VBScript takes no more than an hour to test all permutations and message starting offsets.

After working on all these other transposition algorithms, I was thinking there was nothing left here for me to play with, and I was going to try to determine what the easiest substitution types were, to tackle one of those. Then, I noticed that the Sept.-Oct. issue of the Cm had something called the Nihilist Transposition. So, what the heck.

There’s not much I can easily find on NT in a yahoo search, so maybe this is one is specific to the ACA. Anyway, the idea is to write your plaintext message into a square, then apply a numbered key to both the rows and columns, and take each off in order. The weakness here should be obvious; The length of the ciphertext is going to be the square of the key length (so, you’re going to need to pad the plaintext to get it to the right length). That is, if the ciphertext has 81 characters, then the key is going to be 9 digits. The only strength to NT is that the brute force method will be time-consuming. But, it’s not that bad.


- 2431
2 This
4 ismy
3 test
1 xxxx

You can sort the rows first, or the columns – the results will be the same. Then, you pull off in either row or column order.

Columns first:


- 1234
2 sTih
4 yims
3 ttse
1 xxxx

Then rows:


- 1234
1 xxxx
2 sTih
3 ttse
4 yims

Pull off in columns: xstyxTtixismxhes
Pull off in rows –: xxxxsTihttseyims

If you have the key, deciphering just works in reverse. Write the ciphertext in columns or rows as required. That is:


1 xxxx
2 sTih
3 ttse
4 yims

Write the rows in key order:


2 sTih
4 yims
3 ttse
1 xxxx

And pull the plaintext out in column order.


- 1234
2 sTih
4 yims
3 ttse
1 xxxx


- 2431
2 This
4 ismy
3 test
1 xxxc

Thisismytestxxxx

To make the cipher a little more secure, use different letters for the padding at the end, or maybe put some of the padding at the beginning, or throughout the message.

Doesn’t really matter much though. Cracking NT through position enciphering is trivial. Just test each key permutation one at a time brute force, assign the positions to the cipher message, and print out the results with the most occurrances of short English words.


- 2431
2 0123
4 4567
3 89AB
1 CDEF

– 1234
2 3021
4 7465
3 B8A9
1 FCED

– 1234
1 FCED
2 3021
3 B8A9
4 7465

Enciphered positions:
FCED3021B8A97465
xxxxsTihttseyims

Summary:
1) Redefence is a simple transposition cipher that combines Rail Fence with a numbered key applied to the rows.
2) We can still use offsets for where we start writing the plaintext on the zigzag.
3) If you follow the ACA guidelines, the number of rails can be estimated based on the ciphertext length.
4) Redefence can be solved easily in software using a brute force approach, position enciphering, and counting the occurances of 3- and 4-letter words.

1) The Nihilist Transposition cipher is what the name says.
2) The grid used is a square, which gives away the key length.
3) The same key is used for enciphering the rows and columns.
4) The order for changing the rows and columns (rows first, or columns first) doesn’t matter.
5) You create the cipher text either by reading off the rows, or the columns.
6) The plaintext may need padding to have a square number of letters. If so, don’t use just one letter for the padding, and consider scattering the padding characters throughout the cipher.
7) NT can also be solved in the same manner as Redefence.

Wiggles, part 19


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

UVNL UN ONK KW HLWU NMZV WKVNY, KVNYN’F M ZVMLZN UN’TT OGJN KVN WKVNY RNYFWL KVN YGOVK KW ZMTT QF PE WQY RNYFWLMT LMXNF. PQK KVNL, KVN LMXNF UGTT PN FVWYKNLNA KW KVN CGYFK WLN WY KUW FETTMPTNF, MLA FWXN HGLA WC AGXGLQKGJN UGTT PN MAANA, TGHN “-ZVML” (CWY CNXMTNF) WY “-HQL” CWY XMTNF. KVN WTANY KVN WKVNY RNYFWL GF YNTMKGJN KW EWQ, KVN XWYN TGHNTE KVNE’TT QFN “ZVML” CWY PWKV XMTNF MLA CNXMTNF. GL ML WCCGZN, G’X KWTA, XMTN FQRNYJGFWYF XME QFN “-HQL” CWY UWXNL MF UNTT. MLEUME, KVN FGLONY WL FKMON UMF HMUMOQXG XMYGHW, MLA FGLZN UN’A DQFK XNK, MLA G’X M TGKKTN WJNY VMTC VNY MON, G LNNA KW PN XWYN RWTGKN MLA MAA “-FML” KW HMUMOQXG. HMUMOQXG-FML UMF FKGTT GL KVN RYWZNFF WC KQLGLO QR UVNL KVN PMYKNLANY ZMQOVK XE NEN MLA FKWWA QR FKYMGOVK, UGKV VGF MYXF ZYWFFNA. G LWAANA MLA UNLK WJNY KW KVN AWWY KW AW PWQLZNY AQKE MOMGL.