ENCRYPTION METHOD USING PASCAL’S TRIANGLE BASED SUBSTITUTION AND SIERPINSKI TRIANGLE BASED PERMUTATION

Text messages are often created, shared and a person sends at least ten messages a day. Because of its frequent usage those messages are not been encrypted. Thus it is unable to send confidential messages via SMS service. In this paper, we develop a new encryption technique using the notions of Pascal‟s Triangle and Sierpinski Triangle. The proposed method uses the Pascal‟s triangle for substitution and Sierpinski triangle for permutation. The method is simple and easy to implement in real time. It is difficult for the attackers to predict the original message contained in the ciphertext. The proposed method is not much vulnerable to brute force and letter frequency attacks


INTRODUCTION
Due to the availability and abundant use of technology, sending of short text messages between the communicating users has increased in domain such as social media, messaging apps, e-mails. Some messages in those domains are confidential and sensitive for the communicating persons. Hence, providing confidential to those messages is important. Confidential service can be provided by mechanisms like encipherment. Transposition and Substitution methods are used to encrypt and decrypt text messages [15]. In this paper, a new substitution and permutation based technique to encrypt/decrypt text messages using the concept of Pascal and Sierpinski triangle is proposed. The notion of Pascal triangle is used to perform XOR operation on the characters of plaintext message in a particular pattern and then permutation is done to get the ciphertext.

Literature survey
In this section, brief descriptions of the few existing classical and modern encryption techniques data are provided. Encrypting text messages using various simple methods have been introduced by various researchers [5, 7-9, 12, 13].

Classical Ciphers
The Caesar cipher is one of the earliest known and simplest ciphers. The method is named after Julius Caesar, who apparently used it to communicate with his generals. It is a type of substitution cipher in which each letter in the plaintext is "shifted" a certain number of places down the alphabet. The Caesar cipher offers essentially no communication security, and it can be easily broken even by hand. The encryption and decryption process are carried using the Equations (1) and (2) [15].


Encryption : C = (P+K) mod 26 (1) The Playfair cipher is a polygraphic cipher which enciphers two letters at a time. The encryption and decryption process are carried out by using a 5x5 matrix. The technique encrypts pairs of letters, instead of single letters as in the simple substitution cipher. The Playfair is significantly harder to break since the frequency analysis used for simple substitution ciphers does not work with it. Frequency analysis can still be undertaken, but on the 25x25=625 possible digraphs rather than the 25 possible monographs [15].
Vigenere cipher is poly-alphabetic substitution cipher in which a single plain text letter can be converted into multiple cipher text letters. This conversion depends on the position of the letter in the plaintext. The Vigenere cipher makes use of Vigenere table of size 26x26 [15].
Rail fencing technique involves, writing plaintext message as a sequence of diagonal and reading it as a sequence of row to produce ciphertext. In a Rail Fence cipher, after removing the spaces from the original message, write the characters in the message in the zig-zag pattern. The key for the Rail Fence cipher is just the number of rails [15].
In Hill cipher, the concept of matrix multiplication is used for encryption. Plaintext is divided to sub texts based on the key size and each sub text matrix is multiplied with key matrix to get the cipher text matrix [15]. The encryption and decryption processes are done using the Equations (3) and (4).
where, C is ciphertext P is Plaintext, and K is the Key matrix.

Text Message Encryption Methods
Acharya et al [1] presented an image encryption method using the concept of matrix transformation. Cooper et al [2] introduced an efficient public-key cryptosystem using the Pascal triangle. Dinesh P. Baviskar et al [3] developed an Android based message encryption/decryption method using matrix. Cryptographic algorithms play a vital role in securing confidential data from the attackers. The algorithms consume significant amount of computing resources like CPU time, memory, and encryption time [6]. The concept of matrix reordering is applied to encrypt digital images in the paper [10]. In [11], the authors developed a new symmetric cryptosystem using the key derived from the randomized parameters of SHA-512 and MD5 hash functions. In [14], a new encryption technique using the Pascal triangle is introduced to encrypt/decrypt digital images.

THE PROPOSED ENCRYPTION METHOD
The proposed encryption method uses the Pascal"s triangle concept as substitution and Sierpinski triangle concept as permutation to encrypt the data. Initially, the characters of the plaintext are arranged in triangle format. Then by using the Pascal principle the characters are XORed bitwise to get a new cipher character. Subsequently permutation technique is applied using sierpinski triangle to get the final encrypted message.

Pascal triangle
Pascal's triangle is a triangular array of the binomial coefficients. The entries in each row are numbered from the left beginning with k = 0 and are usually staggered relative to the numbers in the adjacent rows. Having the indices of both rows and columns start at zero makes it possible to state that the binomial coefficient (nk) appears in the nth row and kth column of Pascal's triangle. This construction is related to the binomial coefficients by Pascal's rule, which says that if [4] (x + y ) n = ∑ k=0 (n k) x n-k y k (5) then (nk) = (n-1 k-1 ) + ( n-1 k ) A sample Pascal"s triangle is shown in Figure 1.

Sierpinski Triangle
The Sierpinski triangle may be constructed from an equilateral triangle by repeated removal of triangular subsets as given below: (a) Start with an equilateral triangle.
(b) Subdivide it into four smaller congruent equilateral triangles and remove the central one.
(c) Repeat step (b) with each of the remaining smaller triangles A sample of formation equilateral triangle is shown in Figure 2. Based on the above said concepts, the proposed encryption method is divided into two phases such as Phase-I (substitution using Pascal triangle) and Phase-II (permutation using sierpinski triangle).

Phase I: (Substitution using Pascal triangle)
At sender side, the characters of the plain text are arranged row wise in the triangular pattern (Triangle-1). Based on the above formulae (5) and (6), the characters are XORed with the help of starting character of the plaintext (Triangle-2). Then add these two triangles to get the substituted text message. The following example illustrates the Phase-I of proposed encryption process.
Let us take the plaintext message "meet me at party". The Triangle-1 after placing the characters of plaintext message is shown in Figure 3. Padding character, in this case x" is appended at the end to complete the triangle.

Fig 3: Triangle-1
The Triangle-2 after applying the proposed substitution using the concept of Pascal triangle is shown in Figure 4.

Fig 4: Triangle-2
The obtained substituted text by using Triangle-1 and Triangle-2 is shown in Figure 5. Hence, the plaintext message after applying the proposed substitution becomes "MQQ9MUJYEU09REI".

Phase II: (Permutation using Sierpinski triangle)
In Sierpinski triangle, the characters at the odd positions are written first and then the even position characters. A sample of Sierpinski triangle is shown in Figure 7.  The result of phase-I is given as input to the phase-II to get the final ciphertext. First, the result of phase-I is arranged as shown in Figure 8 and the characters are read as per the concept of sierpinski triangle.

Fig 8: Permutation using sierpinski triangle
Thus, the final encrypted message corresponding to the plaintext "meet me at party" is "MQQ9UJYEU0IM9RE".

Encryption Algorithm
Input: Plaintext Output: Ciphertext Step 1: Let the message to be encrypted in the matrix[m, m] as triangle 1.
Step 2: Develop another triangle, triangle 2, based on the concept of Pascal triangle.
i.e., the corner characters are XORed with 0 and the middle characters are XORed with the neighbouring characters.
Step 3: Add characters in triangle 1 with triangle 2 for substitution.
Step 4: Repeat step 3 until all the characters in the matrix are processed.
Step 5: Read the characters based on the concept of sierpinski triangle to accomplish permutation.
Step 6: Store the encrypted text.

EXPERIMENTAL RESULTS AND ANALYSIS
The proposed method is experimented using Java language and the system configuration is Processor Intel i5-5200U, Clock speed 2.2 GHz, RAM 4GB and the operating system is Windows. The proposed encryption method is tested with different plaintext messages of various sizes. The characters of plaintext messages are substituted based on Pascal triangle and the result is given Table 1.The repeated characters of plaintext message are mapped into different characters in the ciphertext using the proposed substitution method. The Hamming distance is computed between the plaintext and the encrypted text to quantity the bit difference.  The encrypted messages with proposed substitution and permutation are given in Table 2. The characters of plaintext messages are randomly shuffled and located in various locations in the encrypted message. The Hamming distance is computed between the plaintext and encrypted text and it is observed that the bit difference has been increased.

Table 2. Experimental result of proposed method (Permutation & Substitution)
The performance of the proposed method is enhanced after applying both substitution and permutation. The result shows that the repeated characters in the plaintext message are mapped to different cipher characters in the encrypted message. Hence, the ciphertext is not much vulnerable to cryptanalysis and letter frequency attack.

CONCLUSION
In this paper, a new cryptosystem to encrypt/decrypt text messages by using Pascal and Serpienski triangles is developed. The method is very simple and easy to implement because it involves permutation and substitution techniques for encryption. The characters of the plaintext are transformed to random characters after substitution and the ciphertext are randomly shuffled by using permutation. The proposed encryption method satisfies both confusion and diffusion properties significantly. The messages encrypted using the proposed method is not much vulnerable to cryptanalysis and letter frequency attacks.