2.7 Magic Square Properties

22 downloads 0 Views 9MB Size Report
2.12 Some Reflections and Rotations for the Dürer approach. 31. Fig. ...... This method belongs to the name of its inventor Albrecht Dürer who has created a ...
Republic of Iraq Ministry of Higher Education & Scientific Research University of Technology Department of Computer Science

A DISSERTATION SUBMITTED TO THE DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF TECHNOLOGY IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY IN COMPUTER SCIENCE By Omar Abdulrahman Dawood Supervised By Prof. Dr. Abdul Monem S. Rahma Asst. Prof. Dr. Abdul Mohssen J. Abdul Hossen

1436 AH

2015 AC

‫̤˲˧ ۮ‬Ǫ̬‫̤˲ݔ‬Ǫ߷ ̩ǿǿǿǿǿǿǿǿ˸ ˉ ˅̪ȍȇ Ȏ ˲̤ ȍ ‫ق‬Ȑȏǵȍ˲ȏ̪ȑǫҫ̬ȑ̪ȏDZȇ ҨǪ̣ ȏȎ̜ʐȏDZ ȇ˲̤ ҨǪ̬ȏ̉ȍ̞ȍȍ̸̭Ȏ̤ҫˆ˸ȑȍ̼ȇȍ) (ҠȊ̧̾ȏȍ̜ҟҧǪ߻ȏȑ̋ ȏȑ̤Ǫ̬ȍ̪ȐȏȎ ۫ ̿˒ȏȇǫҬ Ү ‫ﺻﺪق ﷲ اﻟﻌﻈﲓ‬ .‫( ا ٕﻻﴎاء‬٨٥)

Dedication I would like to dedicate this work To: Our Prophet Mohammed Peace be Upon Him (PBH) Father and Mother, Wife and Lovely Daughter (Sultana).

Omar A. Dawood

Acknowledgments I would like to extend my sincere thanks and gratitude to my supervisors Prof. Dr. Abdul Monem S. Rahma and Asst. Prof. Abdul Mohssen J. Abdul Hossen for their invaluable guidance, constructive suggestions, advice and assistance during the writing of this Dissertation. Their regular comments, remarks and insightful guidance are highly appreciated. Thanks are also due to all staff members at computer science Department in the University of Technology for their encouragement and support. I am also indebted to Dr. Hazim H. Muarich for revising and editing the chapters of this study. Special thanks are extended to my mother and wife for their patience and moral support that helped me finish this study. Also many thanks are extended to my brothers and sisters for their support. Finally, I would like to thank all my friends for their support and willingness to listen and comment on different aspects of this Dissertation.

Omar A. Dawood

Publication Papers 1. Omar A. Dawood, Abdul Monem S. Rahma and Abdul Mohssen J. Abdul Hossen, “The Euphrates Cipher”, IJCSI International Journal of Computer Science Issues, ISSN (Print): 1694-0814 | ISSN (Online): 1694-0784, Volume 12, Issue 2, March 2015. 2. Omar A. Dawood, Abdul Monem S. Rahma and Abdul Mohssen J. Abdul Hossen, “The New Block Cipher Design (Tigris Cipher)”, I. J. Computer Network and Information Security, 2015, 12, 10-18, Published Online November 2015 in MECS(http://www.mecs-press.org/)DOI: 0.5815/ijcnis.2015.12.02 3. Omar A. Dawood, Abdul Monem S. Rahma and Abdul Mohssen J. Abdul Hossen, “Generalized Method for Constructing Magic Cube by Folded Magic Squares”, I.J. Intelligent Systems and Applications (IJISA), Vol. 8, No. 1, January 2016.

Status

Published

Published

Published

4. Omar A. Dawood, Abdul Monem S. Rahma and Abdul Mohssen J. Abdul Hossen, “Public Key Cipher with Signature based on Diffie-Hellman and the Magic Square Problem”, Eng. & Published Tech. Journal, 2015. 5. Omar A. Dawood, Abdul Monem S. Rahma and Abdul Mohssen J. Abdul Hossen, “New Variant of Proposed Public Key by Combined Diffie-Hellman with Magic Cube of SixPublished Dimensions”, International Journal of Computer Science and Information Security (IJCSIS), ISSN: 1947-5500, Volume 13 No. 10, October 2015. 6. Omar A. Dawood, Abdul Monem S. Rahma and Abdul Mohssen J. Abdul Hossen, “Fast Algorithm of Revertible In Operations' Queen (FAROQ Cipher)”, the International Arab Reviewing Journal of Information Technology (IAJIT).

ABSTRACT Information security cryptographic protocols are considered very important in the modern era due to the vast development and the advanced technology in the internet applications and the networks communications. The whole applications in our daily lives have become part of the electronic organization. So, the E-business, banks’ transfer money, financial marketing, remittances, distant reserving tickets for accommodation or flying, E-Voting, E-testing, E-Marketing, E-Mailing and several other applications require secure environment. The present dissertation includes proposing three types of cryptographic algorithms in symmetric models, asymmetric models and the magic square & magic cube mathematical problems. The symmetric type involves proposing three of distinct block cipher models that encrypt and decrypt the plaintext with different key lengths and different rounds. The proposed models use the substitution and Permutation Network (SPN) structure and the reversible of operations stages in addition to the duplicated compact ciphering key. The proposed models involve (Tigris cipher, Euphrates cipher and FAROQ cipher) those are characterized with several fascinating features and submit good insight in the design processes. The proposed symmetric models gave an accepted results and reasonable implementation compared with original AES model in compliance with algebraic characteristics, time of implementation, randomness tests deviation in addition to the security and efficiency factors. Although the EUPHRATES and TIGRIS models introduced some slowness in some cases especially with large data size for sixteen rounds mode but they appeared as a good in general with reduced rounds. FAROQ model introduced a good implications from all aspects and applied a satisfactory security level and conservative structure. The second part of the dissertation comprises the developing of a secure method for public key encryption and the key exchange with digital signature, by I

depending upon the combining Diffie-Hellman with magic square and magic cube notations. The magic square and magic cube comprehensions adopted as an alternative mathematical problem in encryption and decryption process instead of the Integer Factoring Problem (IFP) and the Discrete of Logarithm Problem (DLP). The third part consists of the developing of generalized technique for the construction of magic cube based on the folded magic square. The proposed magic cube constructed with sequential or non-sequential numbers of N order by six dimensions or six faces based on the folding eleven distinct flat shapes with six surfaces from all directions using the magic square constructions’ techniques. The proposed magic cube considers a new variant of mathematical problem that is devoted for the public key development to provide a flexible solution to generate cipher keys easily without need to complex computations. The proposed cube adds multiple of security levels represented by the start number selection, cubes’ order, difference value between the numbers and the cubes’ dimension usage. The proposed asymmetric models provide complex and untractable mathematical comprehensive that interests with faster implementation compared with the RSA and El-Gamal algorithms. The proposed cryptosystem is implemented with Visual Studio 2013 C# programming language under Windows 7 Ultimate version of 32-bit operating system by using CPU Intel (R) Core 2 duo 2.00 GHz and RAM 2GB.

II

LIST OF ABBREVIATIONS

Item

Descriptions

AES

Advance Encryption Standard

ATM

Automata Teller Machine

CA

Certification Authority

CRYPRREC

Cryptography Research and Evaluation Committees

DC

Differential Cryptanalysis

DES

Data Encryption Standard

DH

Diffie-Hellman

DLP

Discrete Logarithm Problem

DPA

Differential Power Analysis

DSA

Digital Signature Algorithm

ECDLP

Elliptic-Curve of Discrete Logarithm Problem

FN

Feistel Network

FS

Feistel Structure

GCD

Greatest Common Divisor

GF

Galois Field

GUI

Graphical User Interface

HECDLP

Hyperelliptic Curve Discrete Logarithm Problem

IFP

Integer Factorization Problem

IPs

Intellectual Property

LC

Linear Cryptanalysis

LC

Linear Cryptanalysis

MAC

Message Authentication Code

MC

Magic Constant

MDS

Maximum Distance Separable III

LIST OF ABBREVIATIONS Item

Descriptions

MG

Hypercube

Ms

Milliseconds

MS

Magic Square

MT

Magic Tesseract

NIST

National Institute Standard and Technology

NTT

Nippon Telegraph and Telephone

PDA

Personal Digital Assistant

PGP

Pretty Good Privacy

RCON

Round Constant

RSA

Rivest, Shamir and Adelman

SAC

Strict Avalanche Effect

SHA

Secure Hash Algorithm

SPN

Substitution Permutation Network

SSL

Secure Socket Layer

IV

LIST OF FIGURES

List of Figures Figures

Page No.

CHAPTER TWO Fig. 2.1 Block Diagram for the AES Structure

13

Fig. 2.2 ShiftRows Operation

17

Fig. 2.3 Inverse ShiftRows Operation

17

Fig. 2.4 Round Key Addition

19

Fig. 2.5 Magic Square of Order 3

22

Fig. 2.6 Three of Magic Squares with Different Pivot Element

23

Fig. 2.7 Magic Square of Odd Order Constructions’ Steps

28

Fig. 2.8 Pyramid Magical Square with order Three

29

Fig. 2.9 Pyramid Magical Square with Order Five

29

Fig. 2.10 Example of Dürer approach

30

Fig. 2.11 Other Example of Dürer approach

31

Fig. 2.12 Some Reflections and Rotations for the Dürer approach

31

Fig. 2.13 de la Hire Technique of Order Six

33

Fig. 2.14 Example of de la Hire with Order Six

33

Fig. 2.15 Semi-Magic Square with Order Three

34

Fig. 2.16 The Nasik Square Technique

35

Fig. 2.17 The Associated Squares Technique

35

Fig. 2.18 The Pan diagonal Square

36

Fig. 2.19 The Ultramagic Squares Technique

36

V

LIST OF FIGURES

Fig. 2.20 The Border Square Technique

37

Fig. 2.21 Rotations and Reflections of Magic Square

38

Fig. 2.22 Magic Cube of Order Three

38

Fig. 2.23 Magic Cube of Three Layers

39

Fig. 2.24 Eleven Distinct Shapes for the Magic Cubes

40

CHAPTER THREE Fig. 3.1 General Structure of TIGRIS Cipher

45

Fig. 3.2 TIGRIS-ReversibleShiftRows

48

Fig. 3.3 TIGRIS-Add Round Key

51

Fig. 3.4 TIGRIS-Key Expansion

52

Fig. 3.5 The EUPHRATES Structure

54

Fig. 3.6 Euphrates-ReversibleShiftColumns

57

Fig. 3.7 FAROQ Structure

62

Fig. 3.8 FAROQ-ReversibleShiftColumns

65

Fig. 3.9 Cube’s Dimension of Order Three

68

Fig. 3.10 The Magic Constant of the Six Squares

69

Fig. 3.11 The Magic Sum of the Six Squares

69

Fig. 3.12 Cube’s Dimensions of Order Four

70

Fig. 3.13 Different Shapes of Magic Cube

72

Fig. 3.14 Unfolded Cross Figure of Magic Cube

73

Fig. 3.15 The Vertical and Horizontal Track of Main Diagonals

73

Fig. 3.16 The Vertical and Horizontal Track of Secondary Diagonals

73

Fig. 3.17 The Vertical Track of Cube Rows Values

74

Fig. 3.18 The Horizontal Track of Cube Columns Values

74

VI

LIST OF FIGURES

Fig. 3.19 Diffie-Hellman Key Exchange Protocol

78

CHAPTER FOUR Fig. 4.1 Comparison of Encryption and Decryption Chart’s Time

102

Fig. 4.2 Comparison of Signature and Verification Chart’s Time

102

Fig. 4.3 Cube with Three Dimensions

103

Fig. 4.4 The Layers of Magic Cube

103

Fig. 4.5 The Main Window for the Symmetric Models

109

VII

LIST OF TABLES

List of Tables Tables

Page No.

CHAPTER TWO Table 2.1 AES-Forward S-Box

15

Table 2.2 AES-Backward S-Box

16

CHAPTER THREE Table 3.1 TIGRIS-Forward S-Box

47

Table 3.2 TIGRIS-Backward S-Box

48

Table 3.3 EUPHRATES-Forward S-Box

56

Table 3.4 EUPHRATES-Backward S-Box

57

Table 3.5 FAROQ-Forward S-Box

63

Table 3.6 FAROQ-Backward S-Box

64

Table 3.7 Magic Sum (MS) and Magic Constant (MC) Computations

70

CHAPTER FOUR Table 4.1 Analysis and Comparison Speed for the Proposed Models

89

Table 4.2 Algebraic Comparison between the AES and the Proposed Ciphers

90 VIII

LIST OF TABLES

Table 4.3 Comparison Speed between TIGRIS Cipher and the AES (1)

91

Table 4.4 Comparison Speed between TIGRIS Cipher and the AES (2)

91

Table 4.5 Comparison Speed between EUPRATIS Cipher and the AES(1)

93

Table 4.6 Comparison Speed between EUPRATIS Cipher and the AES(2)

93

Table 4.7 Comparison Speed between FAROQ Cipher and The AES

94

Table 4.8 The Statistical Tests for the TIGRIS Cipher

95

Table 4.9 The Statistical Tests for the EUPHRATES Cipher

96

Table 4.10 The Statistical Tests for the FAROQ Cipher

97

Table 4.11 Comparison between the Proposed Cube and other Distinct Cubes

104

IX

List of Contents CHAPTER ONE INTRODUCTION

1.1 General Background …………………………..………………………..

1

1.2 Literature Survey.………..…….……………..………………………….

2

1.2.1 Related Work for the Proposed Symmetric Methods ……………

2

1.2.2 Related Work for the Proposed Asymmetric Method with Magic Square ………..…………………………………………..............

3

1.2.3 Related Work for the Proposed Magic Cube… …………………..

5

1.3 Magic Square Comprehension………….……...………………..............

6

1.4 The Block Ciphers Design ……………..……..………………...............

7

1.5 The Computational Problems of the Public Key Cipher……………......

7

1.6 Aim of Work…………………………………………………………….

9

1.7 The Dissertation Outline…..…………………….....................................

9

CHAPTER TWO SYMMETRIC CTYPTOGRAPHY AND MAGIC SQUARE

2.1 Introduction ……………….…………………….………….….............

11

2.2 Selection the Universal Standard Cipher…………….………................

12

X

2.3 AES Structure and Characteristics………………………………………

13

2.3.1 The S-Box Construction…………………………………………...

14

2.3.2 InvSubBytes Transformation………………………………………

15

2.3.3 ShiftRows Transformations………………………………………..

16

2.3.4 Inverse ShiftRows Transformations……………………………….

17

2.3.5 Forward MixColumns Transformation…………………………….

17

2.3.6 Inverse MixColumns Transformation……………………………...

18

2.3.7 AddRoundKey Transformation……………………………………

19

2.3.8 AES Key Expansion……………………………………………….

19

2.4 Diffie-Hellman Key Exchange..…...…………………………………….

20

2.5 Introduction to Magic Square………………………………….………..

21

2.6 Magic Square from the Mathematical View Point…...….……………...

22

2.7 Magic Square Properties………………………………………………...

25

2.8 Magic Square Construction………………………..…………………….

26

2.8.1 Magic Square of Odd Order…………….…………………………

27

2.8.2 Magic Squares with Doubly Even Order.…...………………….....

29

2.8.3 Magic Squares with Singly Even Order…..…..…………………...

31

Types of Magic Square…..…………………………………………….

34

2.10 The Probability of Magic Square………………………………………

37

2.11 What is the Magic Cube?…………..…………………………………..

38

2.9

CHAPTER THREE THE PROPOSED SYSTEM

3.1 Introduction ……………………………………………………………... XI

41

3.2 The Proposed Symmetric Cipher……............…………………...............

42

3.2.1 Design Criteria……..……………………………………………...

42

3.2.2 The TIGRIS Cipher …………………..…………………………..

43

3.2.3 The EUPHRATES Cipher…………………..…………………….

52

3.2.4

Fast Algorithm Revertible Operation Queen (FAROQ)………….

60

3.3 The Proposed Magic Cube…...…………………………………………..

66

3.4 The Construction of Magic cube…………………………………………

67

3.5 The Cross Figure of Folded Cube…………………………...……….......

72

3.6 The Proposed Public Key (Asymmetric Cipher)……………………...…

47

3.7 The Proposed Signature Algorithm……………………………………...

44

CHAPTER FOUR ANALYSIS AND RESULTS WITH IMPLEMENTATION

4.1 Introduction ……….……..........................................................................

88

4.2 The Analysis for the Symmetric Cryptographic Models………………...

88

4.3 TIGRIS-Security Analysis……………………………………………….

90

4.4 EUPHRATES-Security Analysis………………………………………...

92

4.5 FAROQ Security Analysis……………………………………………….

93

4.6 The Randomness Tests…………………………………………………...

94

4.7 Applications of Proposed Symmetric Models………………....................

98

4.8 Advantages and Limitations of Proposed ciphers………………………..

99

4.8.1 The Advantages……………………………………………………

100

4.8.2 The Limitations…………………………………………………….

100

XII

Security Analysis of the Proposed Public Key…...…….…………….....

101

4.10 The Analysis of Magic Cube…………………..……….……………......

103

4.11 Advantages and Limitations of Magic Cube……………..…...…………

104

4.11.1 Advantages of the Proposed Magic cube………………………….

104

4.11.2 Limitations of the Proposed Magic cube………………………….

105

4.12 Applications of the Proposed Models……………..…………………….

106

4.13 Motivations and Limitations for Proposed Public Key……….…………

106

4.14 Graphical User Interface (GUI)………………………………................

108

4.9

CHAPTER FIVE CONCLUSIONS AND RECOMMANDATIONS

5.1 Conclusions …………..….……………………………….......................

110

5.2 Recommendations ………………………………………………………

112

5.2.1 The Symmetric Cipher Recommendations………………………...

112

5.2.2 The Asymmetric Cipher Recommendations…………….................

112

5.2.3 Magic Cube and Magic Square Recommendations………………..

113

XIII

Chapter One

Introduction

CHAPTER ONE INTRODUCTION 1.1. General Background Resent progress and development in the digital communications information technologies have turned life into a digital organization. So there is an urgent need for the handling, saving, and sharing of sensitive information under confident and secure environments which have become as an important demand for people all over the world. Hence, information security represents the nerve of digital technology. So for these reasons, more attention has been devoted to the cryptographic algorithms [1]. In recent years there has been a huge development in cryptographic algorithms of different types and with different strategies. Everyone knows that the AES cipher is a good choice and provides an acceptable performance for several applications that do not need a high level of security, but from the other perspective the AES cipher should have a limited time, and inevitably it will have a specific date of life, since the development in real effective attacks and the cryptanalysis is continuous [2]. The replacement cipher should be submitted to change the orientation thoughts for the researchers from both of designers and cryptanalysts according to the modern cryptanalysis methods and the rapid improvement in the power of computers. It is worth mentioning that the asymmetric cipher or the public key cipher also needs a dramatic change in the designing styles and the mathematical nature on the one hand of the internal operations, algebraic pattern and the general structure as well as the mathematical bases to satisfy the current need and the foreseeable future requirements, on the other [3]. -1-

Chapter One

1.2

Introduction

Literature Survey There are several referred works and gorgeous ideas related to the

submission work of this dissertation, so the presented contributions will be subdivided into three sections that comprise those that are related to symmetric cipher, magic square and magic cube and the asymmetric cipher.

1.2.1 Related Work for the Proposed Symmetric Methods The symmetric cipher is the most important cryptographic protocols that have been developed significantly in the later years. So many researchers and countries have developed their own ciphers. Here, some of the related works will be reviewed in the following sections:  In 2007, Sufyan T. Faraj has submitted a new variant of the AES symmetric cipher that is called Nahrainfish cipher. The proposed cipher has been mainly based on the Twofish cipher’s characteristics with some modifications and developments. It works with 128-bit of block size and variable cipher key that reaches to the 1024-bits. The developed algorithm has a classical Feistel network structure that is based on a key-dependent S-boxes and data-dependent rotations. The proposed cipher has applied a high level of security and an acceptable performance but with some sacrifice for efficiency [4].  In 2013, Nada H. Ali, Abdul Monem Rahma and Abdul Mohsen Jaber have applied some improvements on the AES cipher for the S-Box stage, that includes the generation of several random S-boxes by depending upon the uses of multi ciphering keys technique in order to generate several dependent S-boxes that -2-

Chapter One

Introduction

include each one with its inverse as well as with various constant vectors. The second level is to configure a random indexing for the S-boxes that are constructed to obtain more complexity with large scale for the probability of estimation and guessing. The developed method suffers from time consuming in implementation as well as high cost in hardware [5].

1.2.2 Related Work for the Proposed Asymmetric Methods with Magic Square The embedding of magic square techniques through the public key cipher still under development and research and it is still evolving, since there is no real encryption and decryption method with full dependence on magic square principles and comprehensions, because it uses the magic square just as the additional security layer and as an assistant tool for the real asymmetric algorithms.

 In 2012, Nitin Pandey and D.B.Ojha have proposed a new method of encryption and decryption process that is based on the RSA cipher and magic rectangle’s construction. The proposed method constructs different of singly even magic of rectangles with an even order that don’t accept the divisibility by four, where the sum of each rows and columns values is the same. The main purpose for the rectangle square is to address the numeral values to the corresponding positions with the magical rectangle in different quadrants. So the numbers then encrypted and decrypted using the RSA public cipher. The two researchers have proposed that the developed method increases the complexity and the randomness for the ciphertext and at the same time it requires an extra time for the implementation process [6]. -3-

Chapter One

Introduction

 In 2014, A. Dharini, R.M. Saranya Devi, and I. Chandrasekar have introduced a new approach for secure data transmission through the cloud environment and sharing networks as well as during the Secure Socket Layer (SSL) by the RSA combined with magic square, to provide additional security layer to the cryptosystem. The proposed model submits the confidentiality and the integrity of data over the communication to and from the cloud providers. So it discusses and combines magic square algorithm with the RSA cipher when implemented on data security in cloud computing [7].  In 2009, Gopinanath, Ganapathy, and K. Mani have proposed a new approach for the public key cipher with magic square which is based on generating the magical square with order of doubly even for multiples of sixteen. The developed method is not much different from the previous work except it has taken various methods of the public key cipher. Therefore; the proposed method treated with the positions of the magic square that are corresponding to the ASCII values as an alternative. So the encryption and decryption will be with different numbers that represent the placements of the ASCII elements in the magic square. The ciphering and deciphering process is performed also by the RSA algorithm [8].  In 2014, D.I. George, J.Sai Geetha and K.Mani are three researchers from India who have proposed another technique for combining the RSA cipher with the magic rectangle of singly even order. The construction of magical rectangle is based on several initial parameters that involve magical rectangle’s seed, constant

-4-

Chapter One

Introduction

vector for the amount of column values and the beginning number for the rectangle construction. The main idea for this method is to construct a specific magic rectangle and then the encrypted text or the cipher text which is encrypted by the RSA cipher and then mapping to the positions of numeric values in the magic rectangle and after that will change the ciphertext with those corresponding positions in order to increase the time complexity and to add another security level. The proposed method requires more time of implementation and hardware cost [9].

1.2.3 Related Work for the Proposed Magic Cube For a long time, several researchers and mathematician specialists have created many related works about the magic square and magic cube. The following are some studies and discussions to the prior labor, which so far an associated work to the proposed method:  In 1970, Richard Meyers has invented a perfect eighth-order magic cube that is known by Meyers cube. The Meyers cube is interested in several symmetries properties which assume that the cube is associative and every orthogonal and diagonal line sum to the same specific number. The corners values in the inner small cube as well as the corners values of each rectangular in the Meyers cube also sum to a constant certain number. The prominent feature for the symmetries properties makes that is possible for a tantalizing number and for rearrangements of the cube [10].  In 1981 J. Barkley Rosser and Robert J. Walker are two researchers who have introduced a new approach for constructing a perfect eighth-order magic cube. They have also explained and -5-

Chapter One

Introduction

proved that the perfect pan diagonal cubes are found for whole orders with multiples of 8 and also for all the odd orders that are more than 8 order [11].  In 1988, John Hendricks submitted new ideas and published many refereed related papers. He developed a simple and clear technique in constructing of an odd order magic cube with N order. In addition, he published an extended dimension of the hyper cubes with four, five and six dimensions; also he applied an elegant work and great share in the magic square area and in the methods development for the magical constructions approaches [12].

1.3

Magic Square Comprehension The magic square is considered one of the matrices categories that

constitutes a big challenge for the mathematician researchers and for the amateurs of intelligent games. The core notation for the magic square is how to arrange a set of numbers into the matrix form where each row summation values or column summation values even the two diagonals values should give the same summation result [13]. So there are several types of magic square with different shapes and different construction techniques. The regular or the ordinary magic square is the standard square and also is considered as the most well-known square that has the regular properties. Other irregular magical squares with additional conditions can be stated here like: Latin square, semi-magic square, Bordered magic square, magic hexagon, magic spheres, magic series, magic spider, Nasik square, magic circle and pan-diagonal square etc. [14].

-6-

Chapter One

1.4

Introduction

The Block Ciphers Design The block ciphers are the symmetric key algorithms that encrypt

the clear text as a fixed size of block message at each time to output the block of cipher text mixed by the secret ciphering key. The block cipher has partitioned the clear-text into the seperated blocks of the same lengths of 64-bit, 128-bits and may reach to 1024-bits [15]. Block ciphers methods build by two elementary structures that involve the Feistel Structure (FS) and the Substitution Permutation Network Structure (SPN). The algorithms which are constructed by feistel structure require only one algorithm for encryption and decryption process, because it is the same, in opposite to the SPN that requires two algorithms one for encryption process and the other for decryption process. The AES, square and serpent ciphers represent good examples for the SPN structure and the Data Encryption Standard DES, IDEA, Blowfish, Twofish, MARS, and RC6 cipher and several other algorithms act good examples for the Feistel structure [16].

1.5

The Computational Problems of the Public Key Cipher There are numerous public-key cryptosystems that have been

proposed and developed along the past years until the present time. Most of them have built their mathematical foundation on trained, famous and intractable mathematical problems as shown below: A. The Integer Factorization Problem (IFP): The IFP focuses on the factoring the number to its factors prime numbers. The RSA public key is considered a good paradigm that is based on factoring problem of analyzing the composite N number to its factors of two distinct large prime’s numbers p and q, in order to find the eth root. -7-

Chapter One

Introduction

Thus, the main difficult waylays if the factoring of N is known, so its computational mathematics will be easy to solve the RSA problem [17]. B. Discrete Logarithm Problem (DLP): The core problem here is how to compute the logarithms in a large finite field. The Digital Signature Algorithm (DSA) is a good example which is used in authentication and integrity techniques. Several algorithms use the DLP such as the Diffie-Hellman public key, El-Gamal cipher and the digital signature in addition to the Schnorr signature etc. [18]. C. Elliptic-Curve of Discrete Logarithm Problem (ECDLP): it is another mathematical problem that is also based on the DLP that has been defined over the group of points with an elliptic curve. The

elliptic

curve is

viable

for

ciphering, digital

signatures, pseudo-random generators and other assignments. The examples include the elliptic curve analogues of: DSA (so-called ECDSA), Diffie-Hellman algorithm, El-Gamal cipher and the digital signature mode etc [19]. D. Hyperelliptic Curve Discrete Logarithm Problem (HECDLP): This type of problem also uses the DLP that is defined under an algebraic curve over the group of Jacobian method, which is called the group of divisors of degree 0 module principal divisors on a hyperelliptic curve. Examples comprise the hyper elliptic curve homologue of: DSA, Diffie-Hellman public key model, El-Gamal ciphering and deciphering in addition to the digital signature methods etc. [20].

-8-

Chapter One

Introduction

E. Discrete Logarithm Problem on Algebraic Tori: it is another problem that is also related to the DLP in the finite field of order Fq. Which is mainly associated with DLP on an algebraic torus Tn(Fq) that is equivalent to the DLP in the subgroup of order ⱷn(q). Where ⱷn(q) equivalent to the n-th cyclotomic polynomial. The main goal of Tori is to find short representation for elements of certain subgroup of F*qn. [21].

1.6

Aim of Work There are several elementary objectives the present study is looking

for: the major goals are to design a set of secure symmetric algorithms with different models and different techniques to give the user freedom in selection that any one is suitable for his application. Hence, the choice of algorithm is selected according to the speed, efficiency and the performance or other factors. The proposed system is based, not being only on the symmetric cipher, but also on a developed method of asymmetric cipher in order to implement completed protocol with diverse usage in the cryptographic field. The main issue for the proposed public key method is to provide a secure communication over unprotected network and trusted transmission for data through the public channel by using the encryption methods. The proposed public key is to design new methods of asymmetric cipher based on the magic square and magic cube techniques to speed up the encryption and decryption process and to speed the key generation process in addition to increase the computational complexity.

1.7 The Dissertation Outline This dissertation has been divided into six chapters: Chapter One begins with explaining the whole aspects of the dissertation and -9-

Chapter One

Introduction

introducing the basic concepts of the cryptography. The other four chapters are organized as follows: Chapter Two covers the basic concepts of Advance Encryption Standard (AES) in addition to the designing steps of the Rijndael cipher. This chapter also submits a comprehensive study for the magic squares’ principles; properties, types and techniques in addition to the magic square construction methods and the magic cube definition. Chapter Three produces the proposing of three symmetric ciphers with distinct models and developing new method in the magic cube construction based on the folded procedure for the magic squares approaches, as well as improving new methods of public key and signature algorithms by depending upon the magic square and magic cube features combined with the Diffie-Hellman key exchange method. Chapter Four gives the analysis and the experimental results for each proposed model in addition to the results for some tests on these models. Chapter Five includes the elementary conclusions of the dissertation and recommended notations as well as the basic suggestions for future works.

- 10 -

Chapter Two

Symmetric Cryptography and Magic Square

CHAPTER TWO SYMMETRIC CRYPTOGRAPHY AND MAGIC SQUARE 2.1

Introduction

C

ryptography is the art and science that deals with studies, methods and

techniques of mathematical methodologies. These methods work to convert the meaningful clear-text to rubbish text. So the cryptography enables to transmit the sensitive data across insecure channels and prevents any one to figure out the intent notation except the target destination [22].The main motivations for the cryptography are to provide privacy of communication between two parties and to provide authentication of one party to another. This methodology formulated under the comprehension that each pair of communicating parties needs to have a shared secret key which should be transmitted securely. Consequently, this leads to the difficulty in obtaining signatures with nonrepudiation [23]. There are two basic categories of cryptosystem algorithms: Symmetric algorithms (also called "secret key") which uses the same key for both encryption and decryption; both parties share the same key in encryption and decryption in order to provide confidentiality which needs to keep secret. Symmetric cipher includes many well-known concrete algorithms such as DES, Triple-DES, BLOWFISH, TOWFISH, RC6, Serpent, MARS, IDEA and AES. The second category is the asymmetric algorithms: (also called "public key") that uses different keys for encryption and decryption, one is used for encryption and the other one for decryption. The decryption key is typically kept secretly, therefore called the "private key'' or "secret key''. There are many famous asymmetric algorithms such as RSA, DSA, Elliptic Curve and ELGAMAL etc. [24]. - 11 -

Chapter Two

2.2

Symmetric Cryptography and Magic Square

Selection of the Universal Standard Cipher In 1997, National Institute of Standard and Technologies (NIST) invited

the cryptographers, researchers and data security specialists all over the world to participate in the contest of selecting a standard algorithm, and to apply their own algorithms in order to select the best one to be a good alternative for the DES and the Triple-DES, since the last one has encountered many problems represented by short key and non-resistance against Linear and differential attack as well as the brute force attacks. That notwithstanding with the rapid development in the information technologies [25]. Several distinct algorithms have been applied which, vary widely in their structures and implementation natures those originally presented by researchers from different nations. Fifteen algorithms have been selected from the first round of selection. After deep study and analysis processes were reduced to five algorithms in the second round. The five algorithms selected were MARS, RC6, RIJNDAEL, SERPENT and TWOFISH [26]. On October 2nd 2000, NIST announced that the Rijndael algorithm was the winner of the contest that appeared to be a very good performer in both hardware and software across a wide range of computing environments [27]. Several developed countries such as the United States and Japan submitted extensive researches to develop their own standard block cipher algorithm. The AES is American standard and it is a SPN block cipher standardized by the NIST, which supports three key lengths of 128, 192, and 256 bits [28]. Camellia is a Japanese standard cipher which is a Feistel-type block cipher jointly developed by NTT (Nippon Telegraph and Telephone Corp.) and Mitsubishi Electric. Camellia is similar to the AES cipher it also supports 128-bit, 192-bit, and 256-bit keys. An advantage of the feistel cipher is that the same data path and structure can be used for encryption and decryption process [29].

- 12 -

Chapter Two

2.3

Symmetric Cryptography and Magic Square

AES Structure and Characteristics AES cipher or what is known by (Rijndael) cipher is a symmetric and

iterated block cipher that supports the input entries with a fixed block size of 16 byte of square state array which is corresponding to128-bits and three of distinct keys length of 128-bits, 192-bits and 256-bits accompanied with 10, 12 and 14 rounds respectively. AES cipher interested with highly algebraic structure that is combined several good features in its construction instantiated by security, performance, efficiency, ease of implementation and flexibility. These characteristics make it a good implemented algorithm and an efficient cipher in both hardware and software. The Figure 2.1 states the general structure of the AES cipher [30]. Plaintext

State Matrix

AddRoundK( ) Stage

Cipher Key

SubByte ( ) Stage ShiftRow ( ) Stage 0 - 9 Rounds MixColumn ( ) Stage AddRoundK( ) Stage

Round Key 0

SubByte ( ) Stage ShiftRow ( ) Stage AddRoundK( ) Stage

Round Key 9

Ciphertext

Figure 2.1 Block Diagram for the AES Structure - 13 -

Chapter Two

Symmetric Cryptography and Magic Square

The internal structure of the AES is designed to work with byte (8-bits) operations. AES cipher was not designed from zero, but it can be considered as a smart step in a long development process that eventually paved the way to the design of Rijndael algorithm with inherited good properties form the predecessors and successors block ciphers such as (Shark, BKSQ, Square, Crypton, Hierocrypt, GrandCru, Anubis and Khazad) [31].

2.3.1 The S-Box Construction The SubBytes operation is the first step of the data transformation process in the Rijndael cipher where each block is replaced by its substitution in S-Box table. The S-Box is table with non-linear substitution operation used in most block ciphers that can be constructed either randomly or mathematically that is defined as a square matrix 16×6 values, which contains permutation of all possible 256 values. The construction of the forward S-Box basically composed of two mappings: The first map treats the 8-bits value as an element of GF(28), and takes the multiplicative inverse if the element is non-zero, and otherwise just maps to 00[32]. The second map, treats with the resulting GF(28) element as an 8-bits vector and performs the following affine transformation f(x) over GF(2). Regarding 8-bit or bytes as an elements in GF(28) as stated in Equation (2.1).

b'0 1  b'1 1    b'2 1    b'3  1 b'4 1    b'5 0 b'6 0    b'7 0

0 1 1 1

0 0 1 1

0 0 0 1

1 0 0 0

1 1 0 0

1 1 1 0

1 1 0 0

1 1 1 0

1 1 1 1

1 1 1 1

0 1 1 1

0 0 1 1

- 14 -

1 b0 1 1  b1  1 1 b2 0     1 b3 0  0 b4 0     0 b5 1 0 b6 1     1 b7  0

... (2.1)

Chapter Two

Symmetric Cryptography and Magic Square

The multiplicative inverse has been taken modulo the irreducible polynomial x8 + x4 + x3 + x + 1 and the result Xored with the constant vector that is represented by the value (63). Table 2.1 is the resultant table [33]

Table 2.1 AES-Forward S-Box 0 1 2 3 4 5 6 7 8 9 A B C D E F

0 63 ca b7 04 09 53 d0 51 cd 60 e0 e7 ba 70 e1 8c

1 7c 82 fd c7 83 d1 ef a3 0c 81 32 c8 78 3e f8 a1

2 77 c9 93 23 2c 00 aa 40 13 4f 3a 37 25 b5 98 89

3 7b 7d 26 c3 1a ed fb 8f ec dc 0a 6d 2e 66 11 0d

4 f2 fa 36 18 1b 20 43 92 5f 22 49 8d 1c 48 69 bf

5 6b 59 3f 96 6e fc 4d 9d 97 2a 06 d5 a6 03 d9 e6

6 6f 47 f7 05 5a b1 33 38 44 90 24 4e b4 f6 8e 42

7 c5 f0 cc 9a a0 5b 85 f5 17 88 5c a9 c6 0e 94 68

8 30 ad 34 07 52 6a 45 bc c4 46 c2 6c e8 61 9b 41

9 01 d4 a5 12 3b cb f9 b6 a7 ee d3 56 dd 35 1e 99

A 67 a2 e5 80 d6 be 02 da 7e b8 ac f4 74 57 87 2d

B 2b af f1 e2 b3 39 7f 21 3d 14 62 ea 1f b9 e9 0f

C fe 9c 71 eb 29 4a 50 10 64 de 91 65 4b 86 ce b0

D d7 a4 d8 27 e3 4c 3c ff 5d 5e 95 7a bd c1 55 54

E ab 72 31 b2 2f 58 9f f3 19 0b e4 ae 8b 1d 28 bb

F 76 c0 15 75 84 cf a8 d2 73 db 79 08 8a 9e df 16

2.3.2 InvSubBytes Transformations InvSubBytes, The inverse of the proposed S-box is constructed by applying the inverse of the affine transformation that can be shown in Equation (2.2) followed by applying the multiplicative inverse in GF(2 8) and the result Xored with the constant vector represented by the value (05) of hexadecimal representation, so the resultant table can be stated in Table 2.2. The rational reason for using the constant vector is to increase the complexity of the S-box and to remove fixed point respectively that gives the S-Box construction more resistant against the attacks [34].

- 15 -

Chapter Two

b'0 0  b'1  1    b'2 0    b'3  1 b'4 0    b'5 0 b'6 1    b'7  0

Symmetric Cryptography and Magic Square

0 0 1 0

1 0 0 1

0 1 0 0

0 0 1 0

1 0 0 1

0 1 0 0

1 0 0 1

0 1 0 0

1 0 1 0

0 1 0 1

0 0 1 0

1 0 0 1

1 b0 1 0  b1  0 1 b 2 1     0 b3 0  0 b 4 0     1 b5 0 0 b6 0     0 b7  0

... (2.2)

Table 2.2 AES-Backward S-Box 0 1 2 3 4 5 6 7 8 9 A B C D E F

0 52 7c 54 08 72 6c 90 d0 3a 96 47 fc 1f 60 a0 17

1 09 e3 7b 2e f8 70 d8 2c 91 ac f1 56 dd 51 e0 2b

2 6a 39 94 a1 f6 48 ab 1e 11 74 1a 3e a8 7f 3b 04

3 d5 82 32 66 64 50 00 8f 41 22 71 4b 33 a9 4d 7e

4 30 9b a6 28 86 fd 8c ca 4f e7 1d c6 88 19 ae ba

5 36 2f c2 d9 68 ed bc 3f 67 ad 29 d2 07 b5 2a 77

6 a5 ff ff 24 98 b9 d3 0f dc 35 c5 79 c7 4a f5 d6

7 38 87 3d b2 16 da 0a 02 ea 85 89 20 31 0d b0 26

8 bf 34 ee 76 d4 5e f7 c1 97 e2 6f 9a b1 2d c8 e1

9 40 8e 4c 5b a4 15 e4 af f2 f9 b7 db 12 e5 eb 69

A a3 43 95 a2 5c 46 58 Bd cf 37 62 c0 10 7a bb 14

B 9e 44 0b 49 cc 57 05 03 ce e8 0e fe 59 9f 9f 63

C 81 c4 42 6d 5d a7 b8 01 f0 1c aa 78 27 93 83 55

D f3 de fa 8b 65 8d b3 13 b4 75 18 cd 80 c9 53 21

E d7 e9 c3 d1 b6 9d 45 8a e6 df be 5a ec 9c 99 0c

F fb cb 4e 25 92 84 06 6b 73 6e 1b f4 5f ef 61 7d

2.3.3 ShiftRows Transformations The purpose of the ShiftRows is to distribute the bytes of each input column to different output columns. This step is a linear diffusion process that operates on individual rows and each row of the array is rotated by a certain number of byte positions. The forward shift row transformation, works by rotating the 2nd, 3rd and 4th row of the matrix. The first row is not shifted, and the remaining rows proceed as follows, for the second row 1-bytecircular left shift - 16 -

Chapter Two

Symmetric Cryptography and Magic Square

is performed for the third row 2-byte circular left shift is performed and for the fourth row 3-byte circular left shift as stated in the following Figure 2.2 [35]. S

S'

S0,0

S0,1

S0,2

S0,3

S0,0

S0,1

S0,2

S0,3

S1,0

S1,1

S1,2

S1,3

S1,1

S1,2

S1,3

S1,0

S2,0

S2,1

S2,2

S2,3

S2,2

S2,3

S2,0

S2,1

S3,0

S3,1

S3,2

S3,3

S3,3

S3,0

S3,1

S3,2

Figure 2.2 ShiftRows Operation

2.3.4 Inverse ShiftRows Transformations The decryption process is implemented by the corresponding steps of shiftrows but with an opposite direction. The first row is unchanged; the second row is shifted to the right by one byte, the third row to the right by two bytes, and the last row to the right by three bytes, all shifts being circular, as stated in Figure 2.3 [36]. S'

S S0,0

S0,1

S0,2

S0,3

S0,0

S0,1

S0,2

S0,3

S1,1

S1,2

S1,3

S1,0

S1,0

S1,1

S1,2

S1,3

S2,2

S2,3

S2,0

S2,1

S2,0

S2,1

S2,2

S2,3

S3,3

S3,0

S3,1

S3,2

S3,0

S3,1

S3,2

S3,3

Figure 2.3 Inverse ShiftRows Operation

2.3.5 Forward Mixcolumn Transformation This operation provides both confusion and diffusion. The mixcolumn transformation is based on multiplication of the state with a certain matrix. This matrix is derived from the property that multiplication of a polynomial with a - 17 -

Chapter Two

Symmetric Cryptography and Magic Square

fixed polynomial over GF(28) results in a constant matrix multiplication. In GF(28) columns of the state that can be considered as polynomials. These polynomials are multiplied over GF(2 8) with a fixed polynomial c(x), which is defined as … (2.3)

a(x) = {03} x3 + {01} x2 + {01} x + {02}

This polynomial is coprime to (x4+1). Therefore; the transformation is invertible. This transformation can be written under the form of a matrix multiplication that is for all the 4 columns in the state matrix. As a result of this multiplication are the 4 bytes in a column of the matrix multiplication of s'(x) as follows: [37].

 S '0,c   S '1,c     S '2,c    S ' 3 ,c  

02  01   01  03

03 01 01 02 03 01 01 02 03  01 01 02

 S 0,c   S1,c     S 2,c    S 3 ,c  

2.3.6 Inverse Mixcolumns Transformations The InvMixColumns is similar to MixColumns process but with inverse matrix coefficients, so every column on the state treating as a four-term polynomial with coefficient in GF(28) and multiplied modulo the co-prime of x4 + 1 by the fixed polynomial a-1(x). If the inverse states'(x) is written as a matrix multiplication, then as the following formula:

s'(x) = a-1 (x)

S (x)

Where, a-1(x) ={0b} x3 + {0d} x2 + {09} x + {0e}

… (2.4)

As a result of this multiplication the four bytes in column are replaced by the others as in the following [38]. a( x ) = a-1( x ) mod ( x4 + 1 ) - 18 -

… (2.5)

Chapter Two

Symmetric Cryptography and Magic Square

 S '0,c   S '1,c     S '2,c    S ' 3 ,c  

 0 E 0 B 0 D 09   S 0,c   09 0 E 0 B 0 D   S1,c      0 D 09 0 E 0 B   S 2,c      0 B 0 D 09 0 E S 3 ,c    

2.3.7 AddRoundKey Transformation The key addition operation is referred to by AddRoundKey that includes a number of words (Nb). This operation is viewed as a columnwise operation between the 4-bytes of a state column and 4-bytes of round key column. The addroundkey transformation is as simple as possible and affects every bit of the state. The forward addroundkey transformation is identical to the inverse addroundkey transformation, because the XOR operation has its own inverse [39]. As stated in the following Figure 2.4.

Figure 2.4 Round Key Addition

2.3.8 AES Key Expansion The key generation, key scheduling or what is known by the key expansion is the method which is responsible for generating the ciphering key that should be kept secret. The AES algorithm takes the cipher key. and performs the key expansion technique to generate a key schedule. The key expansion determines how the expanded key generated from the cipher key by depending upon a few sequence steps in Rijndael's algorithm that includes the following steps: [40]: - 19 -

Chapter Two

Symmetric Cryptography and Magic Square

1. Achieving one byte circular rotate on the word of (32-bit). 2. SubByte transformation. 3. The result xored with round constant table to eliminate the symmetries. 4. Key scheduling procedures.

2.4

Diffie-Hellman Key Exchange The Diffie-Hellman is one of the first and earliest public-key protocols

that allows two parties to share a secret key without any predated acquaintance over insecure or untrusted channel. The resultant key can be used later to encrypt as a symmetric key cipher. The Diffie-Hellman protocol is based mainly on the Discrete Logarithm Problem (DLP) and implemented within the finite field of cryptography. Suppose Alice and Bob want to share a secret key over public communication media and to use then in a symmetric cipher, so the information and the key that they exchange will be observed by their adversary Eve [41]. At the beginning Alice and Bob have to agree on a finite field (Fq) and the primitive root (g) in Fq, then each one secretly chooses a random positive number n and m to compute the following: Alice computes X ≡ 𝐠 𝒏 (mod p) Bob computes Y ≡ 𝐠 𝒎 (mod p) The two parties will calculate the share key, where Bob raises the primitive root to the selected value that has been received from Alice, also the Alice raises the primitive root to the value that has been received from Bob to complete the agreement on the shared secret key as stated below: Alice computes X≡ 𝒀𝒏 (mod p) Bob computes Y ≡ 𝑿𝒏 (mod p) Then, the two parties shall have

(𝒈𝒏 )𝒎 = ( 𝒈𝒎 )𝒏 = 𝒈𝒏𝒎 ∈ 𝑭∗𝒒 . - 20 -

Chapter Two

Symmetric Cryptography and Magic Square

The Diffie-Hellman protocol suffers from the man-in-the-middle attack which is considered a form of eavesdropping attack that happens when the malicious attacker or eavesdropper monitors, modifies and retransmits the intercepted information across the communication session between the two users by impersonating the personality of the authorized author. The DiffieHellman concepts paved the way to the invention the RSA public cipher that is considered the most well-known asymmetric cipher which was developed by three brilliant scientists Rivest, Shamir and Adelman [42].

2.5

Introduction to Magic Square Mathematics is the art and the study of methods that treats the logical and

quantity forms as well as arranging them. Mathematics is found everywhere and in everything that we work. It is indispensable science and the cornerstone for several tasks in daily life [43]. The variety in mathematic computational problems makes work with different branches of mathematics fields such as group theories, lattices, Latin squares, determinants, coding theory, matrices, arithmetic and logic and the magic of square [44]. Magic squares have been flourished and grown rapidly with arising of mathematics-based games like puzzles, Rubik and Sudoku games, which have been especially attractive to the amateur mathematicians. The magic square is the order of the numbers in the form of square matrix with equal dimensions that the amount of each row numbers, column numbers, and diagonal numbers is a constant number, that is known by the "magic constant" [45]. Magic square may be divided into parts with letters, symbols, talisman, discrete words or numbers that are engraved or written in it, whether gathered vertically, horizontally or diagonally, forming the same amount or may be added to spell out the same words that are called alpha magic squares. In out dated times it was believed that such squares have magical properties, and perhaps in touch with the orbit and the stars [46]. - 21 -

Chapter Two

Symmetric Cryptography and Magic Square

Figuration of magic square is computationally sensitive, and the indicator of rows and columns are influenced by restrictions, and also affect some diagonals constraints. Moving one indicator affects at least one row, one column value and the diagonal values. Thus, swapping two values will change all possible solutions for all the other indices [47].

2.6

Magic Square from the Mathematical View Point Magical squares remain an interesting phenomenon to be studied, both

mathematically and historically. It is equivalent to a square matrix as a painting full of numbers or letters in certain arrangements. Mathematics is the most interesting subject in computational squares consisting of n2 boxes, called cells or boxes, filled with different integers [48]. This array is called magic square of nxn numbers containing the numbers with consecutive order as 1; 2… n 2. The total elements in any row, column, or diagonals should be the same [49]. The following Figure 2.5 is a magic square of order 3 with 9 values consecutively arranged in the magical arrangement. So, suppose Magic Constant (MC) is a fixed number that represents the amount of each row’s values, column’s values and diagonal’s values have to be added up to a vector numbers. 8

1

6

3

5

7

4

9

2

Figure 2.5 Magic Square of Order 3 The pivot element in the magic square represents the center element in the middle square as it is explained in the Figure 2.5. The pivot element at any magic square of odd order with sequential numbers can be calculated in the following formula:

- 22 -

Chapter Two

Symmetric Cryptography and Magic Square

n 2 1 p= 2

... (2.6)

𝑛2 + 1 32 + 1 𝑛2 + 1 52 + 1 P= = = 𝟓, P = = 𝟏𝟑 and so on [50]. 2 2 2 2 Here, is another formula to determine the pivot element in non-sequential odd order numbers that might begin with indeterminate integer number, or have a period, another word that has a difference between the numbers is greater than one. As stated below in Equation (3.2). Where N= square order, A=starting number and D=difference number that represents the difference between the successive and the previous numbers. Figure 2.6 shows three examples a, b and c respectively that explain the notation. 2 A  D ( N 2  1) P  ( ) 2

... (2.7)

75

54

69

52

17

42

17

3

13

60

66

72

27

37

47

7

11

15

63

78

57

32

57

22

9

19

5

(a) : N=3, A=54 and D=3

(b) : N=3, A=17 and D=5

(c) : N=3, A=3 and D=2

Figure 2.6 Three of Magic Squares with Different Pivot Element

2 * 54  3 (32  1) (a) P  ( 2

)  66

2 *17  5 (32  1) (b) P  ( 2

)  37

2 * 3  2 (32  1) (c ) P  ( 2

)  11

- 23 -

Chapter Two

Symmetric Cryptography and Magic Square

The magic constant, magic vector or magic number these terms are synonyms can be computed by the derivative formula of 𝐌𝐂 =

𝑛(𝑛2 +1) 2

. Thus,

3*3 is a regular magic square which should have that each values of row, values of columns and values of diagonals are equal to 𝐌𝐂 =

3(32 +1) 2

=

30 2

= 15,

4*4 to MC = 34, 5*5 to MC= 65 and 8*8 to MC = 260, and so on [51]. The regular magic square with an order n is a square matrix with the following representation: M = (aij)n x n, where i, j =1, 2, …, n, aij ∈ {1, 2, …, n2} with aij ≠ akl, for all i≠ k or j ≠1 that will give the MC of the magic square which involves the same summation for each row, column and diagonal, as stated in the following Equation (2.8) [52] : n (n 2  1) j 1 aij  i1 aji  i1 aii  j1 ajj  i1 ai, n  i  1  2  MC n

n

n

n

n

... (2.8)

There exists a remarkable derivative formula to determine the sum of series magic constant for the magic square as it is explained in the following Equation (2.9). Recall that the sum of the sequential number of magic squares by dividing the previous formula by n, so that it will give the same amount for the rows and columns, as well as diagonals which include the following term:

The Magic Constant (MC) for a normal magic Cube (M Cube) can be calculated as follows:

n (n 3  1) M Cube  2

... (2.10)

The magic constant (MC) for a Tesseract or quadrilateral that will be referred by (MT) formula can be calculated as follows: - 24 -

Chapter Two

Symmetric Cryptography and Magic Square

n (n 4  1) MT  2

... (2.11)

The generalization of magic constant of n-dimensional layout such as hypercube can be calculated as follows:

n (n n  1) MG  2

... (2.12)

Another type for computing normal magic star for n order will be as in the following: S = 4n + 2.

… (2.13)

The Magic Sum (MS) that includes the summation to the all numbers (rows, columns and diagonals) in a magic square uses the following formula in Equation (3.9).

n 2 (n 2  1) MS  2

... (2.14)

The MS for 3*3 =45, MS for 4*4 =136, MS for 5*5= 325, MS for 8*8=2080 and so on, another method for calculating MS is by multiplying MC * dimension of the magic square [53].

2.7

Magic Square Properties There are several features and marvellous properties for the normal magic

square’s construction that can be listed as follows [54]: 1. The addition of certain number to each number in the square keeps the square magically. 2. The multiplication of a certain number by each number in the square keeps the square magically. - 25 -

Chapter Two

Symmetric Cryptography and Magic Square

3. The exchange of two columns or two rows from the centre of square equidistantly keeps the square magically. 4. The magic square of an even order with interchanged quadrants keeps the square magically. 5. The magic square of an odd order with rows interchange and partial quadrants maintains the magic square. 6. The fantastic properties for the square matrix make the square “magic” because it contains a distinct positive integers from 1, 2, …, n 2 and the vector sum for all directions is the same. 7. The rank or order of magic square is determined by the size or dimension of square matrix. 8. The probabilities of construction magic square are increasing speedily according to the size or the order of magic square which involves several forms of magic square except the rotations and reflections cases.

2.8

Magic Square Construction There is no specific method or limited algorithm to build or construct all

types of magic squares. So the method which does for singly even order of magic square will not work for the doubly even or odd order square without some additional work or modification, except for the trial and developing computer software by using programming languages [55]. Various methods for constructing magic squares have been evolved through the ages. When considering these methods, it is useful to categorize magic squares in three classes according to the matrix dimensions by discussing three most common techniques for the construction of magic squares: those of an odd order; those of a singly even order and the doubly even order [56].

- 26 -

Chapter Two

Symmetric Cryptography and Magic Square

2.8.1 Magic Squares with Odd Order One of the easiest three types of magic squares where the order or degree n is of the form 2n + 1, where n may be any integer number (1, 2, 3, 4 etc.). An example of odd order includes the De la Loubère’s method. The matrix dimension will be 3*3, 5*5, and 7*7 and so on. Odd order magic squares are fairly easily constructed by using any one of these methods such as pyramid or serrated method and other method like de la Loubere's or what is known by the Staircase method [57].

 De la Loubère’s Method The third odd order square is the smallest possible square in the odd integer number after number one, which has just one configuration in case of eliminating the reflections and rotations cases. The Mathematician scientist de la Loubère produced a novel method to construct any odd order integer of magic square that can be explained by the following steps [58]: 1. Put number ‘1’ or any starting number in the center cell of the above row, and arrange the other numbers by putting one row to up position as well as one column on the right of its predecessor number. 2. When the next number placement is outside the boundary of both rows and columns, put the number currently next below of the previous number. 3. The numbers arranged diagonally upward to the right, continually to the next column. 4. Whenever the position is reached that is really occupied or reserved, drop down one placement and go on. But if it reached to right corner cell in the upper, scroll down only one row.

- 27 -

Chapter Two

Symmetric Cryptography and Magic Square

5. If the cell that holds a number is filled in, put the new number immediately below the current one cell that is reserved by its predecessor. 6. Whenever the next number position is outside the boundary, put the next number at the antonym end of the row or opposite column, the numbers are ongoing at the last placement to the left of the relater highest row. 1

1

1 3

2

2 1 3

3

4

3

2

4

1

6

8

5

7

3

2

4

4

1

1 5

3

6

5

2

4

2

1

6

8

1

6

5

7

3

5

7

2

4

9

2

Figure 2.7 Magic Square of Odd Order Constructions’ Steps Another way can be adopted for construction of odd order square by using the pyramid method or diagonals. This method is so easy that it consists of the following steps [59]: 1. Build a pyramid or a serrated form on each side of the square. This makes a square fixed on apex. 2. Fill the diagonal sequentially; put the numbers 1 to n2 in the diagonals form as shown in Figure 2.8. 3. Fill the diagonal holes of each integer number is not in the square boundary (that arises through the pyramids you put) by enrolling to the opposite hole, inside to the corresponding empty square.

- 28 -

Chapter Two

Symmetric Cryptography and Magic Square

3 2 1

6 5

4

9 8

2

7

6

9

5

1

4

3

8

7 Figure 2.8 Pyramid Magical Square with order Three The same approach may be extended for any odd order square as stated below for the 5x5 square matrix in Figure 2.9. 5 4 3 2 1

10 9

8 7

6

15 14

13 12

11

20 19

18 17

16

25 24

23

3 20 7 24 11

16 8 25 12 4

9 21 13 5 17

22 14 1 18 10

15 2 19 6 23

22 21

Figure 2.9 Pyramid Magical Square with order Five

2.8.2 Magic Squares with Doubly Even Order The Doubly even order squares where the order n is of the form 4n, such as (4, 8, 12, 16, 32, etc.). The order of doubly even square can be divided by 2 and 4. The example includes the Albrecht Dürer’s method. The dimension of square matrix will be 4*4, 8*8, and 12*12 and so on. There is no specific or fixed algorithm for constructing the even-order squares. However, there are some methods that can be applied for building magic squares of even orders. So, the creation of ordinary magic square of 4x4 orders in the following method. Starting with the 4x4 square matrix in which the numbers from 1 to 16 - 29 -

Chapter Two

Symmetric Cryptography and Magic Square

are placed across the rows. However, the following method is invented to work for 4x4 normal magic square, and by making some modifications and changes may be worked for a higher dimension of doubly even matrix [60].

 Albrecht Dürer’s Method This method belongs to the name of its inventor Albrecht Dürer who has created a public method for constructing doubly even magic square. The invented method including place the numbers from 1, 2 ...,16, sequentially at the upper left corner to the cells proceed straight forward horizontally without crossing by the two diagonals, which remain unoccupied by the numbers like the following square on the left of Figure 2.10 (a). Another method can be constructed by the same square by the opposite notation which comprises overfills the two diagonals with numbers and leaves the other cells empty as stated on the middle of the mentioned Figure 2.10 (b). Then complete the unoccupied cells in the square with opposite cells values as shown in the right Figure 2.10 (c) [61].

2

3

5 9

1 8 12

14 15

4

1

15 14

4

7

12

6

7

9

10 11

8

10 11

5

6 13

Figure (a)

16

13

Figure (b)

3 2 16 Figure (c)

Figure 2.10 Example of Dürer Approach The Dürer's method has extra appealing features addressed by the sums of the four corners or sum of the middle four numbers gives the same magic constant. Some people can construct the previous example of even square by only three steps as follows [62]: - 30 -

Chapter Two

Symmetric Cryptography and Magic Square

1. Enter the numbers in series order. 2. Reveres the entries in the diagonals, see Figure 2.11. 3. Reverse the other values in the opposite direction or on cross format to complete the final shape as it is stated in the third step.

1 5 9 13

2 3 4 6 7 8 10 11 12 14 15 16 First Step

16

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

16 5 9 4

Second Step

2 11 7 14

3 10 6 15

13 8 12 1

Third Step

Figure 2.11 Other Example of Dürer Approach As it was known by doing some reflections and rotations or in other words by interchanging rows, columns or corner groups you can find some other distinct magic square as stated in following Figure 2.12: 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1

16 2 3 13 9 7 6 12 5 10 11 8 4 15 14 1

16 3 2 13 5 10 11 8 9 6 7 12 4 15 14 1

16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1

6 12 9 7 15 1 4 14 3 13 16 2 10 8 5 11

16 2 9 7 5 11 4 14 3 13 6 12 10 8 15 1

16 2 3 13 9 7 6 12 5 11 10 8 4 14 15 1

Figure 2.12 Some Reflection and Rotations for the Dürer approach

2.8.3 Magic Squares with Singly Even Order Squares where n is of the form 2(2n+1) = 4n+2, such as (2, 6, 10, 14, 18, 22, etc.). The order of a singly even square can be divided by 2 but not 4. The - 31 -

Chapter Two

Symmetric Cryptography and Magic Square

example includes the Philippe de la Hire’s method. The matrix dimension will be 6*6, 10*10, and 14*14 and so on [63].

 Philippe de la Hire’s Method This method is the name that belongs to a French mathematician Philippe de la Hire. This method creates a singly even magic square. The construction square from this type is so much difficult to be implemented by hand or with pen and paper, since the singly even orders are generally the most sophisticated methods of all squares to build [64]. 1. The first step is to partition the square into four equal sized squares.

An example, for constructing a 6x6 magic square, let the start with four 3x3 squares. Then construct four magic squares in a pattern as indicated in Figure 2.13. Basically, this means first square will build a magic square with the numbers 1 through 9 in the upper left-hand block, the second one of magic square will begin with number 10 and end with number 18, the third one will contain the numbers from 19 to 27 and the fourth one goes from 28 through 36, and so on, until to fill the whole squares or finish the numbers’ distribution. 2. The last square is imposed on the completed square. The computation for the magic constant for all columns sum to the same number 111. But for the rows this is a different case. Since, it has not a subject to the magic constant’s rule. So the first three rows in a square sum to 84 and the last three sum to 138. 3. It should make some changes on some elements in rows, and alter with other elements in the same column to keep the summation of magic constant equal to 111.

- 32 -

Chapter Two

8 3 4

1 5 9

6 7 2

Symmetric Cryptography and Magic Square

8 3 4

1 5 9

8 3 4

6 7 2 17 12 13

10 14 18

15 16 11

1 5 9

6 7 2

26 21 22 17 12 13

19 23 27 10 14 18

24 25 20 15 16 11

8 3 4 35 30 31

1 5 9 28 32 36

6 7 2 33 34 29

26 21 22 17 12 13

19 23 27 10 14 18

Figure 2.13 de la Hire Technique of Order Six 4. The six numbers that will alter in the square have been highlighted in bold text or highlighted cell. Because there is still some more work to be done on this magic square. The bold numbers in Figure 2.14 state the exchanging process with their corresponding numbers. 26 21 22 17 12 13

19 23 27 10 14 18

24 25 20 15 16 11

35 1 6 26 30 5 7 21 4 9 2 22 8 28 33 17 3 32 34 12 31 36 29 13

19 23 27 10 14 18

24 25 20 15 16 11

35 1 6 26 30 5 7 21 31 9 2 22 8 28 33 17 3 32 34 12 4 36 29 13

19 23 27 10 14 18

24 25 20 15 16 11

35 1 6 26 19 3 32 7 21 23 31 9 2 22 27 8 28 33 17 10 30 5 34 12 14 4 36 29 13 18

24 25 20 15 16 11

35 1 6 26 19 3 32 7 21 23 31 9 2 22 27 8 28 33 17 10 30 5 34 12 14 4 36 29 13 18

24 25 20 15 16 11

35 3 4 8 30 31

1 5 9 28 32 36

6 7 2 33 34 29

Figure 2.14 Example of de la Hire with Order Six

- 33 -

24 25 20 15 16 11

Chapter Two

2.9

Symmetric Cryptography and Magic Square

Types of Magic Square There are many techniques and several types of magic square that can be

categorized according to the features they may own, but the simplest and commonly used method for all values of n, is to follow some formulas that generate regular patterns that will become necessary in discussing other properties of magic squares such as:  Normal Magic Square: The most popular nxn square which was discussed earlier, the square with order n which represent an array M=(aij)n x n, where (i, j) =1, 2, …, n, aij ∈ {1, 2, 3 …, n2} with aij ≠ akl, for all i ≠ k or j ≠1 [65].



The Semi-Magic Squares: is a magical square matrix with the same characteristics except that the two diagonals do not give the same sum of magic constant. Semi-Magic with some reflections and rotations give distinct semi-magic square. It is a an equal square matrix of order n that can be formulated by M=(aij)n x n, where i, j =1, 2, … , n , aij ∈ {1, 2, … , n2} with aij ≠ akl, for all i ≠ k or j ≠1, that includes the following formula [66].

n (n 2  1) aji   S j1 aij   2 i 1 n

n

1

5

9

6

7

2

8

3

4

Figure 2.15 Semi-Magic Square with Order Three

- 34 -

... ( 2.15 )

Chapter Two

Symmetric Cryptography and Magic Square

 Nasik Square: The Nasik square is characterized with the feature of that the sum of two certain cells resultant to half of the magic constant. Another property of Nasik square that has all the “broken diagonals” sum to a magic constant as well as stated in Figure 2.16 [67].

1

14

7

12

15

4

9

6

10

5

16

3

8

11

2

13

Figure 2.16 The Nasik Square Technique  Associated Squares: This kind of square is associated with the skew properties that include the sum of each two certain cells symmetrically opposite the center of square that gives the sum to the half of magic constant which is equal to 17, in addition to have the properties of normal magic square. See Figure 2.17 [68].

1

15

14

4

8

10

11

5

12

6

7

9

13

3

2

16

Figure 2.17 The Associated Squares Technique  A Pandiagonal Magic Square: This type of magic square is the nearest to the associated square and it has other fascinating properties, which are - 35 -

Chapter Two

Symmetric Cryptography and Magic Square

resultant in the same magic constant with different patterns. The pandiagonal square of order four has several features represented by those of square with order two or the corners of each square with order three that give the same magic constant. The last discriminating feature includes any two adjacent cells vertically or horizontally together with the corresponding two cells gives the same magic constant of the square like 14+11+3+6 and 13+12+4+5. See Figure 2.18 [69].

1

8

13

12

14

11

2

7

4

5

16

9

15

10

3

6

Figure 2.18 The Pandiagonal Square  Ultramagic Squares: This type of magic square combines both the properties of normal magic square and the pandiagonal properties in addition to the associative (center symmetric) properties. The Ultramagic square is found for order n > 4, the below Figure 2.19 is an Ultramagic square of 5x5 order which includes distinct prime numbers [70]. 113

1151 1229

839

521

41

941

953

701

911 101 1013 1091 449 461

311

389

1361

881

563

1301

491

173

251

1289

Figure 2.19 The Ultramagic Squares Technique  Border Magic Square: The Border square is another type of magic square that includes all the usual properties of regular magic square in - 36 -

Chapter Two

Symmetric Cryptography and Magic Square

addition to the border feature. The border feature means if one border (layer) is removed from the square, the square will maintain the magic properties even if it removes the second border and so on according to the square dimension until it reaches to the lowest dimension of third order. See the following Figure 2.20 [71]. 47 4 2 43 38 40 1

11 37 18 19 36 15 39

8 20 26 27 22 30 42

9 6 45 49 17 16 35 46 21 28 32 48 25 23 31 7 29 24 14 12 33 34 13 10 41 44 5 3

Figure 2.20 The Border Square Technique

2.10 The Probability of the Magic Square The probability of construction the magical square increases considerably with the increasing in order of magic square as was mentioned earlier. So, there is merely one ordinary magic square of the third order, but by doing some reflections, transpositions and rotations, it will get seven other undifferentiated cases of magic square as stated in Figure 2.21 [72]. The probability of constructing magic square of fourth order (4x4) is 880 time, and the probability of constructing fifth order is more than 13 million normal magic squares. There are (n2)! Styles to overfill the nxn square matrix with integer’s numbers between 1 and n2, without redundancy, but there are just a few of them match the magic squares features. The construction of magic square acts a great challenge for the intelligent search methods for existing various magic square [73].

- 37 -

Chapter Two

Symmetric Cryptography and Magic Square

4

9

2

2

9

4

8

1

6

3

5

7

7

5

3

3

5

7

8

1

6

6

1

8

4

9

2

Normal Magic Square

Horizontal Reflection

Vertical Reflection

4

3

8

6

7

2

8

3

4

9

5

1

1

5

9

1

5

9

2

7

6

8

3

4

6

7

2

Left Diagonal

Right Diagonal

Rotation 90

6

1

8

2

7

6

7

5

3

9

5

1

2

9

4

4

3

8

Rotation 270

Rotation 180

Figure 2.21 Rotations and Reflections of Magic Square

2.11 What is the Magic Cube? Magic cube is an extension to the magic square with three dimensions or more, that contains an arrangement set of integer number from 1,2, …n3. The sum of the entries elements in rows direction, columns direction, and all the diagonals direction give the same magic constant for the cube. A magic cube construction of order 3 is shown in Figure 2.22 [74].

10

26

6

23

3

16

9

13

20

24

1

17

7

14

21

11

27

4

8

15

19

12

25

5

22

2

18

Figure 2.22 Magic Cube of Order Three - 38 -

Chapter Two

Symmetric Cryptography and Magic Square

The magic cube is like the magic square from the point of probability construction that increases dramatically with the order of magic cube but with higher jumps. The magic cube in Figure 2.23 is another direction in the cube construction. The starting element in the diagonal cube begins from one corner of the cube that comprises the upper layer dimensions through the lower left corner. This is the smallest normal magic cube of 3x3x3 dimension with sequential numbers from 1 to 27 that are organized in three layers of nine numbers and the magic constant for this cube is sum to 42. These layers represent the dimensions or faces for the magic cube that arranged magically from all directions [75].

Figure 2.23 Magic Cube of Three Layers Magic cubes are more than playing games with numbers like the chessboard or Rubik cube, but they substantially depend upon the mathematical rules in their construction. Magic cubes are embedded in several mathematical fields like the number theory, matrices, and combinatory. There exist eleven of distinct flat shapes that can be folded-up to construct a shape of cube as stated in the following Figure 2.24 [76].

- 39 -

Chapter Two

Symmetric Cryptography and Magic Square

1st Cube

2nd Cube

3rd Cube

4th Cube

5th Cube

6th Cube

7th Cube

8th Cube

9th Cube

10th Cube

11th Cube

Figure 2.24 Eleven Distinct Shapes for the Magic Cubes

- 40 -

Chapter Three

The Proposed System

CHAPTER THREE THE PROPOSED SYSTEM 3.1

Introduction

The design and analysis of cryptosystems have become very necessary to all aspects of life and more popular topic due to the fact that they have become of vital importance for future requirements. Information security plays an important role in growing technology revolution and a rapid progress in networks communications. Hence, there is an urgent demand to protect numerous amounts of important data from malicious attacks that involve business management, conducted transfer of money, financial marketing, intellectual property, and a lot of other services. In addition, to protect a huge of digital information from tampering, modification and preventing untrusted parties from an unauthorized access. Thus, these challenges made the system designers and analysts think towards the developing of strong and secure cryptographic algorithms that have to face the current difficulties. The proposed system includes three main parts of designing processes those of (Symmetric cipher, Asymmetric cipher and the magic square & magic cube). So, it involves a set of symmetric and asymmetric ciphers designed with different techniques that involve the encryption data with proposed symmetric ciphers and sending the cipher key in a trusted form also by another proposed asymmetric cipher by depending upon the traditional public key combined with magic square and magic cube problem. The proposed symmetric cipher comprises designing and implementing three different block cipher algorithms. Therefore; the proposing of asymmetric cipher involves the development of a new variant method of public key cipher with digital signature depending upon the Diffie- 41 -

Chapter Three

The Proposed System

Hellman of public key exchange combined with magic square and magic cube problem.

3.2

The Proposed Symmetric Cipher The block ciphers algorithms are consider very important branch in the

cryptographic science that are considered the backbone in the designing protocols of shared secret key which is known by the symmetric cryptosystems, so in this part of the current chapter three proposed symmetric algorithms will be discussed in detail.

3.2.1 Design Criteria The proposed algorithms are designed according to the NIST standard criteria and especially according to the wide trail strategy that the AES cipher has been adopted through its design. So there are many standard criteria in the designing process that have been taken into account. The design process of all the proposed ciphers was subject to several factors that comprise the software and hardware properties and other important factors as in the following: 1. High margin of security 2. Design simplicity with repetitive shifting 3. Cost reduction in hardware 4. Resistance against all known attacks 5. Conservativeness 6. Suitability for secure implementations 7. Symmetry in the round transformation

- 42 -

Chapter Three

The Proposed System

3.2.2 The TIGRIS Cipher This is the first proposed symmetric algorithm that is considered a new revision of the AES cipher with high level of security and an elegant construction called TIGRIS cipher. The TIGRIS’S name is inspirited from one of the two famous rivers in Iraq. TIGRIS cipher is built carefully with coherent structure which is based on solid algebraic and well mathematical opinions. The proposed cipher uses the SPN structure and what is known by the Galois Field GF(28). It is an iterated cipher that has a conservative design which is simply performed on both mini hardware and various software platforms. It operates with the text of array with length of 128-bits and with three different ciphering key of lengths (128,192 and 256) bits. The proposed cipher uses basically 4 main stages in the round transformation. These are Xored add operation between the message block and the ciphering key (AddRoundKey),

S-box

tables

(SubByte

operation),

row

shifting

(ReversibleShiftRows) and the mixing of each column in the matrix (ShiftingMixcolumn). These operations are repeated with certain numbers of rounds until to complete the encryption process.

A. TIGRIS Rational Design The proposed cipher is focused on the performance and the speed of the algorithm operations in addition to the security aspects with simplicity in design idea, which leads to figure out the algorithm and explains the entire aspects of the design rationale. This cipher provides a good resistance against theoretical and practical cryptanalytic attacks, since it uses a complex operation and extra bit wise operations with two constant vectors that represent a constant word in its key generation process. Thus, through the design process of TIGRIS algorithm many factors have been taken into - 43 -

Chapter Three

The Proposed System

account such as number of designing gates, the internal of memory requirements, and the performance of the cipher as well as several practical effective attacks. The TIGRIS cipher built by solid and proven algebraic foundation that represents the main obstacle against the expected attacks.

B. TIGRIS Structure The structure of TIGRIS cipher is one of the most prominent changes that discriminate TIGRIS cipher from the AES and its predecessor’s ciphers, in spite of several algorithms built by depending upon the AES ideas and its common structural characteristics (see Figure 3.1). The round transformation of the proposed cipher also consists of the same four stages operations. The TIGRIS cipher has a flexible structure with high non-linearity in SubByte operation and the similarity in ShiftingRows that need no inverse. In addition to the extra shifting operations in diffusion layer (ShiftingMixcolumn) that repetitively recurs for each four rounds with shifting for the equation of mixcolumn four times to generate four different equations through the four repetitive rounds with the same coefficients. The ShiftingMixcolumn stage generate a new linear equations but in different coefficients’ arrangement that needs to different inverse for each round. The coefficient values of the linear equations should be matched with their inverses in forward and backward operations that keep the arrangement properly. The round key generator uses a compact method that generates the round key addition by two directions in column state and in row state with two complex (F) functions, as a result the two generated ciphering keys Xored together with two constant vectors that are represented by golden ratio and the base natural logarithm to produce the generated ciphering key in each round.

- 44 -

Chapter Three

The Proposed System

Plaintext AddRoundKey (State, Round)

I= 1 SubByte-Stage ReversibleShiftRows-Stage Shifting MixColumn-Stage AddRoundKey (State, Round)

SubByte-Stage ReversibleShiftRows-Stage Shifting MixColumn-Stage

SubByte-Stage ReversibleShiftRows-Stage Shifting MixColumn-Stage AddRoundKey (State, Round)

SubByte-Stage ReversibleShiftRows-Stage Shifting MixColumn-Stage AddRoundKey (State, Round)

I=I+1

Yes

I > 8-bit =right rotate over the vector - 51 -

Chapter Three

The Proposed System

Figure 3.4 TIGRIS-Key Expansion

3.2.3 The EUPHRATES Cipher The second proposed symmetric cipher is called the EUPHRATES cipher. The EUPHRATES’s name also is inspirited from one of the two famous rivers in Iraq. It is a developed revision of the TIGRIS cipher which was proposed in the previous sections. It works also with block size 128-bits and three of different key size of (128,192 and 256) bits, similar to the AES standard but also with sixteen rounds. The EUPHRATES cipher uses the Galois Field GF(28) as the mathematical representation and provides a good insight to the block cipher design with complex structure.

A. The EUPHRATES Structure The EUPHRATES cipher is composed of four main transformations that include SubBytes, ReversibleShiftColumns, ShiftingMixcolumn and a bit by bit Xored operation with a ciphering key (Round key Addition). The last round of the EUPHRATES is compounded of the similar stages as the origin round in the AES except it includes the ShiftingMixcolumn stage. - 52 -

Chapter Three

The Proposed System

The EUPHRATES cipher uses a compact S-box which is considered the source of nonlinearity in the algorithm and the equations that describe it. It will be the main hitch that prevents the system from being easily solved. It is similar to the AES S-box on the one hand of the work, but from the construction view, it uses a different affine transform with different constant vector and different irreducible polynomial. The second step of the EUPHRATES is the linearity which is provided by the shifts of the columns of the state matrix by a certain circular shifting which is reversible and symmetric forward and backward. The third step of the round transformation is the shifting for the coefficient of the linear equation to generate new equations by simple reordering arrangement for the same values; for more details (see Figure 3.5). The core notation for the design process is in the shifting step especially in the backward’s linear equation, since it is not used in the decryption process, because as a replacement it will use the forward linear equation Xored with the complement (difference) values that make the forward linear equation coefficients equal to the backward linear equation coefficients as the alternative in decryption process. This means that the ShiftingMixcolumn stage does not use the inverse linear equation in backward decryption process, but it uses the same forward linear equation in encryption and decryption except it Xored with complement (difference) values in decryption process. This means the proposed cipher can works with two equivalent structures according to the ShiftingMixcolumn stage, either it implemented straight as the traditional ciphers or by use the forward stage with difference as a replacement in backward stage.

- 53 -

Chapter Three

The Proposed System

Ciphertext

Plaintext

(State, Round) (State, Add round key Round) ()

(State, Round) Add round key ( )

I =1

I =1 1 SubByte ( )

InvSubByte ( )

ReversibleShiftColumns ( )

ReversibleShiftColumns ( )

ShiftingMixColumn( )

ShiftingMixColumn( )

SubByte ( )

InvSubByte ( )

ReversibleShiftColumns ( )

ReversibleShiftColumns ( )

ShiftingMixcolumn ( )

ShiftingMixcolumn ( )

Add round key ( )

Add round key ( )

SubByte ( )

InvSubByte ( )

ReversibleShiftColumns ( ) ShiftingMixcolumn ( ) Add round key ( )

Schedule

Add round key (StateRound)

ReversibleShiftColumns ( )

key

Add round key (StateRound)

Add round key ( )

ShiftingMixcolumn ( )

SubByte ( )

InvSubByte ( )

ReversibleShiftColumns ( )

ReversibleShiftColumns ( )

ShiftingMixcolumn ( )

ShiftingMixcolumn ( )

Add round key ( )

Add round key ( )

I=I+1

I=I+1

Yes

Complement ShiftingMixColumn( )

Complement ShiftingMixColumn( )

Complement ShiftingMixColumn( )

Complement ShiftingMixColumn( )

Yes I