A Novel Paradigm for Symmetric Cryptosystem

Playfair cipher is the first known digraph polyalphabetic method. It relies on 5x5 uppercase alphabets matrix with simple substitution processes to be used for encryption and decryption. This paper proposes an enhanced variant of Playfair cipher algorithm that incorporates an algorithm for elaborate key generation starting with a seed accompanying the ciphertext and will be referred to as a Novel Paradigm for Symmetric Cryptosystem (NPSC). The key generation, encryption and decryption processes implement modular calculations instead of the simple substitution used in the traditional Playfair cipher. It supports both alphabetic characters and numerals. This variant considerably enhances the security strength without increasing the matrix size as demonstrated by the experimentation results. Comparative studies of various critical factors with other reported versions of Playfair cipher and results were also included. Keywords—cryptography; security; symmetric systems; polyalphbetic cipher; key generation


INTRODUCTION
The first practical digraph substitution cryptosystem was Playfair cipher which is invented by Charles Wheatstone in 1854.It encrypts pairs of letters rather than single letters as in simple substitution cipher, hence reducing the hazard of frequency analysis attack significantly.Playfair cipher is reasonably fast and easy to be applied by low skilled persons, hence it was tactically used during World Wars I & II by all warring parties.Due to its powerful then and simple calculations, it proved suitable for the protection of non-critical information during combat.By the time the enemy cryptanalysts could break the message the information was useless to them [1].
The traditional Playfair cipher structure is a 5x5 matrix that contains the uppercase English alphabet with letters I and J are treated as equals.Uncounted books, papers and surveys included the structure, operation and characteristics of this ciphering technique were reported [2][3][4][5][6][7][8].Due to its many peculiarities and shortcomings outlined by Srivastava and Gupta [9], many extended or modified versions of Playfair cipher schemes that would include alphanumeric and special characters were suggested in recent years as listed in section 2. However, this paper presents a new variant that incorporates modular arithmetic calculations rather than simple substitution and involves alphabetic and numerals text messages.It suggests a new key creation method out of a key seed for constructing the matrices for the encryption/decryption processes.
After the definition o Playfair Cipher in section 1, a brief survey of related work is given in section 2, followed by a detailed explanation of the proposed cryptosystem scheme in section 3. Section 4 includes the implementation of the algorithm and section 5 lists the experimental results and comparison with the original Playfair cipher and some of its variances.Finally section 6 concludes the paper.

II. PLAYFAIR CIPHER VARIANTS
The most important variants of Playfair cipher will be chronically considered here.
Murali and Senthilkumar [10] reported a rapid increase in security of the transmission over an unsecured channel by mapping random numbers to keyword of Playfair cipher.The corresponding numbers are then transmitted to the recipient instead of alphabetical letter.Sastry et.al. [11] considered the 7 bits ASCII characters representation for the plaintext message characters denoted by codes from 0 to 127.Shanon's concept of confusion and diffusion was achieved by suitable variation in the traditional Playfair rules together with modification in the substitution tables.
Babu et.al. [12] implemented 6x6 matrix instead of 5x5 matrix in order to include number in their cipher, however, lowercase letters, white space and other printable characters cannot be handled.In order to include other uppercase letters and other characters, Srivastava and Gupta [9] modified their work by forming an 8 x 8 matrix.Beside they extended the technique by converting obtained cipher to the corresponding ASCII code values in decimal and further to corresponding 7 bits binary values, then applying Linear Feedback Shift Register to obtain the final ciphertext.
Agrawal et.al. [13] also used 5x5 matrix with consideration of letters I and J, but the frequency of digraph in the message is calculated first and the two letters with the lowest frequency were combined in the matrix immediately after the letters of the keyword.
Tunga and Mukherjee [14] extended the matrix to 16x16 in a multiple array structure in order to facilitate for information regarding spaces and the inclusion of "X" in the alphabet matrix.Besides it incorporated a shifting mechanism for rows and columns of the matrix to ensure that the encrypted text contains any ASCII code ranging between 0 -255.Another 16x16 Matrix Playfair variant is also suggested by Dhenakaran and Ilayaraja [15].www.ijacsa.thesai.orgBasu and Ray [16] implemented a rectangular 10x9 matrix in order to support almost all the printable characters including white space, and therefore increasing the size of the key domain to 90! and hardening the cryptanalysis tasks.
Hans et al. [17] implemented pattern swapping to produce a multiple key changes up to a maximum of fifty times.He adopted Random pattern of eight digits containing only numbers from 1-4.
Chand and Bhattacharyya [18] added to the 6x6 matrix of Babu et.al. [12] four iteration steps.They included letters and numbers from 0 to 9 without combining I and J in the same cell, hence user can write messages with all alphanumeric characters.

III. THE NOVEL PARADIGM FOR SYMMETRIC CRYPTOSYSTEM (NPSC)
An enhanced cryptographic scheme (NPSC) is proposed in this work which is inspired by Playfair cipher that can encrypt alphanumeric messages.However it follows completely different and elaborate procedure.It adopts an elaborate key creation method and consists of two encryption/decryption algorithms and relies on modular arithmetic calculation for key generation and cryptographic processes.Two 5x5 matrices were employed as the backbone for this scheme, one for the alphabetic characters and the other for numerals.The key creation algorithm starts with a key seed that is chosen by the sender and attached to the encrypted message in order to produce these matrices, and then they will be used for message encryption at the sender side and decryption of the received cipher message at the receiver side.Details of all algorithms will be listed below.

A. Key generation Algorithm:
The key generation of the key starts with a seed that must consist of reasonable number both letters and numbers decided by the sender and embedded as a header for the ciphertext message.Its length is defined by certain agreement between the communicating parties.This seed is used independently by both sending and receiving parties to create the key according to properly designed process, and then produce two 5x5 matrices; one for the text and the other for the numerals.The first step for the key creation is to split the seed in two strings; text string and numerals string.Then text string is treated with algorithm-A of Fig  The created key length must be either equals 4, 9, or 16 characters.However, if the length of the key seed is not equal to any of these required number of characters, then some characters shall be added.For the algorithm-A, the added letters are determined by eq. 1, so, if the current key contains m characters, then next added character is determined by calculating its location value k first.
where p i is the location value of the i th characters of the current key so far and r = m+1.The character matching the value of k is then added to the key string.This process is repeated until the required key length is achieved.For example if current key length is 7, then 2 more characters need are to be added.When the required key length of characters string is achieved, it is re-written in reverse order and checked for duplicate characters, if found, they are removed and replaced by unused letters from the alphabets in order.Moreover, in the case of obtaining the key with the required number of characters immediately from the message, there will be no need for any more calculations.It should be stated here that letters I and J are considered the same.Obviously, increasing the key length would enhance the security; hence it is recommended to add more characters to the key seed till the next required length is achieved.
A certain pointer is agreed upon by the communicating parties in order to distinguish the key seed from the ciphered www.ijacsa.thesai.orgtext.This can be either an integer number stating the length of the seed or an agreed upon separator between.

B. Encryption Process
To encrypt a message M which composes of both letters and numerals in the proposed NPSC cryptographic scheme, two possible algorithms are followed depending on the message contents whether it is text or numerical.The characters are encrypted sequentially and taken as ciphertext in the following procedure.
Each character is first identified; if it is a letter then algorithm 1 is used for encryption and if it is an integer number, algorithm 2 is used for encryption.The two algorithms are shown in Fig 2.
The resulting ciphertext string (C) content will be a mixture of lower case and uppercase letters corresponding to letters or numerals, respectively.To clarify how this process in executed, a detailed example is shown in the implementation section.

C. Decryption Algorithm
At the receiving end, the obtained message contains the key seed attached to the ciphered message.For the receiver to decrypt a ciphertext message first the key seed is identified and the removed from the received message in order to be used for creating the two matrices A and B. then the decryption process starts in order to recover the original plain text.Lowercase characters are treated by algorithm A and uppercase letters are treated by algorithm B. and since decryption is the reverse of the encryption process, hence subtraction is used instead of addition.It should be noted here that numbers might be negative; in such case, an addition of 25 is performed in order to acquire the original number.

IV. IMPLEMENTATION
To clarify the proposed NPSC variant, some examples will be included here for the use of the key seed to create the encryption/decryption matrices and to execute encryption and decryption processes.Two matrices are generated one for the letters and one for the numerals.

Example 1: matrices creation:
Suppose the key seed is the word "security5167", then the seed for matrix A is "security" and that for matrix B is "5167".The following will be followed for creating matrix A: The alphabet is numbered first from 0 to 25 The value of 17 represents [r] in the alphabet, therefore the obtained key will be "securityr" Now reversing the letters of this key and removing duplicates produces table I-b which again requires another letter.Now repeating calculation similar to eq. 2, results into letter [v], hence the key becomes "rytiucesv".It is used to filled the bottom left corner of a 5x5 matrix A, then this matrix is completed with remaining letters of the alphabet without duplication as described in section 3.1 using lowercase letters, see Fig. 3.The key seed for the numeral segment in this example is "5167", which will be used for the creation of matrix B. After removing duplicate numbers the will look like table II-a, then replacing the corresponding letters from the alphabet produces table II-b.
Then after reversing the letters sequence of table II-b, the key will be "HGBF".These letters will be placed in the upper right corner of a 5x5 matrix B, and will be completed with remaining letters of the alphabet without duplication as described in section 3.1 using uppercase letter, see Fig.  Therefore the ciphertext is "vveeisaaQQDD".

V. EXPERIMEENTAL RESULTS
The proposed NPSC variant has been programmed in C++ language, and executed on different platforms with the following aspects in mind:  Execution speed measurement for different package size under various operating environment (Windows 7, Windows Server 2012 and Linux).
 Transmission speed of encrypted messages over various network setups (wired and wireless networks).
 Comparison with playfair cipher.
 All results have been tested on the same environment using Intel Laptop core I .7 processor with 8GB RAM Therefore, the test included measurements of some important factors, such as CPU run time, power consumption, and the packet transmission time.All measurements were conducted for different package sizes; namely small package (1MB), medium package (10 MB) and large package (1 GB) for two different environments; namely wired network and wireless network.The results were listed in tables III -V and a comparison histogram is plotted for all studies cases in Figures 5-7.
Table III compares the measured factors of the proposed NPSC Cipher with the original Playfair cipher tested on a network using Intel Laptop core i7 processor with windows 7 operating system (OS), and then a histogram plot is drawn in Fig 5 .It is shows that all measured factors have improved values in case of NPSC as compared with Playfair Cipher.Despite the elaborate computation involved in the proposed NPSC design which includes modular mathematics rather than only substitution as for the original Playfair cipher, the observed empirical results have all demonstrated improvements in algorithm execution time, power consumption and transmission speed over computer networks for different platforms.
The security of NPSC can be also compared with variant of playfair cipher, as shown in table VI.

VI. SECURITY ISSUES OF NPSC CIPHER
Any cryptosystem is designed to stand cryptanalysis attacks relying on time complexity and space complexity.The original Playfair Cipher is vulnerable to Brute force attack but has reasonable resistance to frequency analysis attack.For the NPSC cipher, these two attacks may be considered here.

A. Brute Force Attack [2]:
This attack systematically attempts all possible key combination; hence, larger the key space results into more secure cipher.In NPSC cipher, two independent 5x5 matrices were for encryption and decryption purpose.Therefore, the key space for building these matrices will be (26x26)x(26x26) resulting into 456976 different possible combinations for the Brute force attack as compared with 26x26 diagrams for Playfair cipher.

B. Frequency Analysis
Frequency analysis is the study of the frequency of occurrence for letters or groups of letters in a ciphertext [20].It is based on the statistical fact that, each letter or group of letters for any language has certain frequency of occurrence.This frequency would be decided with more accuracy if the written text was of considerable size.The characteristic distribution of these letters is found to be almost the same for any stretch of text of reasonable length [21].However, the proposed NPSC cipher relies mathematical calculations and not digraph substitution; a thing put the frequency attack out of the question.

C. Comparison Analysis:
A comparison study is conducted for the proposed NPSC cipher in contrast with the original Playfair cipher and some of its reported variants and listed in table VI [8].It includes the key space that is available for Brute force attack, the number of possible diagrams need to be searched for ciphertext only attack, and the probability of occurrence of an element for frequency analysis attack.This paper introduced few variations to Playfair ciphers such as using numerals together with letters, creating the encryption/decryption key from an alphanumeric seed, and the expansion of the encryption/decryption matrices to two instead of one matrix.Also the encryption/decryption processes are performed using modular arithmetic.These added values to the ciphering technique have given larger key domain size for brute force attack and increased number of diagrams needs to be searched for ciphertext only attack and also handicapped the frequency of occurrence analysis attack.More work is needed to be pursued to study the avalanche effect on this cipher.

Fig. 5 .
Fig. 5. Comparison of various factors for a network using windows 7 OS Table IV compares the measured factors of the proposed NPSC Cipher with the original Playfair cipher tested on a network using windows Server 2012 operating system, and a histogram plot is drawn in fig 6.It is also shows that all measured factors have improved values in case of NPSC as compared with Playfair Cipher.

Fig. 6 .
Fig. 6.Comparison of various factors for a network using windows Server 2012 OS Table V compares the measured factors of the proposed NPSC Cipher with the original Playfair cipher tested on a network using Linux operating system, and a histogram plot is drawn in fig 7. Again it is shows that all measured factors have improved values in case of NPSC as compared with Playfair Cipher.

Fig. 7 .
Fig. 7. Comparison of various factors for a network using Linux OS 1 to create the first matrix and the numerals string is treated with algorithm-B of Fig 1 to create the second matrix.
6. Repeat step 3until key length equals 4, 9 or 16 7.Place the text file in the lower right corner of 5x5 matrix using lower case letters 8. Subtract the text's characters from the alphabet, place the result into set X 9. Place contents of X in the matrix using lower case letters in clock wise manner.
, then seed letters are put in a table as in table I-a after removed duplicates, with the target to have 4 or 9 or 16 letters.In this table one extra character is required to get 9 letters.It is calculated in eq. 2.

TABLE III .
MEASUREMENT OF VARIOUS FACTORS FOR A NETWORK USING WINDOWS 7 OS

TABLE IV .
MEASUREMENT OF VARIOUS FACTORS FOR A NETWORK USING WINDOWS SERVER 2012 OS

TABLE VI .
PLAYFAIR VARIANT COMPARISON