Classical Encryption Techniques Gowtham Reddy Uppunuri Department of Electronics and Communication National Institure of Technology, Raipur Raipur, India gowthamreddyuppunuri137@gmail.com Abstract—This document details some of the classical encryption techniques and these techniques are explained with examples. Keywords—encryption, decryption, plain text, key, cipher text. I. INTRODUCTION Now-a-days information is being received and sent in an open networked systems. It is being misused by means of attacking at various levels in communication. Encryption of data is the best solution to counteract the attacks. There are two types of encryption which are in use and are called as i) Symmetric-key encryption using private keys and ii) Asymmetric-key encryption using both public and private keys. Symmetric-key algorithms are usually 1000 times faster than public-key algorithms. Symmetric-Key is still extensively used to solve the problem of secret communication over an insecure channel. In an open network like internet, data encryption has been widely used to ensure information security. Each type of data has its own features. Thus, different encryption techniques should be used to encrypt data from unauthorized use. In this paper, we essentially achieve these two goals i) To introduce the fundamentals of encryption and terms related to it and ii) To discuss some classical encryption techniques in history. Data origin authentication: It allows the recipient to verify the origin of a received message. Entity authentication: It allows the entities of an endend connected communication to authenticate each other. 3) Non-repudiation: It prevents the sender from later denying that he/she sent the message. C. Plain Text It is the original message which is to be sent to receiver. D. Cipher Text It is the coded message which is the encoded version of original message. E. Characters of Cryptography Alice, Bob and Eve are the main roles taken as examples. Alice is basically Sender/Receiver, Bob is Receiver/sender and Eve is eavesdropper or third party tries to access message. II. BASIC TERMINOLIGIES A. Cryptography It is the study of encryption techniques that allow only the sender and intended recipient of a message to view its contents. The term is derived from the Greek word kryptos, which is known as hidden. It is closely associated to encryption, which is the disguising the ordinary plain text into what's called as cipher text and then back again to normal plain text on arrival. In addition, cryptography also deals with the embodiment of information in images using techniques like microdots and merging. B. Objectives of Cryptography The main objectives are as follows: 1) Protecting data privacy (secret writing) 2) Authentication: Message authentication: It allows the recipient to check whether a received message has been modified. Figure 1: Role of Characters in Communication F. Encryption Encryption protects secrecy of transmitted messages . B. Problem with Private-key Encryption In this method, both the encoded message and private (secret) key are sent to receiver. When somehow message is intercepted by third party, they have everything they need to decrypt the message. So, it is not secure. To address this issue, public-key encryption system is introduced. Figure 2: Process of Encryption Encryption Enck : plaintext m → ciphertext c Decryption Deck’ : ciphertext c → plaintext m Encryption key: k Decryption key: k’ k and k’ can be same or different. C. Public-key encryption It is also known as asymmetric encryption. Here, sender and receiver will have pair of keys like public key and private key (secret key). pk is public, known to everyone (who wishes to know). sk is secret and only known to the key’s owner. In this method, senders requests public key of intended receivers, encodes it and both encoded message and public key are sent to receiver. G. Brute Force Attack In this method, we try every possible key to decipher the cipher text. On an average, we need to try half of all possible keys. Time needed proportional to size of key space. It is mainly based on computational power of machines. Below table depicts the time taken for various key sizes to decrypt the ciphered text based on brute force method. Figure 4: Public-key encryption By this, only intended receiver will be able to decrypt it with private key. From public key pk, it is hard and almost impossible to derive private key sk. So this method is secure. Decsk(Encpk(m)) = m. Table 1: Time taken to crack cipher for various key sizes III. TYPES OF ENCRYPTION A. Private-key Encryption It is also called as symmetric-key encryption. It is a classical encryption method. Here both sender and receiver share a common private key and it is used for encryption and decryption Encryption key k = decryption key k Dec(k, Enc(k,m)) = m Or Deck(Enck (m)) = m. IV. CLASSICAL ENCRYPTION TECHNIQUES Classical encryption techniques are foundation to modern encryption techniques. Some of the types of Classical encryption techniques are as follows. V. SUBSTITUTION CIPHER It is a classical encryption technique in which characters in the original plain text are replaced by other characters or symbols or numbers. For instance, if the plain text (original message) is considered as string of alphabet characters, then this technique would replace the pattern of alphabets with other characters which is cipher text. Types of substitution techniques are explained as follows. A. Caesar Cipher It is one of the earliest and simplest classical encryption technique. In this method, each letter in the given plain text is replaced by a letter which comes by shifting fixed number of positions. For example with shift of 3 positions, A would be replaced by D, B would be replaced by E and so on. Figure 3: Symmetric Encryption Model Figure 7: Example of Mono-alphabetic cipher D. Polyalphabetic Cipher A strong and well-formed cipher disguises and misleads the original fingerprint. By the mid of 15Th century, cryptography has advanced to encipher using Polyalphabetic Cipher For Example: Message to be sent: Hide the money Secret word as key: RICH Letter positions of RICH are 17-8-2-7 Adding positions of message with positions of key word, we get Figure 5: Depiction of Caesar Cipher The method is named after Roman Statesman Julius Caesar, who used this technique to communicate with his officials. The encryption is done using modular arithmetic essentially addition and subtraction by first converting the letters into numbers. For instance, A = 0, B = 1, C = 2 …., Z = 25. Encryption of a letter by shifting n positions can be described mathematically as shown in figure above. B. Loophole of Caesar Cipher The loophole of this model was proposed 800 years later by an Arab mathematician Al-Kindi. Al-Kindi was able to break the Caesar Cipher by using a clue based on a shared property which is frequency of alphabets of the language used in the message. Figure 6: Frequency analysis of English alphabets C. Mono-alphabetic It is a substitution technique in which for a given key, the cipher alphabet for each plain text alphabet is shifted by random positions and it is same for all occurrences of that plain text alphabet. For example, if ‘B’ is encrypted as ‘E’ then for all occurrences in that plaintext, ‘B’ will always get encrypted to ‘E’. • The number of possible shifts is 26!, which makes it much more complicated than Caesar Cipher to break. Figure 8: Example of Polyalphabetic cipher E. Playfair cipher The play fair cipher was the first substitution cipher based on digraph. This technique was invented by Charles Wheatstone in the year 1854, but was named after Lord playfair who popularized this and promoted to use this cipher. Unlike, Traditional ciphers till now, we encrypt a pair of alphabets (characters) which are called digraphs instead of single alphabet. It was used by British forces during World War-1 and also by Australians during World War-2. This was fast enough to use and do not require a special equipment. • We can follow 2 important steps with 3 main rules to encrypt a plaintext using the Play fair Cipher. • Firstly, we need to set a key. Example: monarchy • Lets the word “instruments” be our plain text to encrypt. Generate the key Square (5×5): The key square is a 5×5 grid of alphabets that acts as key for enciphering the plaintext. Each of the 25 alphabets should be unique and one letter of the alphabet (usually J) is not present in the table (since the table can hold only up to 25 alphabets). If the plaintext message is having J, then it should be replaced with I. The first few alphabets in the key square are the unique and distinct alphabets of the key in the order in which they appear followed by the remaining letters which comes in order. This is shown in figure. Figure 9: Key in playfair cipher Algorithm for encrypting the plain text: The plaintext is split into pairs of two letters which are called digraphs. If there are odd number of letters, then Z is appended to the last letter. For example Plaintext: "instruments" After Split: ‘in’,’st’, ‘ru’, ‘me’, ‘nt’, ‘sz’. Rules for Encryption: 1) If both the letters considered are in the same column: Take the letter below each one (go back to the top if letter is at the bottom). For example Diagraph: "me" Encrypted Text: cl Encryption: m -> c, e -> l Figure 10: Cipher text of digraph 2) If both the letters are in the same row: Take the letter to the right of each one (go back to the leftmost if letter is at the rightmost position) For example Diagraph chosen: st Encrypted Text: tl Encryption: s -> t and t -> l 3) If neither of the above two rules is satisfied then form a rectangle with the two letters and take the letters on the horizontal opposite corner of the rectangle which means that encipher text would be the vertices of opposite diagonal. For example Diagraph chosen: nt Encrypted Text: rq Encryption: n -> r and t -> q Application of Playfair cipher Plaintext: “instrumentsz” Encrypted Text: gatlmzclrqtx Figure 11: Enciphering using playfair cipher Encrypted as follows: i -> g, n-> a, s -> t, t -> l, r -> m, u-> z, m->c, e-> l, n-> r, t -> q, s -> t, z -> x F. One time pad Cipher It is one of classical encryption technique in which private key is generated at random and is used only once to encipher the message which is to be deciphered by the receiver using a matching one-time pad key. Messages encrypted using random keys have a huge advantage that there is no way to “break the code” theoretically. Each encryption is unique and do not have a common relation to next encryption so that some common pattern can be detected. How it Works? First step involves converting plaintext to binary. Generate a random key in binary and is at least as long as plaintext. Generate the cipher text by applying bitwise XOR on binary plaintext and the binary key. Example: Fig 12: Example of One-time pad cipher G. Hill Cipher It is one of the classical encryption techniques. Example of Hill Cipher is as follows: Plaintext; ACT Key used: GYBNQKURP Cipher text: POH The size of plaintext = n = 3. We have to form a nxn matrix with the key as follows [[G,Y,B],[N,Q,K],[U,R,P]]. VI. TRANSPOSITION CIPHER The message ‘ACT’ is written as vector as follows: [[A],[C],[T]] It is a cryptographic technique in which letter of the plain text are rearranged/permutated to get the cipher text. In this method, original plain text letters are not included. It is also called Permutation Cipher. A simple example of this cipher is columnar transposition cipher in which each character in the plain text is written in the form a table with specific width. The cipher is formed by writing the characters vertically to get the different cipher text. Plain Text: helloworld Apply columnar transposition Cipher Text: holewdlolr The enciphered (nx1) vector is given as Figure 13: Key Generation in permutation cipher Which is formed by writing vertically from the table. Which corresponds to cipher text POH Deciphering hill cipher To decrypt the message, we multiply the inverse of key matrix with cipher text vector. It is done as follows From the previous Cipher text ‘POH’ Which gives us plain text ‘ACT’ again. A. Book Cipher or running key cipher This cipher works on the basic principle of one-time pad cipher in which key at least as long as plain text and excess is discarded later. Every time a new key is taken for encryption. The small improvement to the onetime pad cipher is that the key of the one-time pad cipher is taken from the book. It is detailed as follows: Step 1: Convert plain text alphabets to their equivalent numeric values A = 0, B = 1, C = 2 …, Z = 25. Step 2: Choose a onetime pad key from the book and convert this into numeric form. Ensure key is as long as plain text. Step 3: Now add numeric forms of both plain text and onetime pad key. If addition values exceeds 26, do modular division by 26. Figure 14: Encrypting using Book Cipher For example: Plain text: Meet Tomorrow Key: ANENCRYPTION (taken from the book) Now convert both the plain text and key into their numeric forms and add them to get the desired cipher text as shown in figure. Cipher text: MRIGVFKDKZDJ VII. PRODUCT CIPHER It is a technique in which plain text is encrypted by two or more times. It means after one encryption, the encrypted text further encrypted to get the more secure encrypted text. It is a combination of two or more simple ciphers like substitution ciphers and transposition ciphers. One of the most famous ciphers is fractionation system, the ADFGVX cipher employed by the German during World War1. This system utilized a 6x6 matrix to substitution-encrypt the 26 letters and 10 digits into pairs of symbols A, D, F, G, V and X. The resulting cipher which is bilateral was written into a rectangular matrix and is encrypted by extracting text from the columns in the order depicted in the key word. This technique was deciphered by French cryptanalyst J. Painvin in 1918 which shown a devastating effect for German army in battle for Paris. For Example Figure 15: Enciphering using product cipher ACKNOWLEDGMENT This paper is solely written by me by carefully understanding the topics for various resources mentioned in references. CONCLUSION Some Classical Encryption techniques were reviewed and discussed how they work. Mostly are classical as they were mainly used during the wars. A thoughtful frequency analysis is able to break the cipher of most classical techniques. However, these are main foundation pillars to modern cryptography. REFERENCES [1] William Stallings, "Network Security Essentials ( Applications and Standards)" Pearson Education, 2004,pp.2- 80. [2] Charles P. Pfleeger, Shari Lawrence Pfleeger. "Security in computing" Pearson Education 2004 -pp. 642-666. [3] Jose J. Amador, Robert W. Green, "Symmetric-key Block Ciphers for Image and Text Cryptography" , International Journal of imaging System Technology, Vol. 15 - pp. 178-188,2005. [4] Dragos Trinica, "Sequential and Parallel Cascaded Convolution Encryption with Local Propagation: Toward future Directions in Cryptography", Proceedings of The third International Conference on information Technology-New Generations. (ITNG'06), 0- 7695-2497- 4 / 2006, IEEE Computer Society. [5] Lecture Notes on "Computer and Network Security" by Avi Kak.Pdf h t t p: / / jun i ch ol l . or g/Cr ypt a na l ys i s /Da t a / EnglishData.php [6] William Stallings, "Cryptography and Network Security", Fourth Edition, Prentice-Hall -pp.80-81. [7] Fauzan Saeed 1, Mustafa Rashid 2, "Integrating Classical Encryption with Modern Technique", International Journal of Computer Science and Network Security, VOL. 10 No.5, {May 2010}. [8] V. Umakanta Sastry 1, N.Ravi Shankar2, and S.Durga Bhavan "A Modified Hill Cipher Involving Interweaving and Iteration" International Journal of Network Security, Vol. 11, No. 1, PP.11 {16, July 2010}. [9] Results of Comparing Tens of Encryption Algorithms Using Different Settings- Crypto++ Benchmark, Retrieved Oct.1, 2008, (http://www.eskimo.com/ wei-Dai/benchmarks.html). [10] Y.C. Hu, A. Perrig and D.B. Johnson, “SEAD: Secure Efficient Distance Vector Routing for mobile wireless ad hoc networks”, Proceeding of IEEE Workshop on Mobile Computing Systems and Applications, 2003. [11] “Information Security: Theory and Practice”, by Patel, Page 20. [12] https://www.kaspersky.com/resource-center/definitions/what-iscryptography. [13]“Ihttps://www.slideshare.net/lineking/classical-encryptiontechniques-in-network-security