A Cipher Design with Automatic Key Generation using the Combination of Substitution and Transposition Techniques and Basic Arithmetic and Logic Operations

Modern computing is observed to be highly dependent on communication and data transport. The security of data during communication has become a mandatory need since the introduction of e-commerce, mails, etc. Moreover a lot of data may be required to be kept secure on local devices also. The encryption of data is the basic requirement today and thus helps to maintain confidentiality of data. A number of algorithms are available for encrypting data while it is transferred from sender to receiver. In this paper we have proposed a cipher which uses basic encryption techniques of substitution and transposition along with application of logic gates, in order to encrypt the data. The algorithm makes cryptanalysis even more difficult because of the use of "Random Number Generator" function which further decides order of encryption rounds and keys to be used to encrypt the plain text. This eliminates the overhead of defining a fixed key by the user and makes algorithm secure also. It also facilitates to transfer the key to the receiver while being added with the plain text at random locations (like added at end or beginning).


INTRODUCTION
HE field of communication in computer science compels us to employ security measures since the computers are required to transfer all type of sensitive data today and their use cannot be ruled out due to its perfection, time saving and cost cutting edge.The volume of data currently transferred over the internet in a minute is about640 terabytes and it is expected that the number of devices forming network, which is nearly equal to global population, will double by 2015 [Rick Burgess, 2011].This increment in network traffic will lead to the requirement of the ciphers which provide quick response and have low processing delay but yet are efficient.
The cipher design can be very simple as well as highly complex.Cryptology is that part of engineering which is concerned with creating ciphers (cryptography) and breaking the ciphers (cryptanalysis) [Jonathan Katz & Yehuda Lindell, 2007].
A number of ciphers are available today and are used for encryption and decryption.Some of them are block ciphers [Sastry et al., 2010], stream ciphers, and hash functions [ William Stallings, 2013].Block ciphers [Sastry et al., 2010] takes plain text input of fixed size and produces the same Substitution method [Venkateswaram & Sundaram, 2010] involves replacement of a character by another one whereas in transposition the positions of characters are changed accordingly [William Stallings, 2013].And thus our algorithm will be a combination of these two.A number of algorithms are available today like DES [IBM, 1994] and AES [William Stallings, 2004], but none of the use the basic substitution and transposition schemes.Moreover, they execute in several rounds thereby contributing to a considerably large processing delay.Also certain algorithms using basic encryption techniques lack in automatic key generation thus contributing to overhead for users.Also these algorithms generally perform encryption by following a fixed order of rounds which can be randomized using a random number generator function [Brue Schneier, 1996].

II. SHORTCOMINGS OF PREVIOUS ALGORITHM
 The previous algorithm makes use of a fixed key initially.This fixed key is defined by the user itself which can become overhead for the user. The algorithm generates five keys for the five different rounds, which are the first to fifth multiple of the initial key.Therefore if the initial key is known by attacker, all the other five keys can be known. Since the orders in which rounds are applied in algorithm are always fixed, hence decryption becomes easy.

III. OUR CONTRIBUTION
The algorithm proposed by us uses the keys for encryption, which are generated from the message itself and are not required to be defined by the user whereas in the previous algorithm the initial key was supposed to be defined by the user explicitly [Srikantaswamy & Phaneendra, 2011].Once the encryption is done, the key is to be transferred to the receiver"s end so that it could be used for decryption.Therefore it is transferred to the receiver"s end while being added with the message in the encrypted form.Another role is played by random number generator to enhance security.The algorithm uses the substitution and rail-fence technique [William Stallings, 2013] but the random number decides that which one of the two encryption techniques has to be applied first.The length of the original message decides the key to be used for substitution encryption.After this when both the algorithms have been applied, we apply NOT gate to each character.If the length of message is even, the key will be added at the end and the notation used for random number will be placed at the beginning of message in a byte else the notation will be stored at the end and key at the beginning.
The notation for random number will be zero if it is even and one if it is odd.The key will also be stored in a byte using the five LSB of the word.The final message will be transmitted over the network.
The decryption algorithm on the other end will separate the key and notation used for random number from the cipher text by counting its length.Once they are separated, the cipher text will undergo NOT operation and decryption rounds will be applied subsequently, on the basis of random number notation.If random number notation is zero, railfence will be applied first and then substitution, else viceversa.

IV. ENCRYPTION ALGORITHM
Step Step 14: Apply Substitution to the result of Step 9 using formula C=(p+k) mod 26; where c is cipher text , p is plain text and key K.
Step 15: On the transposed result, apply Logical gate NOT.

STOP
Final Cipher text will be the output of previous step.

V. ENCRYPTION AND DECRYPTION RESULT
Example: Consider the plaintext message "NETWORKS".The Encryption and Decryption results produced by the Algorithm are as follows  A Random key is generated by random function.
Let, key generated be 102.Since the key is even, substitution technique will be applied first or else transposition technique would have been applied first. Now the length of original string NETWORKS is counted, which is 8.

VII. CONCLUSION
The main aim of encryption is to convert the text into such a form that its crypt analysis becomes tedious and confusing.
The algorithm provides good encryption and is automated.The keys used are very random and cannot be identified.And all this is achieved with simple and compact code which does not lead to large processing delay and time complexity.In future the algorithm can also be applied to the Digital Image Processing and can be used to distort an image file and on the other hand the original picture can be retained.The algorithm can also be applied to the numeric data in future.

A Cipher Design with Automatic Key Generation using the Combination of Substitution and Transposition Techniques and Basic Arithmetic and Logic Operations sized
block of cipher text whereas stream cipher encrypts the stream of data i.e. one byte at a time.In this research we will mainly concentrate over the ones which use the techniques of substitution and transposition [William Stallings, 2013], using the ASCII characters [www.asciitable.com].

Table 1 -
EncryptionAfter round 1 of encryption, we get KBQTLOHP.Apply transposition i.e.Rail Fence.Cipher Text= KQLHBTOP In final Round of Encryption, apply Logical Gate "NOT".

Table 3 -Decryption ASCII Value in Decimal ASCII's Binary Equivalent NOT Decimal Equivalent ASCII Equivalent in
Text Obtained: -KBQTLOHP Key used in Encryption, k=23

Value of English Alphabet P=|c-k| mod 26 Corresponding Alphabet in English
Easy to understand and implement program  Uses basic and easy encryption schemes  Efficient key generation technique  Less time complexity 