Vous êtes sur la page 1sur 4

Analysis of Substitution and Permutation from Cryptanalysis Perspective

Dr. S.A.M Rizvi, Neeta Wadhwa Dept. of Comp. Sc., Jamia Milia Islamia, NewDelhi Abstract
Cryptography, which is considered as a science of present century is actually an ancient technique. Since early civilizations, different methods have been developed to send secret messages. But with advent of Internet, data privacy face more risks , thus need of information security increases which leads to the new developments of cryptography. In classic cryptography, mainly two techniques are used: SUBSTITUTION and PERMUTATION. And the fact is that Modern cryptography is mainly based on these two very basic techniques. This paper analyze the strength or security of Substitution and Permutation techniques from Cryptanalysis perspective. It presents a new product cipher SPS and also calculates the strength of the product cipher based on these two basic ciphers by calculating the time required for breaking the encrypted message. means word . Cryptanalysis is derived from the Greek words: kryptos, and analyein, means "to loosen" or "to untie" [1]. It is the study of methods for obtaining the meaning of encrypted information, without access to the secret information which is normally required to do so. Cryptanalysis is the flip-side of cryptography. It is the science of cracking codes, decoding secrets, violating authentication schemes, and in general, breaking cryptographic protocols[2]. Cryptography and Cryptanalysis comprise Cryptology. The science Cryptology is not a new science but it is quite an ancient art. Cryptography has a long and fascinating history [3]. The first recorded use of cryptography for correspondence was by the Spartans who (as early as 400 BC) employed as cipher device called a Scytale to send secret communication between military commanders [4]. In old times, from 1918 and until WWII, an encryption method known as the enigma was used in Germany. For this method, typewritten messages were encrypted by using a modified typewriter. And today, with the invention of computers and then Internet, we have explored a number of dimensions of this field. Cryptography can be broadly classified as : Classic Cryptography and Modern Cryptography. Classic cryptography involves : substitution and permutation and modern cryptography has Asymmetric cryptography , digital signatures , elliptic curve cryptography [5-7]etc. Polygram substitution blocks of plain-text characters are encrypted in groups into blocks of cipher-text Polyalphabetic substitution cipher is made up of multiple mono-alphabetic ciphers. The cipher changes with the position of each character in the plain text. It is used in American civil war.

Key Words: Cryptography, Cryptanalysis, Product


cipher, Substitution cipher, Transposition cipher .

1. Introduction
Cryptography is the art and science of making secure communication systems. The term is derived from the Greek words: kryptos means hidden and graphos

1.1 Substitution Ciphers


Substitution technique is one in which each character in the plaintext is substituted for another character in the ciphertext . The receiver inverts the substitution on the ciphertext to recover the plaintext [2]. For example: Ceaser , Hill, Playfair 1.1.1 Types of Substitution cipher: In classical cryptography there are 4 types of substitution cipher : Mono-alphabetic substitution / simple substitution cipher is, where each character in the plain text is replaced with a corresponding character of cipher-text. The cryptograms in newspaper are simple substitution cipher. Homo-phonic substitution cipher is like a simple substitution cipher except that a single character of plain-text can map onto several characters of ciphertext.

1.2 Permutation Ciphers


Permutation technique is one in which the plaintext remains the same, but the order of characters is shuffled around. It form the second basic building block of classic ciphers. In a simple columnar transposition cipher, the plaintext is written horizontally onto a piece of graph paper of fixed width and the ciphertext is read off vertically[2]. The core idea is to rearrange the order of basic units (letters/bytes/bits) without altering their actual values. A transposition cipher simply rearranges the symbols in plaintext to produce ciphertext.

The next section discusses the method. Section 3 illustrates the cryptanalysis of Substitution technique. Cryptanalysis of Permutation technique is shown in section 4. Implementation of SPS cipher is given in section 5. Then Conclusion is followed in section 6.

Fig 1: Algorithm for cryptanalysing the file encrypted with Substitution cipher File having encrypted text with substitution

2. Methodology
We implement each of the cipher in C language. First we encrypt the different size of files and then try to cryptanalyze them. While cryptanalysing the encrypted files, we assume that the cipher text stems from the English plain text. The standard frequency of English alphabets [8] is used for extracting the plaintext. Different algorithms offer different degrees of security; it depends on how hard they are to break. If the cost required to break an algorithm is greater than the value of the encrypted data, then the user is safe. Now question arises which one is best for securing the information. This analysis can be done by breaking an algorithm. An algorithm can be broken by testing different decryption algorithms and keys on the encrypted text.

Calculate frequency of every letter of file

Replace the letter having highest frequency with highest standard (do with all the letters)

Shift index of calculated frequency left

. 3. Cryptanalysis of Substitution
Statistical Analysis of a given file is done . It computes the relative frequencies of each letter in the cipher text. Afterwards compare the letter frequencies with those of the English language . The whole process described in fig 1 and fig 2 show the results.

Dictionary file

Compare with dictionary

Match?

Plain text

Fig 2 :Time Taken by Statistical Analysis w.r.t File Size


1400 1200 Time Taken(sec) 1000 800 600 400 200 0 1 5 10 50 file Size (Kb)

File with encrypted text Select order of matrix mxn s.t. m & n are less than half of total characters.

Create the matrix

Read row wise

Dictionary file

Compare with dictionary

4. Cryptanalysis for Permutation cipher


When ciphertext is given as the input, then it will be arranged in matrix form. Transpose of matrix is taken. The message is then written row wise and then is compared with dictionary file.all possible outputs are checked. The method is described in fig 3. Then we calculate the time required to extract the plain text shown in fig 4.

Match?

Plain Text

Fig 3: Algorithm for cryptanalysing the file encrypted with permutation cipher.

Fig 4: Time Taken for breaking Permutation cipher w.r.t file size
450 400 350 300 250 200 150 100 50 0 1 5 10 50 Size of File(Kb)

Fig 5: Time taken for breaking SPS cipher W.r.t File Size
1600 1400 1200 1000 800 600 400 200 0 1 3 6 9 File Size (Kb)

Time Taken(min)

5. Cryptanalysis of product of Substitution and Permutation SPS Cipher


File is encrypted with SPS cipher as
SPS CIPHER

File encrypted with substitution C= S(file)

Apply permutation C1=P (C)

Do Substitution C2= S ( C1)


C2 is first cryptanalyzed for substitution then permutation and then again for substitution as we did in previous sections. And we find that when we combine these two basic ciphers, the strength of cryptosystem increased a lot. The results of experiments are shown in fig 5.

Time Taken (min)

6. Conclusion
With the power of computers, substitution and permutation encryption can be easily cryptanalyzed, but when we combine these two classic techniques we got the strong cipher which is many many times more secure.The product of these two basic techniques is A BRIDGE FROM CLASSIC TO MODERN CIPHERS. With the advanced technologies , things are more complex these days, but the philosophy remains the same. The primary change is that algorithms work on bits instead of characters. This is actually just a change in the alphabet size: from 26 elements to two elements. Most good cryptographic algorithms still combine elements of substitution and permutation.

References
[1] W.Stallings; Cryptography and Network Security 2nd Edition, Prentice Hall,1999. [2] A.Menezes, P.van Oorschot and S. Vanstone, Handbook of Applied Cryptography, CRC Press, 1996. [3] D. Kahn, Codebreakers: The Story of Secret Writing, Macmillan, 1967. [4] Stamatios V. Kartalopoulos, The University of Oklahoma, A Primer on Cryptography in Communications, IEEE Communications Magazine April 2006. [5] WANG Yu-jie , Xu Zhan-wen, ZHENG shou-chun, Overview of Crytographic Technique, .Journal of Shenyang University of Technology. [6] Dawson E, He J, Another Aproach to Software key Escrow Encryption Information Security and Privacy,Berlin:SpringerVerlag,1996,87-95. [7] Young. A, The future of cryptography: practice and theory IT Professional, Volume:5, Issue: 4, July-Aug.2003 Pages:64,62-63. [8] Frances Yao , Professor Xiaotie Deng ,, Cryptographic Algorithms and Protocols lecture notes, University of Hong Kong.

Vous aimerez peut-être aussi