The Haselbauer-Dickheiser Test can be found at http://matrix67.com/iqtest/.

In this blog post, I will study Question 9 from this test.

The question is about deciphering a given ciphertext (referred to as “cryptogram”).

Below I present the original question for your convenience:

Please do not read the rest of this article, if you want to attempt to solve this question on your own. The rest of this article describes my attempt at solving this question and you should not read it, unless you want to or you do not mind coming across relevant ideas, spoilers, hints, solutions, and strong opinions concerning this test.

You have been warned and I now consider that you continue to read knowing that what you come across for the rest of this article may forever spoil things for you and/or present strong opinions against this test.

Last warning: please do not read this blog post, unless you are certain that you know what you are doing. If you are not sure, then it would be best if you stopped reading at this point.

OK. If you are here, it means that you want to know my opinion. Well, ok then!

Suppose we want to encrypt a message. We call the message “plaintext”. We call the encrypted message “ciphertext”. The encryption process takes the plaintext and produces the ciphertext. The decryption process takes the ciphertext and produces the plaintext. There are an infinite number of ways to do encryption/decryption. In this article, I use the words “decryption” and “deciphering” interchangeably. The same goes for “ciphertext” and “cryptogram”.

In this question, we are given the ciphertext and we are asked to do decryption, thus producing the plaintext. We are also told that the plaintext is a common phrase.

Just by looking at the ciphertext, I immediately noticed that it is composed of only 6 characters, the characters A D F G X V, which I list here in alphabetical order. And I immediately realized that 1 letter of the plaintext corresponds to 2 letters of the ciphertext. This is obvious, because the English language has 26 letters and with 6 available characters, we need 2 characters to represent each of the 26 letters. I immediately thought of the following square, which would help me represent a possible correspondence between the characters A D F G V X and the 26 letters of the alphabet. I also found cool that this 6 character encoding lets us fit the 10 numerical digits inside as well.

So, in the sample square above, the plaintext “g” is encoded as the ciphertext “DA”. And the ciphertext “DA” is decoded as the plaintext “g”. The plaintext “yes” is encoded as the ciphertext “VAAVGA”. And the ciphertext “VAAVGA” is decoded as the plaintext “yes”. And so on.

Of course, the letters and numbers may be shuffled inside the square to produce a different new square and thus, there are 36! such squares that can be produced. 36 factorial. Do not try to count so high. So, just by guessing, it is vitually impossible to find the particular square that was used to encrypt the plaintext. And brute-force calculations are out of the question, too, because of how big this number is. Actually, my analysis is not entirely acurate. The placement of the numbers should not matter, since I supposed we only have letters in the common phrase, and in hindsight I was correct. (Also, not all letters of the alphabet need to exist in the common phrase). Still, even though the placement of the numbers does not matter, the rearrangements of the letters are so many, that it is virtually impossible to guess or brute-force (which means: to examine each possible rearrangement one by one).

Anyway, I was pretty sure that this was the way the encrypted the plaintext. I was pretty sure they wrote the plaintext using only small letters (or capital letters, but not a mix) with no spaces and they encoded it using such a square. In hindsight, I was right.

Since the ciphertext is 90 characters long and two characters correspond to a letter from the plaintext, I immediatley knew that the plaintext was 45 letters long. So, the common phrase was 45 letters long. But what common phrase is 45 letters long? I could not recall any such phrase.

“rosesareredvioletsareblue”? Less than 45 letters.

“achainisonlyasstrongasitsweakestlink”? Still less than 45 letters.

“whenthegoinggetstoughthetoughgetgoing”? Still less than 45 letters.

“ajourneyofathousandmilesbeginswithasinglestep”? Exactly 45 letters! Bingo! No, in hindsight, this is not the phrase that was encrypted.

So, I was working from both ends. From one end, I was trying to analyze the ciphertext in order to decrypt it. From the other end, I was trying to find common phrases that were exactly 45 letters long, in the hope that one of them might be the one that was encrypted. And that could possibly help me.

After a short while, I discovered that this square that I coined is “a thing”. Is is called “the Polybius square”:

https://en.wikipedia.org/wiki/Polybius_square

Not only that, I also discovered that the encryption scheme that was used in this question is also “a thing”. It is called “the ADFGVX cipher”:

https://en.wikipedia.org/wiki/ADFGVX_cipher

Please read the contents of the above link carefully, because this is the theory that the question is based on. Of course, I should have expected it. In the Haselbauer-Dickheiser Test, virtually everything is borrowed and copied from other sources.

The Wikipedia article describes the ADFGVX cipher in considerable detail. It also shows how the encryption and the decryption is done. Last but not least, it discusses the cryptanalysis of the ADFGVX cipher, which is the ways that the cipher may be broken. But to say that to break this cipher is difficult, is quite an understatement. In other words, it is extremely difficult to break the ADFGVX cipher. But, please, get involved in doing so, if this is something that you like. In this blog post, I will not get into the cryptanalysis of the ADFGVX cipher.

“But why?”, you may ask. If I am not going to study the cryptanalysis of the ADFGVX cipher, then how am I going to provide the amswer to the question? Well, here is the thing! I was saved by the bell (or, in this case, the Internet). I came across an article in a web site that was about a person that solved this question. The site was a local site or an educational site (community, university, or something like that). The web page was discussing the achievemenst of this person, but the article was not technical in nature. But here is the thing: On the bottom of the web page, with no other relevant context, there was the phrase:

“inlifethereareonlytwocertaintiesdeathandtaxes”

45 letters! Bingo! I immediately knew that this was the common phrase. And since the question wants us to put the last word of the phrase in the answer line, the answer is

“taxes”

I checked the HTML source of the web page to see if I could find anything more, but I could not. After a few months, the site changed the appearance of its web pages, but each page kept the same content as before. With the exception of the web page in question, which lost the common phrase that had been previously lying on the bottom of the page. And now, I can no longer find the site itself.

But, now I know the common phrase. And the problem becomes easier.

So, the problem I had at hand was the following: Given the cryptogram of Question 9, and given that the common phrase is “inlifethereareonlytwocertaintiesdeathandtaxes”, how do these two correspond with each other? In other words, given this common phrase, what is the encryption process that produces the cryptogram? And given the cryprogram, what is the decryption process that reveals the common phrase? From now on, I will refer to this problem as the “reduced problem” and I will refer to Question 9 as the “original problem”.

OK, I know that tackling this reduced problem (instead of the original problem posed in Question 9) is cheating. But I will address non-cheating later. For now, I would like to address and solve this reduced problem. But before I give you the solution, dear reader, I would like you to pause and ponder. Can you solve the reduced problem on your own? Well, if you have solved the original problem already, then you do not need to answer this question! But if you have not solved the original problem as of yet, it might be beneficial for you to think about solving this reduced probelm. This way, you will be in a good postion to judge my writings, whereas if you just keep reading casually, you might not be in a good position to evaluate the rest of this blog post.

Anyway, here is how I solved the reduced problem. It only took me a few minutes. And I did not need to write any programs or do frequency analysis or any of the advanced techniques cryptanalysts use.

I viewed the ciphertext as a matrix with 6 rows and 15 columns. And I obtained the corresponding transpose matrix (also known as transposition matrix).

https://en.wikipedia.org/wiki/Transpose

The transposition matrix is obtained very easily by turning each row of the original matrix into a column. So, the first row of the original matrix becomes the first column of the transposition matrix. The second row of the original matrix becomes the second column of the transposition matrix. And so on.

Ciphertext:

```
A F F D X V X A A A G X X D F
X X F G G A F A F A G G X F G
A A X A A X X F X X F F F G G
A F X G G V G G A F F A A F G
V G G A X F X G X X F F A A F
X D F F F A V F D X F D D X F
```

Transposition matrix:

```
A X A A V X
F X A F G D
F F X X G F
D G A G A F
X G A G X F
V A X V F A
X F X G X V
A A F G G F
A F X A X D
A A X F X X
G G F F F F
X G F A F D
X X F A A D
D F G F A X
F G G G F F
```

And we are almost done! All that remains is to rearrange the 6 columns so that they correspond to the common phrase.

There are 6! = 720 permutations (arrangements) of the 6 columns. Only one of these arrangements corresponds to the common phrase. But since we know the common phrase, it is easy to find this unique arrangement. Here is how I did it. I opened Excel and copied the common phrase and the transposition matrix, as shown in the picture below.

The reason I made such a construct is the following: each letter from the common phrase corresponds to two characters from the ciphertext. After we rerrange the columns correctly, each letter from the common phrase will correspond to two characters from the ciphertext that will emerge, as follows: the first letter from the common phrase will correspond to the first two characters in the first row of the emerged ciphertext. The second letter from the common phrase will correspond to the third and fourth characters in the first row of the emerged ciphertext. And so on.

Actually, there are two possible “winning” rearrangenents instead of one. If a reaarangement is found, then by mutually switching columns 1st and 2nd, 3rd and 4th, 5th and 6th at the same time, a second equally valid rearrangement is produced.

Let us find one of these two rearrangements.

Looking at the Excel construct, it is easy to find the rearragnement that corresponds to the common phrase. Only a few tries of reordering (by cutting and pasting) columns are needed. Here is how I proceeded:

The first row and the the second row have the same letter “i” in the same place: first. So, the first column and the second column can only be the columns with first elements AA and XX, and since we are just starting we can choose the order these two columns will have, i.e. which will be first and which will be second.

Then I looked at the 4th and 5th lines. The have the letters “r” and “e” in common and in the same place. We already have the first two columns matching, so the third and fourth column (no order yet between them) will be those with FF and GG in these positions. Well, the order is the X and A for the first characters of these columns, since the order A and X was reserved for the letter “i”.

Line 2 and line 3 have the letter “e” in common. Looking at the 4 th and 5th lines, which contain the letter “e” in the second position, we can find the order of the 5th and 6 th column: A and then V.

Anyway, it is very easy to do and here is the solution.

But, as I said, there is one more equally valid solution, which is produced if we switch the 1st and 2nd, the 3rd and 4th, and the 5th and 6th columns. Here is the other solution:

As you saw, for each of the two equivalent solutions, I also provided the correspondence between letters and characters, both as a list and as a square (Polybius square or, could I possily call it “pivot table”?). Of course, the depiction of the list and the square is not needed, but I provided them for your convenience.

And this concludes the solution of the reduced problem.

I wrote that it took me a few minutes to solve the reduced problem. Well, at most. Perhaps it took me only a minute. I did not measure. But this was after I thought to obtain the transpose matrix and decipher it. Because my original thought was not that.

“Well, what was you original thought, Dimitrios? The ADFGVX cipher encyption/decryption process clearly states that transpose matrices are involved. This is the norm. This is the convention. How come you did not think of that?”, I think I hear you say to me, dear reader.

Well, I did think of transpose matrices. But, at first, I did not imagine that the test would be so easy as to demand the straightforward transpose matrix of the original ciphertext. The way I imagined it, I thought that the cretators of the question would want us to either consider the matrix as it is (with no transposition) and rearrange the 15 columns, or to obtain the transpose matrix but get it in a 15-column format as well. I would think that this last configuration is the actual convention, anyway.

Then, having obtain the transposed matrix but in a form that would still had 6 rows and 15 columns, we would have to rearrange the 15 columns. Since the rearrangement is done with a word key, we could have it easy! The word key had to be 15 letters wide and all letters had to be unique so they can be sorted alphabetically and unambiguously. And there are only two words in the Englsih langage, as far as I know, that have these properties: “uncopyrightable” and “dermatoglyphics”. So, one of these two words should be the key that was used to rearrange the 15 columns and the question would be about applying the decryption process without doing frequency analysis or any advanced cryptanalysis stuff.

But, in hindsight, I was incorrect. The creators of the question did not want us to think this way. They meant the ciphertext to be transposed to a matrix with 15 rows and 6 columns, and they wanted us to be very creative with cryptanalysis in order to find the correct rearrangement of the 6 columns. They meant the permutations to be only as low a number as 6! = 720. They meant the column number to be even, which helps a lot in deciphering this particular cipher. And they meant each line of 6 characters to correspond to 3 letters from the common phrase. So, they meant to throw in some conveniency in the ciphertext.

This would have been a question that I would have liked, if it was posed this way: We are given the transposition matrix (15 rows, 6 columns) and we are asked which rearrangement of the 6 columns corresponds to a common phrase. But since this question was not given in this form, I cannot “upvote” it.

I would like to clarify that the solution of this question, in the form that I propose here, is beyond the scope of this blog post. But it is an interesting question and one that you might want to tackle, if you like code breaking, dear reader. There are a lot of ways you might want to approach this problem. I would recommend the use computers and programming. To begin with, there are, as we have seen, 6! = 720 arrangements of the 6 columns and one of them (actually, two of them, as we have seen) is the “winning” arrangement. To find it, you need to be creative. Read the cryptanalysis section from the Wikipedia article I provided on the ADFGVX cipher. Takes cues and ideas from it. Create programs that produce all 720 arrangements and for each arrangement calculate statistics and frequency analysis. And try to match character combinations with letters and words (using a word list). There is room for many more ideas and I am willing to bet that you will come up with many more ever so brilliant ideas, dear reader.

But even if you do not want to use programming, there is another way, which I do not recommend. There are 6! = 720 arrangements. But, as I explained, each arrangement has an equivalent unique twin which is formed by switching the 1st and 2nd, the 3rd and 4th, and the 5th and 6th columns. So, arrangements go by twos, and you need to solve only one of the two, because due the symmetry of the problem, they are completely equivalent. So, the arrangements you need to consider are 720 / 2 = 360. Take each one, one day at a time. It will take you 360 days. For each of the 360 different arrangements you will have a problem equivalent to solving a code word crossword. But solving it with no letters as clues. Usually, code word crosswords give you a few letters as clues. But, I like to solve them without any such help. This was the reason behind my blog post

https://dkalemis.wordpress.com/2004/11/29/an-excel-vba-macro-for-cipher-crosswords/

in whch I created an Excel macro that would allow me to solve code word crosswords without any clues and without it being tedious. But doing that for 360 such code word crosswords, when only one (actually two, remember?, which are equivalent) is the “winning” one that actually corresponds to having real words, well… it is tedious. You better not go with this approach. Go with a programming apporach. It is more cool and glamorous. Do not be “old school” on that front. And this comes from me, who usually likes being “old school”.

Now that I have finished my analysis, I would like to present you with my failed approaches. I thought that the creators of the question wanted as to rearrange a 15 column matrix with a 15-letter word as key. In hindsight, I was incorrect, and the resulting 6 row and 15 column matrix does not correspond to the solution we are seeking. Still, I present my work, in case you might find interest in it, dear reader. But, again, the result of this decryption process is not what we are after, and this is because the decryption process (and especially how I obtained the transposition matrix) is not what the creators of the question had in mind.

So, here is my failed attempt using the keyword “uncopyrightable”:

```
CIPHER TEXT
A F F D X V X A A A G X X D F
X X F G G A F A F A G G X F G
A A X A A X X F X X F F F G G
A F X G G V G G A F F A A F G
V G G A X F X G X X F F A A F
X D F F F A V F D X F D D X F
TRANSPOSITION MATRIX
A X A A V X F X A F G D F F X
X G F D G A G A F X G A G X F
V A X V F A X F X G X V A A F
G G F A F X A X D A A X F X X
G G F F F F X G F A F D X X F
A A D D F G F A X F G G G F F
a b c e g h i l n o p r t u y
A X A A V X F X A F G D F F X
X G F D G A G A F X G A G X F
V A X V F A X F X G X V A A F
G G F A F X A X D A A X F X X
G G F F F F X G F A F D X X F
A A D D F G F A X F G G G F F
u n c o p y r i g h t a b l e
F A A F G X D F V X F A X X A
X F F X G F A G G A G X G A D
A X X G X F V X F A A V A F V
X D F A A X X A F X F G G X A
X F F A F F D X F F X G G G F
F X D F G F G F F G G A A A D
```

And here is my failed attempt using the keyword “dermatoglyphics”:

```
CIPHER TEXT
A F F D X V X A A A G X X D F
X X F G G A F A F A G G X F G
A A X A A X X F X X F F F G G
A F X G G V G G A F F A A F G
V G G A X F X G X X F F A A F
X D F F F A V F D X F D D X F
TRANSPOSITION MATRIX
A X A A V X F X A F G D F F X
X G F D G A G A F X G A G X F
V A X V F A X F X G X V A A F
G G F A F X A X D A A X F X X
G G F F F F X G F A F D X X F
A A D D F G F A X F G G G F F
a c d e g h i l m o p r s t y
A X A A V X F X A F G D F F X
X G F D G A G A F X G A G X F
V A X V F A X F X G X V A A F
G G F A F X A X D A A X F X X
G G F F F F X G F A F D X X F
A A D D F G F A X F G G G F F
d e r m a t o g l y p h i c s
A A D A A F F V X X G X F X F
F D A F X X X G A F G A G G G
X V V X V A G F F F X A X A A
F A X D G X A F X X A X A G F
F F D F G X A F G F F F X G X
D D G X A F F F A F G G F A G
```

I also tried other approaches, but I was always aiming for a 6-row 15-column matrix. so, I would consider the original ciphertext with no transposition, or the original ciphertext transposed, for one example, as follows:

```
CIPHER TEXT
A F F D X V X A A A G X X D F
X X F G G A F A F A G G X F G
A A X A A X X F X X F F F G G
A F X G G V G G A F F A A F G
V G G A X F X G X X F F A A F
X D F F F A V F D X F D D X F
TRANSPOSITION MATRIX
A X A A V X F X A F G D F F X
X G F D G A G A F X G A G X F
V A X V F A X F X G X V A A F
G G F A F X A X D A A X F X X
G G F F F F X G F A F D X X F
A A D D F G F A X F G G G F F
```

And I tried many other approaches, as well. And I would use the keywords “uncopyrightable” and “dermatoglyphics” in many of them. And I would try at least two methods: one where I would sort the letters first and then rearrange the letters to form the word, and another where I would first use the letters in the order the appear in the word and then sort the letters. I would transpose, or not transpose. And when I would transpose, I would use rows to columns, columns to rows, and other constructs, sometimes unconventional amd/or crazy. So, yes, I tried many different approaches, but I would always strive to end up with a 6 row 15 column matrix. And in hindsight, this was not what the question wanted. So, this is why I believe that this question would be better, if it were posed as follows:

A common phrase has been encrypted. The objective is to rearrange the 6 columns of the following cryptogam in order to decipher it and type the last word of this phrase in the answer box.

```
A X A A V X
F X A F G D
F F X X G F
D G A G A F
X G A G X F
V A X V F A
X F X G X V
A A F G G F
A F X A X D
A A X F X X
G G F F F F
X G F A F D
X X F A A D
D F G F A X
F G G G F F
```

And finally, I would like to point out that I did not expect that the authors of this question would have the audacity to use a common phrase that includes such a shocking and morbid word as the word “taxes”.