Proceedings of the Workshop on Foundations of Informatics FOI-2015, August 24-29, 2015, Chisinau, Republic of Moldova About Vigenere cipher modifications Eugene Kuznetsov Abstract TheaimofthisworkisamodificationoftheclassicalVigenere cipher, in order to improve the statistical properties of the ciphertext obtained after operation. The work deals with the (third) modification of the classic Vigenere cipher. Classic code is modified to a state in which it can already be implemented and analyzed. The necessary information from the theory of algebraic systems (fields, near-fields, groups, quasigroups, Latin squares, orthogonal tables etc.) is provided. Using the properties of these algebraic systems the modification of the cipher is constructed and studied. Keywords: Vigenere cipher, quasigroup, orthogonal tables. 1 Introduction This work is dedicated to oneof themost important aspects of information security software encryption methods. There are many reliable encryption algorithms now, but most of them have a significant drawback low speed of work. In this paper the famous Vigenere cipher will be discussed. The mere cipher is not of interest today, because there are simple hacking methods. But the principles laid down in it, potentially allow us to create quick and at the same time robust ciphers. The aim of this work is a modification of the classical Vigenere cipher, in order to improve the statistical properties of the cipher-text obtained after operation. The basis of modification of the classic cipher is an encryption methodby bigrams. Its essence lies in thefact that the original message is divided into pairs and each pair of symbols according c 2015 by E. Kuznetsov 312
About Vigenere cipher modifications to a certain law (special sequence table or tables) is encrypted in some other pair of symbols. The work deals with the (third) modification of the classic Vigenere cipher. Classic code is modified to a state in which it can already be implemented and analyzed. The necessary information from the theory of algebraic systems (fields, near-fields, groups, quasigroups, Latin squares, orthogonal tables etc.) is provided below. Using the properties of these algebraic systems the modification of the cipher is constructed and studied. Actually, these tables are a chip method, so they are paid a lot of attention. 2 Modified Vigenere cipher. 2.1 Polyalphabetic ciphers, Vigenere cipher. Vigenere cipher is a multi-alphabet advanced encryption system. The ideaofthecipheristouseasthekeythetextofanunencryptedmessage or an encrypted text. This cipher Vigenere described in his book A Treatise of ciphers. In its simplest form the basis of the table was taken Trithemius table which subsequently dubbed as the Vigenere s table. Vigenere s table consists of the alphabet shifted cyclically to the left by one character, but other permutations are available too. Additionally, the first line may be a randomly mixed alphabet. The encryption process is as follows: plain text (which must be encrypted) is written in a line with no spaces. Next, you must determine the key. Vigenere proposed to use as a key the plain text itself, adding to the top of the key a random selected symbol. But as a key it is possible to use any other sequence of characters equal in length to the plaintext. To produce the cipher-text we take the first letter of the plaintext as an index row in a table Vigenere and standing beneath the letter as a column. At the intersection of the pair of tables write out the character of the cipher-text. Then repeat these steps for each of the remaining characters. 313
E. Kuznetsov In order to decrypt the plaintext, you must know the cipher-text and the key. Take the first letter of the key, define the corresponding column in the Vigenere s table and run through it from top to bottom, until you meet the first character of the cipher-text. Once the desired character is met, we write a letter indicating this line, so we get the first character of the plaintext. We do the same steps for the remaining characters of the key and the cipher-text. In practice, in the programming of the encryption algorithm it is not necessary to have the Vigenere s table in memory, since the encryption algorithm can be represented by some algebraic formula based on such specific algebraic structures, as a field, near-field, orthogonal pair etc. 2.2 Algebraic concepts. Hacking classic Vigenere s cipher strongly relies on the presence of a codeword and its length. Therefore, if we save (slightly modified) an encryption method by bigrams, but to refuse from the code word, then the usual method of hacking will not act. Definition 1. Latin square of order n is a square table n n, where each row and each column contains numbers from 1 to n, and each number is found exactly once. Definition 2. The system G, is called a quasigroup if the following properties hold: 1. is a binary operation defined on the set G; 2. Each of the equations x a = b and a x = b has exactly one solution in G for any a,b G. From the algebraic viewpoint Latin square is a multiplication table of a quasigroup. Definition 3. A table of order n is called a selector if it satisfies one of the following conditions: x y = x or x y = y. In the first case the selector is called a right selector, in the second case the left selector. 314
About Vigenere cipher modifications If we take an arbitrary Latin square and a selector of corresponding dimension, the resulting pair of tables will have the property of orthogonality. That is, upon imposition of one of them to another, we obtain a table of pairs of symbols in which each pair of symbols appears exactly once. Algebraically this orthogonal property is described by the following definition. Definition 4. Two operations Q, and Q, on the same set Q are called orthogonal (or forming an orthogonal pair) if the following system { x y = a, x y = b, has exactly one solution in Q for any a,b Q. Definition 5. A near-field is a set Q with two binary operations + (addition) and (multiplication) defined on it, satisfying the following axioms: 1. Q, + is a commutative group; 2. (a b) c = a (b c) for all elements a,b,c Q; 3. (a+b) c = a c+b c for all elements a,b,c Q; 4. The set Q contains an element 1 such that 1 a = a 1 = a for every element a Q; 5. For each non-zero element a Q there exists an element a 1 such that a a 1 = 1 = a 1 a. Definition 6. If in the near-field Q the multiplication operation is commutative (a b = b a), then the resulting near-field is called a field. From the history of orthogonal Latin squares the following method of constructing a sufficiently large set of mutually orthogonal squares of order n is known (but only when n = p k, where p is a prime number, and k is a positive integer). 315
E. Kuznetsov Let Q,+,,0,1 be a near-field of order n. For any a Q we define a new operation x a y by the formula: x a y = a x+(1 a) y. This operation has the following properties: 1. x a y is a quasigroup, if a 0,1; 2. Operations x a y and x b y are orthogonal for any a b. Let the operations + and are set; then for the generation of orthogonal (n n)-tables we can use the formula x ij = a i+(1 a) j, where i,j {0,1,...,n 1}, and a {2,...,n 1}. 2.3 Procedures for encryption and decryption. The encryption procedure by bigrams is similar to the encryption process of the classical Vigenere s cipher, only the first bigram symbol is taken from the first table and the second bigram symbol is taken from the second table (instead of a key sequence, as it was done in the classic Vigenere s cipher). In other words, if we take the table of pairs resulting in the superposition of two orthogonal tables mentioned above, then the plaintext bigram (x, y) corresponds to the encryption bigram (a,b), which is located at the intersection of the x-th row and y-th column. This procedure is repeated sequentially for all bigrams of the encrypted text. Latin square in the algorithm described above can be changed to another Latin square. Orthogonality with the selector remains, and the encryption procedure does not change. The sequence of these squares (or its generation by any algebraic method) is defined by the secret key (or by periodic key sequence). It is easy to see that the statistical hacking algorithms stop working when the number of squares becomes substantially greater than 2. 316
About Vigenere cipher modifications It is easy to notice that the second character of bigram always remains the same after the procedure encryption. This may facilitate the probable hacking of this cipher. To avoid this we must use another Latin square (or (n n)-table) instead of the selector. It is important only that these two (n n)-tables will be orthogonal. To eliminate hack statistical methods it can be used several different tables instead of a single one. Then it is obvious that if more different tables to be used, then statistics of a source text will be violated stronger. The effect will be exactly the same as the increase in the length of a code phrase in the classic Vigenere s cipher. References [1] D. Kahn. The First 3,000 Years // The Codebreakers The Story of Secret Writing. New York: Charles Scribner s Sons, 1967, 473 p. [2] S. Singh. The Evolution of Secret Writing // The Code Book The Secret History of Codes & Code-breaking. London: Forth Estate, 2000, pp. 3 14. [3] A.J. Menezes, P.C. van Oorschot, S.A. Vanstone. Handbook of Applied Cryptography, 2002. [4] E. Kuznetsov, S. Novoseltsev. A modification of Vijener s cipher by the methods of non-associativity algebra. ASADE-2007, Abstracts, Chisinau, August 21-23, 2007, 86. Eugene Kuznetsov Received July 12, 2015 Eugene Kuznetsov Institution: Institute of Mathematics and Computer Science, Academy of Sciences, MOLDOVA Address: MD-2028, Academiei str., 5, Chisinau, MOLDOVA Phone: (373) 022 738029 E mail: kuznet1964@mail.ru 317