A modified Matrices Approach in Advanced Encryption Standard Algorithm

-The cryptographic algorithms became the main proceeding for protection of very important data from unauthorized access. There are several cryptographic algorithms to ensure the data, but algorithms must be selected according to speed, strength and the implementation. Thus, choosing the advance encryption standard (AES) for encryption and decryption data because its speed and strength of encryption, flexible, complex processing and its resistance to Brute-force attack. This paper presents enhancement of the AES algorithm to increase the security of the encrypted documents by using different sizes data matrices based on multiple irreducible polynomials with order 2, 4, and 8. The proposed modifications results tested and provide a high randomness.


Introduction
The work aims to enhance the AES-128 algorithm by using different sizes data matrices.To find out the efficiency of the modified method will be rely on random tests of the results by using the approved tests by researchers in the same subject [1].The AES includes three -128, AES-192, and AES-with block size of 128, 192, or 256 bits.The block-size has a maximum of 256 bits.The cipher uses number of encryption rounds, which converts plain text to cipher text.The output of each round is the input to the next round.The output of the final round is the encrypted plaintext known as cipher text.The plaintext given by the user is entered in a matrix (4*4 byte) called State Matrix.The total number of rounds that consist of different numbers (10, 12, or 14 rounds), depending on Rijndael round function stages (addroundkey, subbytes, shift row, mixcolumn) [2].

Previous Modifications of AES Algorithm
There are many modifications in AES to increase security, improve the efficiency and performance and keeping the same complexity on algorithm steps.The AES modifications applied on software and hardware according to the specific proposes.In [3] present to modified AES algorithm by producing a modified algorithm to generate a dynamic S-Box stage.The performance of this algorithm is verified by varying only selected two bits of encryption key to produce novel S-Boxes to increase the complexity of algorithm.In [4] present to modify the AES algorithm by enlarge encryption keys sizes and data matrix.The data matrix extended to 8 row and variable number of columns (6, 8, 12, and 16), the input data block is (48, 64, 96, and 128) and enlarged the key length to (384, 512, 768, and 1024).In this paper the first and second stages of AES algorithm not change, while third stage (shift row) change from shift 3 row to 7 row and fourth stage (mix column) change the state matrix 3*3 to new matrix 8*8.In [5], this work modified the AES algorithm to generate large number of S-boxes by using dual keys to solve the problem of the fixed structure S-boxes, this lead to increase the complexity, robustness and security level of the AES algorithm.In [6] present to modify the AES algorithm by reduce the calculation and computation overhead.To overcome the problem of high calculation it replace the mixcolumn step by a permutation step.The mixcolumn stage gives high security but it takes long time calculation that makes the encryption algorithm very slow.The other transformations in AES remain with no change.

Advance Encryption Standard (AES) Algorithm
AES is a symmetric algorithm and considered one of types of block cipher.It is widely used in several industry standards and is used in many security institutions.AES is defined as AES-128, AES-192, or AES-256 that name depended on key length that used in the encryption process.The size of data matrix is same key length and having 10, 12, & 14 iterations.AES based on special mathematical rules called the Galois field GF (256) with the irreducible polynomial m(x) = x 8 + x 4 + x 3 + x + 1.This mathematical use in s-box, mix columns and used in creation of the key.It consists of four different stages (add round key, substitution, shift row, and mixcolumn) [7], as shown in the Figure 1.

I. Description of AES Algorithm Stages
It used block size of 128 bits, which mean the data-matrix is 16 bytes; the algorithm consists of two parts.The first part is key expansion that convert the key sequence length of at most 16 bytes (128 bits) into several subkeys array totaling 176 bytes (1408 bits) and the second part is data encryption by using 10 rounds.

II. Substitution Byte Stage
In this stage, each byte replace with another byte by using s-box.The AES s-box operation provides the non-linearity in the cipher and used the multiplicative inverse over GF(256) that know as good non -linearity properties to avoid attack.As shown in Figure 2.

III. Shift Row Stage
In this stage, shift the row of data matrix to cyclically left shifts.The first row in data matrix is unchanged, the second row shift one byte to left, the third row shift 2-byte to left and the fourth row shift 3-byte to left.as shown in Figure 3.

IV. Mix Column Stage
In this stage, transfers map of each column of input state to a new column in output state.Every one input column considered as a polynomial above GF (256) and that multiplied with constant matrix the multiplied operator used polynomial mathematical, as shown in Figure 4.

V. Add Round Key Stage
In this stage, combined between data matrix 16 bytes and sub key matrix derived from original key matrix by key expansion.The combinatiom process by xoring each byte from data and sub key, as shown in Figure 5.

The Proposed Modification of AES Algorithm
The aim of the modification to increase the security of the encrypted documents by changing the size of the element in the data block and key size, thus the randomness of cipher text will increase.The proposed system mix the polynomial concept and only use the size of one element inside one round and only one block and it was used GF (2 8 ) for the first level with high complexity, GF(2 4 ) used for the second level with medium complexity.It used GF (2 2 ) for the third level with less complexity.The order of GF(2,4 and 8) is represented by using key control which responsible of encryption/decryption process.

I. The Modified Algorithm Keys Provider
In this modification, the key provider generates (10) different keys randomly with order (2, 4, and 8) for each round of AES algorithm, that means, the size of each key matrix in the algorithm will be variable to increase the robustness and randomness of the AES.For example, the randomly series of key are: The following stages shows the changes that take place on four stages of AES algorithm as shown in Figure 6. 1. Add round key At this stage, we changed the size of the element within the data block with order (2, 4, and 8) and also the key matrix is different in each round, while in the standard AES the size of element is fixed, as well as, the key matrix is constant in all (10) rounds.

Substitution
In the proposed algorithm, it built three s-boxes depending on the three cases GF(2,4,8), while in the standard AES there is only one s-box.

Shift row
At this stage, creating a master key used to choose the number of shifts to right for each row in the matrix depending on the three cases GF(2,4,8), while in the standard AES there is fixed shifts for each row.

Mix column
In the standard AES the key size is fixed (4*4), while in modified AES , the key is generated for each round randomly and the size of the key matrix is different according to the GF(2,4,8), as show in figure ( 6) below.

Figure 6: Size of key matrix
For illustrating the work of the proposed system with example showing the processes of the system for one block and one round, the plaintext (128bits) size is: E1 1. Write c++ It can be represented in c-sharp as a vector: The control key is 4822448824 and the keys are provided for one round.Since the first element in control key is 4 then the first round will be provided with keys of GF( 4) for all stages (from Add Round key, Substitution, Shift Rows and Mix column).First, each letter in the plaintext is converted to ASCII code then it is converted to binary digit then it is split into two cells (each cell of 4-bits), at last the letter is converted to decimal.For example, the first letter in the above plaintext is (E) and in ASCII code it is (69) then it is converted to binary (01000101) then it is split into two cells with 4-bits (0100 0101) and this is represented in decimal by (4 and 5) and so on for the rest of letters of plaintext as shown in Figure 7. Then the above block is added with the key matrix of GF (2 4 ) that is shown in table (1)

Table 1: The key matrix in GF(2 4 )
Based on the addition in Table 1 in GF( 4), the result is shown in the Table 2.

Table 2: The result of adding plaintext with key in GF(2 4 )
Based on the S-box stage in GF(4) the result is shown in Table 3.

Table 3: The result of S-box in GF(2 4 )
When the key vector is (0 1 3 0) the result of shift Rows stage of GF(4) will be as follows: Table 4: The result of shiftRows in GF(2 4 ) In mixcolumn stage with GF(4), any element is the total of products of items of one row in the key matrix with elements of one column in the block matrix as follows in Figure 8. Table 5 represent the ciphertext for one block and one round.This steps continue for (9) rounds with different keys based on the degree of GF(8,4 and 2) based on control key.

Experimental Results
To test the performance of modified AES algorithm, take three different size text file and used the usable tests that are (Frequency test, Serial test, Poker test, Runs test, Autocorrelation test) as test1, test2, test3, test4, and test5, respectively to measure the efficiency of the output for the modified method.
Table 6 shows the results of testing of modified AES, which pass the threshold of usable text criteria (standards).Table 7 shows the results of testing of standard AES.In the above tables, notice that the randomness results of modified AES less than standard AES, which mean the randomness of modified AES better than the standard AES and the time factor has been counted for three levels of complexity (high, medium and low) and provided results are faster than the standard AES Algorithm.

Conclusion
The proposed modification shows that this development by using multiple irreducible polynomials degrees with order 2,4 and 8 can increase the efficiency of randomness and it can provide a greater efficiency and speed.

Figure 7 :
Figure 7: The presentation process of plaintext in decimal in GF(2 4 )

Figure 7 :
Figure 7: The multiplication of key matrix with block in GF(2 4 )