An Improved RSA based on Double Even Magic Square of order 32

] Because of the computers systems discovery and the use of computer networks between countries, security is very important to transfer confidential information over the networks; traditional cryptographic systems such as Rivest-Shamir-Adlemen (RSA) are depend on guesswork as well as mathematics. Information theory illustrates that conventional cryptographic systems cannot be regarded fully secure unless the private key ; which it is used once only ; is at least as long as the plain text. And another limitation is using ASCII value to represent the plaintext, So the repetition of characters in the plain text will appear in the cipher text therefore we have given approach to generate magic square of order 32 which cannot be easily traced and use this square in the cryptography which it is used to improve efficiency through providing an additional level of security to encryption. Through of the characteristics of magic squares, and it's some complex conditions (non-repetition property), these squares generates a huge numbers of non-duplicate random numbers which can be used to represent the numerals rather than ASCII values as well as the magic square is also used to generate the keys for public key encryption algorithms.


Introduction
Cryptography pointed completely on encryption, which is the process of transforming original information (plaintext) into unreadable text ( cipher text), while There are two kinds of cryptosystems, symmetric and asymmetric.In asymmetric systems there are two keys, the first one (public key) is used to encrypt a message while the second one (private key) is used to decrypt it, therefore these systems increase the security of communication [1].An example of asymmetric systems is RSA, The security of several cryptographic systems relates with the creation of unexpected elements like the secret key in the DES algorithms, the key stream in the one-time pad and the prime P, and Q in the RSA encryption.In every these instances, the keys made must be sufficient in size and the arbitrary.However, RSA is not completely secure or secure against chosen cipher text attacks.If all variables are selected in such a way that it's impossible to compute the private key (d) from the public key (n, e), or choosing P, Q are incredibly large.Even if the above variables were selected carefully, none of the computational problems are completely guaranteed enough [2].To encrypt the clear message characters, their ASCII values are taken which is possible that the same cipher text is produced for the characters which occur in several positions in the plaintext.To eliminate this problem, this paper attempts to improve a method with "doubly even magic squares (DEMS)" of order 32 (32 ×32) which equals to 1024 different values and dividing this magic square to different corresponding ASCII tables (each table is 128 ASCII characters).Thus, instead of taking the ASCII values of the characters to encrypt, different numerals representing the location of ASCII values in the magic square are taken and also using the same magic square to select two prime numbers (P and Q) which is used to generate the public key (e, n) then these numerals are encrypted using "RSA cryptosystem".new layar of security to public key algorithm by providing more security to the cryptosystem using magic squares idea.In July 2012 Sonia Goyat [5] proposed a new algorithm by applying the genetic algorithm to cryptography and alter the algorithm to generate more powerful keys and also the random values, which it is used to generate keys, are unique.Then A new algorithm "Modified Subset-Sum cryptosystem over RSA" was presented by Sonal Sharma, Saroj Hiranwal, Prashant Sharma [6] which it is secured against Shamir attacks on RSA as well as various sorts of Mathematical attacks.And in January of the same year Prasant Sharma, Amit Kumar Gupta et al [7] studied the rapidity of RSA public key cryptosystem to decline the time taken for finding factor for a huge number.They suggested a new algorithm and its output was compared with "Fermats factorization Algorithm and trial division algorithm".

Proposed Methodology
The Improved RSA based on Double Even Magic Square (DEMS) is:- Step 1:-Generate Doubly Even Magic Square of order 32 (32 × 32 ) which contains totally 1024 values and divide it to eight different quadrants each consists of 128 characters.Each different quadrant corresponds to one ASCII set (128 characters).
Step 2:-For every letter in the plain text, the numerals corresponding to its position in different quadrants of magic square are taken then these numerals are encrypted and decrypted using RSA public key cryptosystem.

Volume 12, Issue 4, September 2017 ISSN 1992 -0849
Web Site: www.kujss.comEmail: kirkukjoursci@yahoo.com, kirkukjoursci@gmail.com Step 3:-Use the same magic square to select two prime numbers P and Q which is used to find the public key in RSA, from the range (1-1024) two numbers are selected randomly and then from this limit any two prime number (p and q) are selected which cannot be trace because of their randomness.(figure 1)

Construction of Magic Square Volume 12, Issue 4, September 2017 ISSN 1992 -0849
Web Site: www.kujss.comEmail: kirkukjoursci@yahoo.com, kirkukjoursci@gmail.com "A magic square" of order n is a square array or an array of n 2 numbers which fulfils the condition that the sum of the elements of each row and column, as well as the main diagonals, is the same number which it is called the magic.Generally, the entries are thought of as the natural numbers 1, 2, ..., n 2 , where each number is used exactly once.Magic Squares utilized to generate a huge number of random keys.The number of magic squares of order 4 (4x4) using the numbers from 1 to 16 and magic constant (34) is 880 magic square, magic squares of order 6 (6x6) or above require a huge amount of calculations where normal computer cannot be resolved, according to some estimates the number exceeds (1.7745x1019) through rotate rows and columns.
The use of magic squares in data encryption gives more security because of the difficulty of magic squares analysis using frequency analysis, Or by using the principle of guesswork and the trial and error to decode the text

Con stru cti on of Dou b l y E ven Magi c S q u ares
A doubly even magic square is a square matrix of order n, where n is divisible by four only, while a singly even magic square is a square matrix of order n, where n is even but not divisible by four.In this paper we focused only on the implementation of doubly even magic square of order 32 (32 × 32) and their affect to enhance the public-key cryptosystem (RSA), to construct "doubly even magic squares", starting with the simplest (8×8

Example on RSA with double even Magic Square
RSA is implemented to illustrate the effect of using magic squares to enhance the security of public key encryption schemes.The secret key in the system consists of two prime numbers (P and Q) and an exponent (d) while the public key consists of the modulus N = P.Q and an exponent (e) where d = e -1 mod (P-1) (Q-1).The user calculates C = M e mod (n) for encryption and M = C d mod (n) is done for decryption (for any message [11], [12].
In this paper, the modulus of N, M, and C should have a length of 512-1024 bits in order to prevent the known attacks.Using the above algorithm, we construct a "

Volume 12 ,
Issue 4, September 2017 ISSN 1992 -0849 Web Site: www.kujss.comEmail: kirkukjoursci@yahoo.com, kirkukjoursci@gmail.comAs the intruder has the chance of finding the public key value (e), then finding the decryption key (d) value directly and decrypts the cipher text, "Amare Anagaw Aycle and Vuda Sreenivasarao" [3] suggested an efficient representation of RSA algorithm by applying mathematical logics on two public keys rather than sending the public key (e) in RAS algorithm..While "Gopinath Ganapathy and K Mani" [4] suggested a

Figure 5 :
Figure 5: Double even magic square of order 16 even magic square" of order 32 which contains 1024 different (non repetition) values, as the characters set consists of 128 ASCII values, the magic square is divided logically into different 8 matrices each one with 128 values corresponding to individual ASCII character, for getting more realization of the proposed matter, we take an example, assume P=13, Q=17 and the public key (e) =11, then N=221, and (P-1).(Q-1)=192.now the secret key(d) = 35 .To encrypt the message (A CAR), the ASCII values of A, C and R are 65, 67 and 82 respectively, so to encrypt A which appears in first and third position in the plain text, the numerals which appear at 65 th position of first matrices and at 65 th position of third matrices( figure 3 which is divided logically into 8 matrice) are taken respectively, Thus N p (A)=959 and 831, N p (C)=68 and N p (R) =942.And the cipher C(A)=959 11 mod 221=82, C(C)=68 11 mod 221=204, C(A)=831 11 mod 221=77, C(R)=942 11 mod 221=167 similarly we use this Volume 12, Issue 4, September 2017 ISSN 1992 -0849 Web Site: www.kujss.comEmail: kirkukjoursci@yahoo.com, kirkukjoursci@gmail.com substitution for every repeated character in the plaintext, therefore for each repeated character A, B, C,....(which appears more than once in the plain text), different cipher texts are generated.
This work prevents any hacker from getting the plain text in a readable form even if they obtained the keys because of using the numerical values of magic square rather than the ASCII values of characters (rather than of unique ASCII table, 8tables with various set of values are used).It is unsolved problem to determine the number of magic squares of order 32 which is used in this paper.The security aspect of RSA is improved because there are no duplicated values in Magic Squares.In the ordinary RSA, the same cipher text values are generated whenever the same characters are repeated in the plain text, while in the proposed (RSA with DEMS) different values are produced in the cipher text for each occurrence of the same character in the plain text.It plays an important role in increasing the randomness and security of the algorithm.One of the issues in the proposed work is additional time needed for the construction of Magic squares initially.

Issue 4, September 2017 ISSN 1992 -0849 Web
).In 8 by 8 grids, in first step we write the numbers 1 through 64 from left to right (figure 2.a).Then "flip" the numbers in the diagonals (the red lines).That is to say, exchange 64 & 1, 55 & 10,…., and 57 & 8 and 50 & 15 and so on, and we will have a magic square constant= 260 (figure 2.b). in the second step we divide 8 by 8 square into 4 blocks (each block is 4 by 4) then replace and flip the elements in the secondary diagnose of block 1 with the elements in the secondary diagnose of block 4( gray cells) and replace and flip the elements in the main diagnose of block 2 with the elements in the main diagnose of block 3( yellow cells)(figure 2.c) Volume 12, Site: www.kujss.comEmail: kirkukjoursci@yahoo.com, kirkukjoursci@gmail.

6. The comparison between ordinary RSA algorithm and proposed RSA with Double Even Magic Square:-
characters (E and S) appear twice in the plaintext, therefore in the ordinary RSA, the cipher text of them is the same (425), while in the suggested (RSA with DEMS), the cipher text value of the first (E) which it is (397) is differ from the second (E) which it is (298) and the same thing with any repeated characters in the plaintext, This methodology is implemented in C# Ordinary RSA RSA with Double even magic square Plain text ASCII value Cipher text Plain text MS value Cipher text