K4: Not 2x2 Hill Cipher A-Z Alphabet
Wednesday, December 8, 2010 3:28:04 AM
For those that are interested, K4 is not a 2x2 Hill cipher using the standard English alphabet.
Here is my worksheet.
Yes, it was all done by hand with the help of a few tools to find modular inverses.
The decoded text gives this:
AHURUWRXOBEPRZKNKXNUWTTAVBMXJKEIAWSXKRCEHXAWGQNGEQDKODWFSUMAFQZWERLITRTUVLKEHHLKDKOZYIKYNXUMGQYS
That was NOT done by hand. I have my own tool to encode and decode Hill ciphers. The red section shows what should have been BERLIN. The reader may attempt to solve at a different position if they wish (one back or one ahead).
What would be nasty is if the encoding alphabet is different than the decoding alphabet. It could also be that the alphabet is homophonic at 31 or something like that.
I will try the KRYPTOS alphabet next just for fun. After that, I will try 3x3. I think I can write some code that can check all the remaining possibilities.
update: Using the KRYPTOS alphabet doesn't work. The letters two apart are both even. So I can't produce a diagonal. For 2x2, one could check regular alphabet for ciphertext and KRYPTOS alphabet for the plaintext. Other than that, you'd need different alphabets or even different alphabet lengths.
Here is my worksheet.
NYPVTT
BERLIN
0123456789012345
01234567891111111111222222
ABCDEFGHIJKLMNOPQRSTUVWXYZ
KRYPTOSABCDEFGHIJLMNQUVWXZ
24x + 15y = 4 17
21x + 19y = 11 8
24 15 | 4 17
21 19 | 11 8
168 105 | 28 119
168 152 | 88 64
168 105 | 28 119
168 152 | 88 64
--------------------
0 -47 -60 55
0 5 18 3
7
8
168
24 15 | 4 17
0 5 | 18 3
24 15 | 4 17
0 15 | 54 9
--------------
24 0 -50 8
24 0 2 8
24 0 | 2 8
0 5 | 18 3
*21 (modular inverse of 5)
0 105 | 378 63
---------------
24 0 | 2 8
0 1 | 14 11
3 22 | 19 9
0 1 | 14 11
3 22 | 19 9
0 22 | 308 242
---------------
3 0 | 23 1
3 0 | 23 1
0 1 | 14 11
*9
1 0 | 25 9
0 1 | 14 11
Final key:
25 14
9 11
Yes, it was all done by hand with the help of a few tools to find modular inverses.
The decoded text gives this:
AHURUWRXOBEPRZKNKXNUWTTAVBMXJKEIAWSXKRCEHXAWGQNGEQDKODWFSUMAFQZWERLITRTUVLKEHHLKDKOZYIKYNXUMGQYS
That was NOT done by hand. I have my own tool to encode and decode Hill ciphers. The red section shows what should have been BERLIN. The reader may attempt to solve at a different position if they wish (one back or one ahead).
What would be nasty is if the encoding alphabet is different than the decoding alphabet. It could also be that the alphabet is homophonic at 31 or something like that.
I will try the KRYPTOS alphabet next just for fun. After that, I will try 3x3. I think I can write some code that can check all the remaining possibilities.
update: Using the KRYPTOS alphabet doesn't work. The letters two apart are both even. So I can't produce a diagonal. For 2x2, one could check regular alphabet for ciphertext and KRYPTOS alphabet for the plaintext. Other than that, you'd need different alphabets or even different alphabet lengths.







