Ciphertext-only attack on π × π Hill in π(π13π ) Shahram Khazaei Siavash Ahmadi Fall 2015 [email protected] Outline Introduction The Hill Cipher Cryptanalysis of Hill Preliminaries COA on Hill using monograms Brute-force attack on Hill Divide-and-conquer attack on Hill CRT based divide-and-conquer attack on Hill Experimental Results Main References End Introduction Classical Cipher β Substitution β Transposition Examples: β β β β β β β Caesar Vigenere square Great Morse Code Pigpen Columnar Chinese cipher Introduction most of them are broken not only with Known Plaintext Attacks (KPA) but also with Ciphertext Only Attacks (COA) (with existence of some redundancy in the messages) Hill is one of the classical cipher which is not broken by COA. The Hill Cipher Invented by Lester S. Hill in 1929. Plaintext: π = (π1 , π2 , β¦ , πππ ) β Let ππ = (π πβ1 π+1 , π πβ1 π+2 , β¦ , π πβ1 π+π ) β Encryption: πΆπ = ππ πΎ π π πβ1 π+1 π π πβ1 π+2 . . . π π πβ1 π+π πβ1 π+1 πβ1 π+2 . . . = π πβ1 π+π Invertible π πΎ11 πΎ21 . . . πΎπ1 πΎ12 πΎ22 . . . πΎπ2 . . . . . . . . . . . . . πΎ1π . πΎ2π . . . . . . . πΎππ Final Ciphertext: πΆ = (πΆ1 , πΆ2 , β¦ , πΆπ ) It completely hides letter frequencies. over β€26 Cryptanalysis of Hill KPA on Hill: very easy! ππ1 , ππ2 , β¦ , πππ π»πππ (πΆπ1 , πΆπ2 , β¦ , πΆππ ) π linearly independent blocks of plaintext Cryptanalysis of Hill KPA on Hill: very easy! ππ1 , ππ2 , β¦ , πππ π»πππ (πΆπ1 , πΆπ2 , β¦ , πΆππ ) π linearly independent blocks of plaintext If : U= π π π π ππ1 , ππ2 , β¦ , πππ β1 Then: πΎ = π π &W= π π π π πΆπ1 , πΆπ2 , β¦ , πΆππ Cryptanalysis of Hill KPA on Hill: very easy! ππ1 , ππ2 , β¦ , πππ π»πππ (πΆπ1 , πΆπ2 , β¦ , πΆππ ) π linearly independent blocks of plaintext If : U= π π π π ππ1 , ππ2 , β¦ , πππ β1 Then: πΎ = π COA on Hill: &W= π π π π πΆπ1 , πΆπ2 , β¦ , πΆππ π It is generally accepted that COA on Hill does not work well. β Exhaustive search: β π = 26π 2 π π=1 2 π 26 matrix multiplication 1 β 2βπ 1 β 13βπ > 0.29 × 26π 2 Preliminaries English Language Properties. π»π : Entropy of n-grams π»1 = β π ππ log 2 ππ β 4.1718: Entropy of monograms Preliminaries For English : Preliminaries For English Preliminaries For English : Preliminaries Preliminaries Preliminaries COA on Hill using monograms Brute-force attack on Hill using monograms only Improve A divide-and-conquer attack on Hill Improve A CRT based divide-and-conquer attack They will find the key matrix up to an unknown permutation of its columns COA on Hill using monograms Brute-force attack on Hill using monograms only Improve A divide-and-conquer attack on Hill Improve A CRT based divide-and-conquer attack They will find the key matrix up to an unknown permutation of its columns The correct order of the columns can then be determined using diagram frequencies Brute-force attack on Hill π! matrices Brute-force attack on Hill π! matrices Exhaustive all the π 2 π 26 π! matrices Unicity distance: Unicity distance Hence, the computational complexity of the attack is: 3 π2 π2 π π 26 π! β π 26 Divide-and-conquer attack on Hill The Key Observation: π π πβ1 π+1 π π πβ1 π+2 . . . π π πβ1 π+π πβ1 π+1 πβ1 π+2 . . . = π πβ1 π+π π β1 πΎ11 β1 πΎ21 . . . β1 πΎπ1 β1 πΎ12 β1 πΎ22 . . . β1 πΎπ2 β1 . . . πΎ1π β1 . . . πΎ2π ... . ... . ... . β1 . . . πΎππ Divide-and-conquer attack on Hill The Key Observation: π π πβ1 π+1 π π πβ1 π+2 . . . π π πβ1 π+π πβ1 π+1 πβ1 π+2 . . . = π πβ1 π+π π β1 πΎ11 β1 πΎ21 . . . β1 πΎπ1 β1 πΎ12 β1 πΎ22 . . . β1 πΎπ2 β1 . . . πΎ1π β1 . . . πΎ2π ... . ... . ... . β1 . . . πΎππ β The monogram frequencies are still observed β Guessing a single column of πΎ β1 actually reveals all the correct columns Divide-and-conquer attack on Hill The best π candidates for the probable columns are the columns of a representative key matrix (with IC or IML). Using Theorem 1, the enough number of decrypted letters for almost uniquely determining each column of the decryption matrix can be calculated as: Therefore, the enough ciphertext length for obtaining the above amount of decrypted letters is equal to: The computational complexity of the attack is π π 2 26π It can be improved to π π26π by using pre-computations. CRT based divide-and-conquer attack on Hill The same procedure can be done in order to find the columns of the decryption key matrix modulo 2 and 13. Unicity distances: Now, to find a representative key modulo 26, the attack can be devised in two different ways using the CRT. CRT based divide-and-conquer attack on Hill First strategy: β Find representative key matrices modulo 2 and 13, πΎ (2) and πΎ (13) , respectively. β combine each of the d columns of πΎ (13) with all the d columns of πΎ (2) to extract π 2 new columns modulo 26 using the CRT. β The π columns with largest index (IC or IML) can be considered as a the representative key over β€26 . β The computational complexity is π(π13π + π2π + ππππ¦) = π(π13π ). 2 13 β The enough ciphertext length is max π0 , π0 = 74π 2 . CRT based divide-and-conquer attack on Hill Second strategy: β Find representative key matrices modulo 13, πΎ (13) , only. β For each column of πΎ (13) do the following: ο§ Consider the 2π β 1 columns over β€2 and compute the corresponding columns over β€26 using the CRT. ο§ Calculate the IML or IC for each one and choose the column with the largest index as a column of the representative key matrix over β€26 . β The computational complexity is π(π13π + ππππ¦ × 2π ) = π(π13π ). β The enough ciphertext length is 12.5π 2 Experimental Results π is a coefficient which say how bigger ciphertext length is used for simulation from unicity distance. Experimental Results The Second Strategy Experimental Results The Second Strategy Unicity distance: But, the success probability for ππ0 π 2 ciphertext length with π β₯ 4 and IML criteria is going to 1, which is equal to 1800 ciphertext length. The reason is that here, the decrypted string for a wrong key is not random enough. Experimental Results Blue scenario: β Meaningful text Red scenario: β Real text Main References 1. 2. 3. 4. 5. 6. C. Christensen. Polygraphic Substitution Ciphers: The Hill Cipher, II. http://www.nku.edu/~christensen/1402%20Hill%20cipher% 20part%20II.pdf, Accessed Summer 2015. O. Grosek and P. Zajac. Automated cryptanalysis of classical ciphers. In Encyclopedia of Artificial Intelligence (3 Volumes), pages 186β 191. 2009. L. S. Hill. Cryptography in an algebraic alphabet. In American Mathematical Monthly, pages 306β312. 1929. B. Hu. Introduction to Cryptology: Hill Cipher Remarks. http://www.cs.rochester.edu/~bh/csc290/hill.html, Accessed Summer 2015. J. Overbey, W. Traves, and J. Wojdylo. On the keyspace of the hill cipher. Cryptologia, 29(1):59β72, 2005. D. E. Robling Denning. Cryptography and data security. AddisonWesley Longman Publishing Co., Inc., 1982. End Siavash Ahmadi [email protected]
© Copyright 2026 Paperzz