A Block Cipher Algorithm Based on Magic Square for Secure E-bank Systems

2022-11-10 02:31FarahTawfiqAbdulHussienAbdulMonemRahmaandHalaBahjatAbdulWahab
Computers Materials&Continua 2022年10期

Farah Tawfiq Abdul Hussien,Abdul Monem S.Rahma and Hala Bahjat Abdul Wahab

Computer Science Department,University of Technology,Baghdad,10011,Iraq

Abstract:Nowadays the E-bank systems witnessed huge growth due to the huge developments in the internet and technologies.The transmitted information represents crucial information that is exposed to various kinds of attacks.This paper presents a new block cipher technique to provide security to the transmitted information between the customers and the ebank systems.The proposed algorithm consists of 10 rounds,each round involves 5 operations.The operations involve Add round key,Sub bytes,Zigzag method,convert to vector,and Magic Square of order 11.The purpose of this algorithm is to make use of the complexity of the Magic Square algorithm,the speed of addition operation,the confusion provided by the zigzag,using these operations with Galois field 28 GF(28),and repeating these operations for several rounds to build fast high secure encryption algorithm.This algorithm is designed to provide fast with high complexity and security which is suitable to encrypt the data that is transmitted over the internet.Speed,complexity,and The National Institute of Standards and Technology Framework NIST suite tests were done.The complexity of the proposed algorithm is=((256)32)r+1*((256)89)r+1+(256)121.The proposed technique gives higher speed and security in the encryption and decryption phases,according to the results of the experiments.The degree of randomness has grown by 31.8 percent.Due to a decrease in the time of encrypting and decrypting,as well as the usage of the central processing unit (CPU),efficiency is improved.The encryption process throughput is enhanced by 13%,while the decryption process throughput is increased by 11.6 percent with the recommended approach.

Keywords:Block cipher;magic square order 11;complexity;NIST suite;zigzag;GF(28);MS11

1 Introduction

The huge development in lifestyle and technologies results in a daily huge amount of information transmission over the internet[1-3].Some of this information may contain critical information such as communication between the e-bank and the customers(credit card,payment information,withdrawal money,etc.)[4-6].Therefore,providing security became an essential issue[7-10].Many approaches have been applied in this field one of them is encryption algorithms[11-13].The most important issue in encryption algorithms is the degree of security(complexity)and fast process(performance)[14-16].

Important issues in encryption algorithms that must be balanced are the speed and the security degree.Using many operations with high calculations increases the algorithm complexity that results in a more secure algorithm[17-21].But on the other hand,increasing complexity leads to an increase in the encryption process time(slow down the encryption algorithm)[22-24].Which conflicts with the requirement of fast encryption algorithm for real-time systems[25-29].On the other hand,reducing the complexity to increase the encryption speed will reduce the security level[30-32].This paper suggests a new block cipher algorithm that is inspired by the Advanced Encryption Standard(AES)encryption algorithm in a trial to balance between the speed and the security level.This algorithm is based on using the magic square of order 11 (MS11) in GF(28),making use of the (MS11) high complexity and fast calculations.To produce fast,high-performance,and high-security encryption algorithms.This is done by running the algorithm into 10 rounds,each round consists of five steps.These steps involve,Add Round Key,Sub Bytes,Zigzag pattern,Convert to vector,and MS11.This algorithm is applied to the communication between an E-banks and the customers to provide security for the payment information and the customer information under the e-bank control.The main contributions of this paper are:

• Creating a novel,new symmetric block cipher algorithm.

• Employing the magic square of order 11(MS11)to increase the encryption complexity and hence increase the security.

• Generate and use 32 different equations as part of the encryption process.

• Create and use 9 different maps by assigning a single map for each round.

• Employ the zigzag algorithm to increase confusion and diffusion.

• Creating a reliable environment to transfer financial information between an e-bank system and the customers.

The remaining organization of the paper is as follows:Sector 2 provides a view of previous works,sector 3 presents the methodologies,sector 4 describes the evaluation and experimental results,and sector 5 explains the conclusions.

2 Related Works

Due to the efficiency of the magic square (of different orders) in the encryption process many types of research are performed over years that attempted to create a perfect encryption structure that makes use of the magic square mathematical characteristics,some of them are:

According to M.Sahni and D.B.Ojha Generated a new platform to generate a key using an 8*8 magic square and encrypted the data using Ordeal Random Data Encryption Standard(ORDES)and employing special geometrical figures[27].Another study by A.S.Rahma and D.A.Jabbar Suggested a protocol to protect the transmitted information between two nodes.This protocol is based on magic square order 3,a linear algebra system.The system is running into several rounds providing complexity of equal to(23*no.ofblocks*26*no.ofblocks)Rwhere R represents the number of rounds[28].Also,this study by S.D.Mohammed and T.M.Hasan attempted to improve the permutation and substitution process by removing the frequents.This is performed by concealing the encrypted message into a randomly selected submatrix of size 4*4 which is in turn selected from 16*16 magic square for each encryption process.Magic square and Latin square both of size 3*3 are used for two purposes,providing more permutation and making sure of the availability of inverse matrix for the decrypting phase.This work is good for encrypting databases due to the huge frequents in it[29].Another study by R.H.ALHashemy and S.A.Mehdi Developed an algorithm to encrypt images by investing the wide random keyspace of the chaotic system to generate several keys equal to the image size and based on the magic square.These keys are distributed into non-overlapping submatrices,also the image is divided into subimages then multiply both matrices to produce a new matrix.System complexity is (((b)46)2)nwhere b the length of each cell content in the matrix,n represent no.of submatrices[30].According to I.M.ALattar1 and A.S.Rahma Suggested a block cipher algorithm is based on the magic square of order 7 in Galois Field Prime(GF(P))and GF(28).They used key length=35 to be distributed on a certain position of magic square and message of length=14 to be distributed on the rest positions.The complexity of the developed algorithm is GF(P)=(p)14*(p)35and GF(28)=(256)14*(256)35[31].

Another study by I.M.ALattar1 and A.S.Rahma Suggested a new block cipher algorithm based on the magic square.This intended to increase system complexity by using multi-message length.The work is done depending on the round status(even or odd).The key is distributed to preselected places and the remaining locations are filled with the message.The encrypted message is calculated by computing a certain sum.The algorithm complexity is((P)15×(256)10)2×(P)11×(256)14for GF(P)and ((256)15×(256)10)2×(256)11×(256)14for GF(28)[32].This study by I.M.ALattar1 and A.S.Rahma Employed a magic square of size 5*5 to encrypt text and images using both GF(P) and GF(28).For several rounds,a mask is used depending on the round state (even or odd).For even rounds,addition operation is used while multiplication is used with odd rounds.These sequences are used with two different algorithms.The system complexity for the first algorithm was=((256)15)r+1×(256)10+or×(256)25and for the second algorithm was((256)11)r+1×(256)14+or×(256)25[33].Later I.M.ALattar1 and A.S.Rahma improved their works to by adding a multilevel key with the matrix of the key to increase speed and complexity.Three different message lengths were used,with three different algorithms.The system complexity was increased of the first,second,and third algorithm to(P)9×(256)16,(P)9×(256)16×3,and(P)9×(256)16×3×(P)25in sequence[34].

All the previous study focuses on using the magic square only depending on the complexity of it without adding any additional complexity.The proposed method utilizing the speed of the magic square and adding additional complexity by utilizing additional operations that are run into several rounds to increase system complexity and security.The proposed algorithm can be used to provide security for applications like smart cities,complex network,traffic flow analysis,cellular network and other applications such as those discussed in[35-40].

3 The Proposed Methodology

This paper aims to create a secure environment for data transmission between e-banks and the customers due to the sensitivity of the information which is involved in this transaction.This is done by suggesting a new block cipher algorithm.This algorithm is consists of five operations to be run into ten rounds.These operations involve Add Round Key,Sub Byte,Zigzag,Convert to vector,and Magic Square of order 11 MS11.These processes will be discussed in detail in the next sections.

3.1 The Proposed Cryptography Technique for Message Length=32 Using GF(28)

When the characteristics of the normal magic square are examined,22 equations are found,ten of which are derived by computing the total value of adding the rows,ten more from adding the columns,and two more from adding each diameter derived from the diagonals of MS11.The suggestion is inspired by the standard AES encryption algorithm with some changes:The encryption process consists of several rounds.Each round consists of five operations.The first two operations are Add Round Key and Sub Bytes,these two operations are inspired by AES and performed in the same manner.The third operation is the zigzag method which is implemented instead of the shift row operation in the AES.Next,the result from the zigzag is converted into a vector.The last step is the magic square of order 11.These five operations are repeated in each round.For each round,there will be a unique map for the magic square which is used in this session only.

3.2 The Algorithm Details

The suggested algorithm is composed of 5 steps:add round key,sub-byte,zigzag,vector conversion,and magic square order 11,which are performed into 9 rounds.

• The add round key is performed in the same manner as in the standard AES algorithm.

• The sub-bytes step:It consists s-box of 16*16 size and works as the s-box step in the standard AES algorithm.

• The Zigzag pattern A zigzag pattern is applied to increase confusion and diffusion as shown below in Fig.1.

Figure 1:Initial zigzag pattern

The zigzag pattern can be expressed as a reordering scheme of the characters inside the string to eliminate the statistical relations among them.The zigzag pattern can be described in the zigzag algorithm.

Zigzag Algorithm Input:the message(M)Output:Zigzagged M(ZM)Begin//For the 1st two columns While(R-2)>0 do R=3,C=0 P(R,C)=P(R-1,C)P(R-1,C)=P(R,C-1)P(R,C-1)=P(R-1,C-1)P(R-1,C-1)=P(R-2,C)R-=2 end while//For the last two columns Counter=0 While(R+2 <=3)do

Zigzag Algorithm Continued R=0,C=2 P(R,C)=P(R+1,C)P(R+1,C)=P(R,C+1)P(R,C+1)=P(R+1,C+1)P(R+1,C+1)=P(R+2,C)R+=2 end while stop

• Convert to vector The state matrix that is resulted from the zigzag step is converted into a vector of 32 sizes.Each cell in the zigzag array is divided into two vales of 4 bits and is stored into successive cells into the vector.For example,if a cell in state matrix consists of the value 2D then it is divided into 20 and 0D.These values are stored into two successive cells as 20 and 0D.The values are taken column by column from the state matrix.For example,if the state matrix after the zigzag step consists of the following values shown in Tab.1.

22 44 3D 78 F1 9E 5C 1A

The resulted vector will contain the following values shown in Tab.2.:

0 2 0 D 0 1 0 C 0 4 0 8 0 E 0 A

Then the values will be stored in predefined places in magic square of order 11

• Magic square order 11 (MS11) In this step,the advantages of the magic square of order 11(MS11)are taken into consideration,where 11 sums are obtained for the rows,11 other sums for the columns,and two other sums are for the main and secondary diagonals,so that the final result is 24 sums,as shown in Fig.2.

Figure 2:The sums of MS11

After examining,studying and applying the resulted equations with each other,it is been found that two of them have dependencies with the rest,so the equations have removed so that,the remaining number of them is 22.As show below:

By adding ten additional equations to obtain the final sum of 32 equations,as shown in Fig.3.As a result,there will be 10 message locations(maps)and each location corresponds to an equation.The remaining positions in MS11 are 89 for the keys.The proposed algorithm does not restrict the use of specific fixed locations,but rather gives flexibility in choosing the location and values of the keys.To increase the complexity and randomness,the message locations will be fixed only for one session.It means that for each round there will be a fixed map to decide the messages’locations,but this map is changed from round to round(a different map for each round).Fig.4 represents the used maps,and Fig.5 represents the encryption process of the proposed algorithm.

Figure 3:The additional equations

The additional 10 equations are:

Figure 4:The matrices from 1 to 9 represent the different maps that are used for each round map number is corresponding to the round where to use the map

Figure 5:Light weight AES encryption phase

The MS 11 step-encryption Algorithm Input:Key Locations(KL),Key-Value(KV),No.of Rounds and The plaintext Output:Ciphertext.Begin:Step1:Divide the KV among the selected positions in MS 11.Step2:Place the plaintext in the rest positions in MS 11.Step3:Compute the sum of the used mask and the MS11 formed.Step4:In the matrix M,get the summation for each row,column,and diameter.Step5:several times the steps listed below:i.In new Positions,select a different Key value.ii.Distribute the last computed sums in the remaining locations.

The MS 11 step-encryption Algorithm Continued iii.Sum=the mask+MS11.iv.Compute the total for each new row,column,and two diagonals.End

3.3 The Decryption Phase

• The add round key

• The inverse sub-bytes

• Inverse zigzag

The Inverse zigzag is the reverse order of the initial zigzag as shown in Fig.6.

The inverse zigzag algorithm is presented in the inverse zigzag algorithm below:

Inverse Zigzag Algorithm Input:the zigzagged message(ZM)Output:The message M Begin//For the 1st two column While(R+2 <=3)do R=0,C=0 P(R,C)=P(R+1,C)P(R+1,C)=P(R,C+1)P(R,C+1)=P(R+1,C+1)P(R+1,C+1)=P(R+2,C)R+=2 end while//For the last two column R=3,C=3 While(R-2)>0 do R=3,C=0 P(R,C)=P(R-1,C)P(R-1,C)=P(R,C-1)P(R,C-1)=P(R-1,C-1)P(R-1,C-1)=P(R-2,C)R-=2 end while Stop

• Convert to vector

• Magic Square

The same equations are used to convert the ciphertext to plaintext using the same maps and the same encryption key.Here the ciphertext will be divided into the maps of the magic square in the same manner as the original message is distributed using the same maps that are shown in Fig.4.Fig.7 represents the flowchart of the decryption phase in the new algorithm.

Figure 7:Light weight AES decryption

The MS 11 step-Decryption Algorithm Input:Key Locations(KL),Key-Value(KV),No.of Rounds(R),and The Ciphertext.Output:The plaintext Begin For R down to 1 i.Put the KV in the selected places in MS11.ii.Put the latest resulted encrypted text in MS11.iii.Subtract the key from the mask iv.32 resulting equations will be organized such that the main diameter does not consist of a value=0.v.The 32 equations are solved as linear equations.End for End

4 Evaluation and Experimental Results

The updated algorithm’s performance is demonstrated using experimental findings.The NIST test,the time of the encrypting and decrypting phases,and memory use for the files encrypting and decrypting are among the requirements.The system were written in PHP Laravel Framework and simulated on Intel(R)Core(TM)i5-6200U CPU@2.30 GHz,2.40 GHz with 8GB RAM and 64-bit operating system,x64-based processor,Windows 10 Pro.

4.1 NIST Test Suite

The National Institute of Standards and Technology (NIST) is the most extensive test that is used for evaluating encryption methods.As a result,it is utilized to measure the traditional AES and the novel block cipher algorithm in this comparison.Comparison is done using three tests:approximation entropy,run test,and linear complexity.These tests offered randomness metrics for both the traditional AES and the novel block cipher algorithms’encrypted testing.Tab.3 below summarizes the results.

Key Standard AES The suggested encryption algorithm Approximate entropy Run test Linear complexity Approximate entropy Run test Linear complexity kVM5HlaOSmViuDZS 0.275 0.708 0.412 0.621 0.883 0.738 jUg2Sb85VAaNprRU 0.591 0.269 0.891 0.95 0.869 0.896 EiM5BDi4POBJ2rY7 0.29 0.745 0.693 0.486 0.851 0.96 Mi56R6JZ9EfDFPU1 0.574 0.619 0.098 0.501 0.471 0.603 DbcV7rPU3tcvKGP3 0.641 0.619 0.098 0.858 0.982 0.862 5t3oL59Z8Tsh9Hmf 0.453 0.852 0.08 0.398 0.601 0.419 z38ks44Q25aOSegD 0.013 0.684 0.99 0.316 0.932 0.863 NM2wk851jPr5LQMh 0.51 0.902 0.654 0.89 0.963 0.921

The novel approach provided more unpredictability than the usual AES,according to the findings.As an example,it is proven that on average In comparison to the traditional AES,the proposed encryption algorithm has an approximate entropy of 0.209125,a run test of 0.14425,and a linear complexity of 0.327.

4.2 Encryption and Decryption

The examination of encrypting and decrypting times is a crucial characteristic for evaluating encryption method performance.The running time of the encrypting and decrypting phases is measured with different file sizes and then compared to the regular AES.The new method is quicker,as seen in Tab.4 and Figs.8 and 9.The study’s major purpose is to develop a more efficient encryption method for the data that will be transmitted through the internet.

Table 4:Analyzing the encryption and decryption phases of the new block cipher algorithm

Figure 8:The encrypting time of different file sizes

Figure 9:The time of decrypting files of different sizes

On average,the encryption time of the new block cipher is minus than the AES algorithm by 3653 milliseconds,while the decrypting phase is minus than by 3997 milliseconds.

4.3 Memory Space Utilization

The new block cipher algorithm requires less memory space than the normal AES during the encrypting phase,according to the analysis of CPU memory using various file sizes.The analysis of the memory use is shown in Fig.10 and Tab.5.

Figure 10:Memory utilization of the encrypting phase of various file sizes

Table 5:Memory and CPU utilization for encrypting different sizes of files

Furthermore,the memory space required for decrypting with the new block cipher algorithm is less than that required by normal AES.Fig.11 and Tab.6 illustrate this.The new block cipher algorithm is better at using CPUs than the regular AES,according to prior research.

Figure 11:Memory utilization of the decrypting phase of various file sizes

Table 6:Memory utilization of decrypting phase for files of different sizes

5 Conclusion

The development of a new block encryption algorithm employing the MS11 and GF(28) is distinguished by increasing the complexity with little reduction in speed.Applying the GF(28)offers speed and more complexity.On the one hand,the more the number of equations employed,the higher the speed;moreover,the complexity is lowered.Adding more masks to the mix adds a layer of complexity.The addition provides less complexity but it is a fast operation.Also,the zigzag operation provides more confusion and diffusion.This collection provided high speed,high complex encryption algorithm which leads to high performance,with a high degree of a secure encryption algorithm.Which is suitable to be used for encrypting transmitted data over the internet.The experimental results showed that the randomness degree has grown by 31.8 percent,decreasing in the time of encrypting and decrypting and the usage of the CPU,that leads to improving the efficiency.Also,the encryption process throughput is enhanced by 13%,while the decryption process throughput is increased by 11.6 percent with the recommended approach.There are several suggestions to improve system security and complexity some of them such as using MS of even order in the even rounds and using MS of odd order in the odd rounds.Using padding process before starting the work of the algorithm as preprocessing step to increase the confusion and diffusion.Using a specific number and shape of maps is considered as a limitation of the proposed system.

Funding Statement:The authors received no specific funding for this study.

Conflicts of Interest:The authors declare that they have no conflicts of interest to report regarding the present study.