An Improved Algorithm for Partial Cryptography of Digital Video

20 downloads 6448 Views 4MB Size Report
(encryption of data important part of the digital video because it is less in time ... SDD algorithm uses two keys for encryption as well as a block of bits of variable ...
An Improved Algorithm for Partial Cryptography of Digital Video A THESIS SUBMITTED TO THE COUNCEL OF THE COLLEGE OF EDUCATION, UNIVERSITY OF ZAKHO IN PARTIAL FULFILMENT OF THE REQUIERMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY IN COMPUTER SCIENCE

BY

BASIMA ZRKQO YACOB B.Sc. COMPUTER SCIENCE, MOSUL, 1991 M.Sc. COMPUTER SCIENCE, DUHOK, 2005

Supervised by  Prof

1433 A.H.

.Dr. Abdul Monem S. Rahma 

2012 A.D.  

         

Dedication         

In Memory Of My Brother (Ismail) 1969-2009

i     

Acknowledgments I would like to extend my deep thanks and gratitude to my highly respectable supervisor Prof. Dr. Monem Saleh Rahma for his esteemed efforts, invaluable advice and ideas on the research and also generosity, and constant help. His support and expertise resolved many hurdles that I encountered throughout the course of this work. With great esteem I express my cordial gratitude to Zakho University President, Dr.Lazgin A. Jameel for his kind support during the achievement of this work. My deep thanks go to the Dean of Duhok Institute Dr.Adnan Mohsin for his efforts in establishing the high degree section ( computer science ) Zakho University, and to all lectures staff who have guide me in to obtain my Ph.D. Many thanks are also due to the former Head of the Computer Science Department-Duhok University Mr.Majid Nouri for his assistance. My complements are due to Mr.Andrews M.Yokhana, supervisor in international school-Duhok for his kind efforts in guiding me in English language. Special thanks go to my sister Mona and all those who helped or encouraged me during my study. Finally, I would like to express my deep gratitude to my family members, especially my husband for their patience, moral support and for providing me with convenient facilities.

ii     

Abstract In recent years, digital video technologies have been used widely in the field of telecommunications and television and satellite broadcasting. The great expansion in digital broadcasting trade. The protection of viewing rights of films and broadcasting presented as a matter of commercial exclusive rights and its security requires using techniques that allows only the authorized (people who pay the charges of viewing) to see the broadcast. Encryption was the solution because it will not allow watching only for the owner of the encryption key. Here raised the conflict between the need for Encryption with high complication to time, movies that should be displayed in real time such as presentations on sports games.

This thesis provides the solution in the partial encryption technology (encryption of data important part of the digital video because it is less in time consumption) and the proposition of symmetric dual key Dynamic block algorithm (SDD) with a speed sufficient to meet the requirements of real time with high level of complexity. In addition, this technique preserves the structure of the file.

SDD algorithm uses two keys for encryption as well as a block of bits of variable size (dynamic), and block size is mapped to (3 or 4 or 5 or 6 bits) as an element that belongs to the range of the finite fields. And the so-called the first key control sets the block size to be encrypted to determine whether (3 or 4 or 5 or 6 bits), while the second key is used in encryption, and are based on calculations used in the algorithm on the theory of Galois's mathematical finite fields GF (2 n). iii     

The proposed encryption algorithm achieve the best results of the time factor, as the partial encryption using the SDD is faster 13 times of the encryption using AES and 9 times of the decryption using AES. And it also provides a high level of complexity for its resistance to attacks, because of the use of dual key as well as the use of dynamic block size encryption, so it would be very difficult to guess the key. For example, to decode an encrypted message is composed of 128-bit the attacker needs 8.86569157e +188 likelihood of keys at a minimum and a maximum of 7.91569097e +253. And that the comparison between the SDD and AES in terms of the number of potential keys that needed to decode each message length of 128 bit and found that SDD needs to a greater number of keys of AES is increased by the minimum and reduce 1.49589906e +98 1.43336854e +293 is the highest likelihood of the keys.

iv     

Table of Contents  Subject 

Page No.

Dedication…………………………………………………….. Acknowledgements…………………………………………… Abstract……………………………………………………….. Table of contents……………………………………………… List of Figures………………………………………………… List of Tables…………………………………………………. List of Abbreviations……………………………….…………

i ii iii v viii xii xiv

Chapter One: General Introduction 1 1 3 4 6

1.1 Introduction………………………………………………. 1.2 Problem Statement………………………………………... 1.3 Video Encryption…………………………………………. 1.4 Digital Video Architecture ……………………………….. 1.5 Real Time Digital Video Encryption …………………….. 1.6 Classification of Digital Video Encryption Techniques ……………………………………………….. 1.7 Literature Survey………………………………………….. 1.8 Aim of the Thesis…………………………………………. 1.9 Layout of the Thesis…………………………….…...........

7 8 12 13

Chapter Two: Introduction to Finite Fields and Cryptography 2.1 Introduction………………………………………………. 2.2 Abstract Algebra Mathematical Concepts………………... 2.2.1 Groups………………………………………….... 2.2.2 Rings ………………………………………….... 2.2.3 Fields……………………………………………. 2.2.4 Polynomial Rings……………………………….. 2.3 Finite Field Operations on GF(2 ) ……………………..... 2.3.1 Addition ……………………………….……....... 2.3.2 Multiplication ………………………………....... 2.3.2.1 Finding the Multiplicative Inverse……..... 2.4 Cryptography and Cryptanalysis……………….……........ 2.4.1 Symmetric Key Encryption………………….…...              2.4.2 Examples of Block Ciphers……………………....

14  14 15 16 16 17 18 19 21 25 26 27 28

v     

2.4.2.1 Data Encryption Standard (DES) …….…. 29 2.4.2.2 Advanced Encryption Standard (AES)….. 29 2.4.3 Cryptanalysis……….……………………….….... 31 2.4.3.1 Cryptanalysis of DES….............................. 31 2.4.3.2 Cryptanalysis of AES………….…............. 32 Chapter Three: Introduction to Digital Video Structure 3.1 Introduction……………………………………………… 3.2 Digital Video Fundamentals and Representation…………. 3.2.1 Digital Images……………………...……............. 3.2.1.1 Color Spaces…………………………….. 3.2.1.1.1 RGB………………………..…… 3.2.1.1.2 YUV…………..………............... 3.2.1.1.3 YCbCr……………...…….…........ 3.2.2 Sampling and Resolution……………………..…. 3.2.3 Frames and Fields……………………………….. 3.3 Structural Hierarchy of Digital Video…………….……… 3.3.1 Sequence Layer………………………………....... 3.3.2 Group of Pictures (GOP) Layer…………….…..... 3.3.3 Picture Layer……………………………………... 3.3.4 Slice Layer…………………………………...…... 3.3.5 Macroblock Layer………………………………... 3.3.6 Block Layer………………………………............. 3.4 I-frame Detection…………………………………............. 3.5 Digital Video Files………………………………………... 3.5.1 AVI Format…………………………………..…... 3.5.2 MPEG…………………………………………….. 3.5.3H.261and H.263…………………………..............

34 35 35 36 37 38 39 41 43 43 45 46 46 48 48 49 50 50 50 51 54

Chapter Four: The Proposed Design 4.1 Introduction………………………….....……………......... 55 4.2 Construction Addition and Multiplication Tables for GF (2 ), GF (2 ), and GF (2 )……………………..... 55 4.3 The Modification of the Security Broadcasting System...... 62 4.4 Symmetric Dynamic Dual (SDD) Tiny Block Ciphering Algorithm …........................................... vi     

64

4.4.1Partial Video Encryption Based on SDD Algorithm ……………...……………....… 4.4.2 Partial Video Decryption Based on SDD Algorithm……………………………........ 4.5 The Encryption Digital Video System Model……………. 4.5.1 Converting Digital Video File into Frames……... 4.5.2 Encryption Y Channel …………………………. 4.5.3 Reconstruct Video File before Broadcasting…… 4.5.4 Decryption Y Channel …………………………. 4.6 Evaluation of the Symmetric Dynamic Dual (SDD) Algorithm.........................................................

65 69 71 72 73 73 73 73

Chapter Five: Simulate Results 5.1 Introduction…………………………………………….…. 5.2 Histogram for Each Channel………………………...……. 5.3 Applied Symmetric Dynamic Dual (SDD) Tiny Block Ciphering Algorithm…………………………. 5.4 Security of Dynamic Dual (SDD) Tiny Block Ciphering Algorithm…………………..…………... 5.5Security of AES Algorithm………………..…………......... 5.6 Cases Study for Digital Video Films……………………...

77 77 82 88 92 93

Chapter Six: Conclusions and Future Works 6.1 Conclusions……………………………………………….. 100 6.2 Suggestions for Future Works……………………………. 102

References…………………………………………………….. 103 Publications…………………………………………………… 115

Appendix

AES Code

vii     

List of Figures Figure No. 1.1 3.1

3.2

3.3

3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 4.1 4.2

Description

Types (I, P and B) of Digital Video Frames. A Rectangular Digital Image of Resolution 16 ×8. Player Image in RGB System, (a) Original Image,(b) Red Channel of Image, (c) Green Channel of Image, (d) Blue Channel of Image. (a) Player Image in YCbCr System, (b) Y Channel of Image, (c) Cb Channel of Image, (d) Cr Channel of Image. Sub-Sampling Patterns for Chrominance Components. Digital Video Sampling.

5 36

38

39

41 42

Progressive and Interlaced Video: (a) Frame, (b) Top Field, (c) Bottom Field. Structural Hierarchy of Digital Video. Group Of Pictures.

43 45 46

P-frame and its relation with other frames B-frame and its relation with other frames Macroblock.

47 48 49

Object-Layer-Based Video Coding in MPEG-4. Broadcasting System.

53 63

Broadcasting System after Adding Encryption and Decryption Parts. viii 

   

Pages No.

64

4.3

4.4

4.5

5.1

5.2

5.3

5.4

5.5

5.6

The Steps of Partial Video Encryption Technique. (a) Original Boy Image in RGB, (b) Boy Image in RGB after Encrypting Red Channel, (c) Boy Image in RGB after Encrypting Green Channel, (d) Boy Image in RGB after Encrypting Blue Channel. (a) Boy Image in RGB after Encrypting Y Channel, (b) Boy Image in RGB after Encrypting Cb Channel, (c) Boy Image in RGB after Encrypting Cr Channel. (a) Original Family Image in RGB, (b) Red Channel of Family Image in RGB,(c) Green Channel of Family Image in RGB, (d) Blue Channel of Family Image in RGB. (a) Red Channel Histogram of Family Image in RGB, (b) Green Channel Histogram of Family Image in RGB, (c) Blue Channel Histogram of Family Image in RGB.

(a) Y Channel of Family Image in YCbCr Color System, (b) Cb Channel of Family Image in YCbCr Color System, (d) Cr Channel of Family Image in YCbCr Color System. (a)Y Channel Histogram of Family Image in YCbCr Color System, (b) Cb Channel Histogram of Family Image in YCbCr Color System, (c) Cr Channel Histogram of Family Image in YCbCr Color System. The Encryption Results after Applying Partial Video Encryption Based on SDD Algorithm for the 1st Frame in Car and Xylophone Video,(a) Original I-Frame of Car Video, (b)Car I-Frame after Encryption,(c) Original IFrame of Xylophone Video,(d) Xylophone I-Frame after Encryption. The Effect of the Partial Video Encryption Based on SDD Algorithm on Car Video Frames is Used as Test Object, (a) Original Car Film after 4 Seconds,(b) Encryption Car Film after 4 Seconds, (c) Original Car ix 

   

72

75

76

78

79

80

80

85

86

Film after 8 Seconds, (d) Encryption Car Film after 8 Seconds.

5.7

5.8

5.9

The Effect of the Partial Video Encryption Based on SDD Algorithm on Xylophone Video Frames is Used as Test Object, (a) Original Xylophone Film after 2 Seconds, (b) Encryption Xylophone Film after 2 Seconds,(c) Original Xylophone Film after 5 Seconds, (d) Encryption Xylophone Film after 5 Seconds, (e) Original Xylophone Film after 8 Seconds, (f) Encryption Xylophone Film after 8 Seconds.

The Effect of the Partial Video Encryption Based on SDD Algorithm on Cartoon Video Frames is Used as Test Object, (a)Original Cartoon Film after 1 Second, (b)Encryption Cartoon Film after 1 Second, (c)Original Cartoon Film after 3 Seconds,(d) Encryption Cartoon Film after 3 Seconds, (e) Original Cartoon Film after 5 Seconds, (f) Encryption Cartoon Film after 5 Seconds ,(g)Original Cartoon Film after 8Seconds,(h) Encryption Cartoon Film after 8 Seconds, (i) Original Cartoon Film after 13 Seconds, (j) Encryption Cartoon Film after 13 Seconds.

The Effect of the Partial Video Encryption Based on SDD Algorithm on Baptism Video Frames is Used as Test Object,(a) Original Baptism Film after 1 Second, (b) Encryption Baptism Film after 1Second, (c)Original Baptism Film after3 Seconds, (d) Encryption Baptism Film after 3 Seconds, (e) Original Baptism Film after 5 Seconds, (f)Encryption Baptism Film after 5 Seconds, (g)Original Baptism Film after 8 Seconds, (h)Encryption Baptism Film after 8 Seconds, (i) Original Baptism Film after 13 Seconds, (j) Encryption Baptism Film after 13 Seconds.

x     

87

94

96

5.10

The Effect of the Partial Video Encryption Based on SDD Algorithm on Football Video Frames is Used as Test Object (a) Original Football Film after 1 Second, (b) Encryption football film after 1Second, (c) Original Football film after 3 Seconds, (d) Encryption Football Film after 3 Seconds, (e) Original Football Film after 5 Seconds,(f) Encryption Football Film after 5 seconds,(g) Original Football Film after 8 Seconds, (h) Encryption Football Film after 8 Seconds,(i) Original Football Film after 13 Seconds, (j) Encryption Football Film after 13 Seconds.

xi     

98

List of Tables Table No. 

Description 

Page No.

Addition in GF(2 ).

20

Addition Inverse in GF(2 ).

21

2.3

Multiplication in GF(2 ) with the Irreducible Polynomial m(x) = (x + x + 1).

25

2.4

Multiplication Inverse in GF(2 ) with the Irreducible Polynomial m(x) = x + x + 1.  

26

2.1  2.2 

 

3.1 4.1  4.2 4.3  4.4  4.5  4.6 

CIF Based Formats and Resolutions. Addition in GF(2 ). 

56 

 

Addition in GF(2 ).

56 

Addition in GF(2 ).

57 

Addition Inverse in GF(2 ) .   

Addition Inverse in GF(2 ).   

Addition Inverse in GF(2 ).

57  57  58 

4.7

Multiplication in GF(2 ) with the Irreducible Polynomial m(x) = x + x + 1.

59 

4.8 

Multiplication in GF(2 ) with the Irreducible Polynomial m(x) = x + x + 1.

59 

4.9 4.10 

Multiplication in GF(2 ) with the Irreducible Polynomial m(x) = x + x + 1. Multiplication Inverse in GF(2 ) with the Irreducible Polynomial m(x) = x + x + 1.     

xii     

42 

60  61 

4.11 

Multiplication Inverse in GF(2 ) with the Irreducible Polynomial m(x) = x + x + 1.

61 

 

4.12

4.13

4.14

5.1 

Multiplication Inverse in GF(2 ) with the Irreducible Polynomial m(x) = x + x + 1. The Encryption and Decryption Time of the Proposed (SDD) Algorithm with Single Round and Dual Round. The Number of Possibilities of Keys that Needed to Decrypt the Ciphertext with 128 bits Size by Using (SDD) Technique. The Encryption and Decryption Times for Symmetric Dynamic Dual (SDD) Key in the First Round.

61 

74 

74 

82

 

5.2

The Encryption and Decryption Times for Symmetric Dynamic Dual (SDD) Key Algorithm in the Second Round.

5.3

The Encryption and Decryption Times for AES Algorithm Using Key Size 128bit.

83 

5.4

The Encryption and Decryption Times for AES Algorithm Using Key size 128bit on I-Frame.

84 

5.5

The Encryption and Decryption Times for Symmetric Dynamic Dual (SDD) Key Algorithm on I-Frame.

xiii     

82 

84 

List of Abbreviations Abbreviation

Meaning

3D

Three Dimensions

AES

Advanced Encryption Standard

AVI

Audio Video Interleave

BMP

Bitmap

BR

Bit Rate

CBC

Cipher-Block Chaining

CFB

Cipher FeedBack

CIF

Common Intermediate Format

CRTs

Color Cathode Ray Tubes

DES

Data Encryption Standard

DCT

Discrete Cosine Transform

DIB

Device-Independent Bitmap

DPCM

Differential Pulse Coding Modulation

DVB

Digital Video Broadcast

DVD

Digital Video Disk

ECB

Electronic CodeBook

EDTV

Enhanced-Definition Television, or ExtendedDefinition Television

xiv     

GF

Galois Field

GIF

Graphics Interchange File

GOPs

Group Of Pictures

HDTV

High Definition Television

HV

Horizontal Vertical

HVS

Human Vision System

IDEA

International Data Encryption Algorithm

ISO

International Organization for Standardization

ISDN

Integrated Services Digital Network

ITU

International Telecommunication Union

ITU-T

International Telecommunication UnionTelecommunication

JPEG

Joint Photographic Experts Group

LCDs

Liquid Crystal Displays

MPEG

Moving Picture Experts Group

NIST

National Institute of Standards and Technology

NTSC

National Television Systems Committee

OFB

Output FeedBack

PAL

Phase Alternating Line

PCX

Pacific Exchange

Pel

Picture Element xv 

   

PNG

Portable Network Graphics

QCIF

quarter CIF

RGB

Red, Green, Blue

RIFF

Resource Interchange File Format

RLE

Run-Length Encoding

RSA

Rivest,Shamir,Adleman

RTSA

Real-Time Streaming Applications

SDD

Symmetric Dynamic Dual

SQCIF

Sub Quarter CIF

SIF

Resource Interchange File Format

TGA

Truevision Graphics Adapter

TIFF

Tagged Image File Format

VfW

Video for Windows

VOPs

Video Object Planes

YCbCr

Luminance and Blue , Red Chrominance

YUV

Luminance Channel Y and Two Color Difference Channels U and V

xvi     

Chapter One-General Introduction    

   

Chapter One-General Introduction

1.1 Introduction  Security or confidentiality of the video film data is regarded as a solution adopted by broadcasting system in order to protect the material submitted as well as the profit from the piracy, these materials are various ranging between football championship, different kinds of sports as well as films and documentary programs and exclusive programs, and what prompts the channels to purpose is the political television rights known in the broadcasting system in our days. The well funded channel is able to pay and obtain any of the previously mentioned material exclusively, that means the purchasing channel has the full right to monopolize broadcasting that material and this alone will naturally lead to the fight between the channels themselves on the one hand and between the other channels and the piracy on the other, this causes the channel to the principle of the encryption broadcasting for self protection and the official participants sharing in channel by obtaining the original ticket as well as achieving material profit out of official participation. Encryption broadcasting in general, is preventing the broadcasting for all except those who have participating ticket which decrypt and operating the channel legally.

1.2 Problem Statement In the digital world nowadays, the security of digital videos become more and more important since the communications of digital products occur more and more frequently. In addition, special and reliable security in transmission of digital videos is needed in many digital applications, such as 1   

Chapter One-General Introduction

pay-TV, confidential video conferencing and broadcasting, etc. Generally speaking, the well developed modern cryptography should be the perfect solution to this task. As it is known, many perfect ciphers have been established and applied widely since 1970s, such as DES, IDEA and RSA . But most conventional ciphers cannot be directly used to encrypt digital video in real-time systems because their encryption speed is not fast enough. In broadcasting encryption video, there are two factors that must be taken into account, first decreasing the time needed for encryption/decryption, the time is the main key factor in real-time systems, any application that complete its work after the deadline is considered useless, so the time should be efficient, the time efficiency means encryption and decryption should not take much time as heavy delay is not acceptable in real time. Real-Time Streaming Applications (RTSA) like broadcasting the time needed for two processes, the encryption at the station, and the decryption period by the receiver device should be very slight for the users to be accepted. Second, the level of security should be high enough so attackers cannot obtain the encryption/decryption key easily. Security is the basic requirement, which means that the cost of breaking the encryption algorithm is no smaller than the ones buying the video’s authorization. In modern applied system which entails large quantities of data which are used for communication, need high efficiency of security, because the snoopers receive these encryption data like beneficiary. The snooper is likely to be one of users at the beginning, but he tries to be one of the snoopers in order to avoid paying charges legally, or he could be a snooper and purchaser at the same time, therefore the security should be of high standard to safeguard the decryption video [1]. 2   

Chapter One-General Introduction

1.3 Video Encryption Video encryption technology was first reported in the 1980s, and became a hot research topic in the second half of the 1990s. Its development can be partitioned into three phases, raw data encryption, compressed data encryption, and partial encryption. Before the 1990s, few multimedia encoding methods were standardized. Most multimedia data, such as image or video, were stored or transmitted in the raw form. Video encryption was based mostly on pixel scrambling or permutation. That is, the image or video is permuted so that the resulting image is unintelligible. For example, space filling curves are used to permute image or video data, which confuse the relation between adjacent image pixels or video pixels[2]. European TV networks adopt the Eurocrypt standard to encrypt TV signals, which permutes each TV field line by line. These methods are of low computing complexity and low cost. However, the permutation operation changes the relation between adjacent pixels, which will make subsequent compression operations not work [3]. In the first half of the 1990s, with the development of digital video technology, some image, or video encoding standards were developed. Generally, digital video data are compressed before being stored or transmitted. Thus, the permutation algorithms for raw data encryption are not suitable for these applications. Alternatively, novel algorithms that encrypt the compressed data directly are preferred. For example, Qiao and Nahrstedt proposed the VEA algorithm that uses DES algorithm to encrypt video data.

3   

Chapter One-General Introduction

Romeo et al proposed the RPK algorithm that combines a stream cipher and a block cipher[4]. These algorithms focus on the system security. However, because they encrypt all the compressed data, the computing cost is high, which makes it difficult for large volume data. Additionally, the file format is changed by the encryption algorithm, which means the encrypted data cannot be played or browsed directly. Thus, these algorithms are more suitable for secure video storing than for real-time transmission. Since the second half of the 1990s, with the development of Internet technology, Digital video applications created more requirements for real-time operation and interaction. By encrypting only parts of the video data, the encrypted data volumes can be greatly reduced, which improves the encryption efficiency. These algorithms encrypt the few parts that are significant in human perception, while leaving the other parts unchanged. Thus, the real time requirement can be met. Additionally, the file format can be kept unchanged, which benefits the transmission process , Lian et al proposed an algorithm that encrypts only parts of the parameters in Advance Video Coding,and Servetti et al. proposed an algorithm that encrypts only the bit allocation parameters in MP3 files [4].

1.4 Digital Video Architecture  A video sequence consists of a sequence of time-indexed frames (generally 24-30 frames per second). Each frame represents a still image of a scene taken at a particular instant of time. Hence a video signal can be considered to be a three-dimensional signal, where two dimensions are used to

4   

Chapter C On ne-General Introductio on

represent r the t video signal s spatiially and aanother dim mension is used to reepresent the t temporral sequencce. A GOP G consissts of threee types of frames nam mely; I, P and B picctures. I pictures p are a intrafraame coded d without any referrence to oother pictuures. P pictures p arre predicatiively coded using a pprevious I or P pictuure. B pictuures are bidirection b nally interp polated fro om both, thhe previouus and following I annd/or P pictures p ass shown in Figure 1.1 1.

o Digital Viideo Framees [7]. Figure 1.1: Types (II, P and B) of

The propertiess of the I, P, P and B fraames can hhelp furtheer improve the encryption e n and decry yption algo orithm perfformance to make it ssuitable for real time t appliccation [5, 6]. 6

5   

Chapter One-General Introduction

1.5 Real Time Digital Video Encryption. The challenges of video data encryption come from two facts. First, the video data is large. Second, video data needs to be processed in real time. Processing vast amount of data in very short time puts great burden on video codec, storage space requirements and channel communications, so the study of image and video encryption becomes more essential and important. One approach is to design encryption schemes for digital video systems in real time based on the structure of data. The digital video encryption schemes must exploit the various components of the digital video data, and

their relative importance. It is to be noted that the naive approaches do not take the structure of digital video data into consideration. Some of the desirable characteristics for designing encryption schemes for real time digital video data are: 1. Data Rate: digital images and video are generally large in size even after compression. Since the encryption/decryption speed of some existing ciphers are not adequate (especially software implementations) for real time streaming using the naive approach. Hence, the size of the data to be encrypted is an important consideration in designing digital video encryption schemes. 2. Compressibility: If encryption is applied before compression, the randomness of cipher text will reduce the amount of compression achieved considerably. Thus, an approach is to encrypt the content after compression; but after compression the entire compressed content needs to be encrypted. Hence a stage within compression needs to be identified, where partial encryption can be performed without affecting the compression much and also

6   

Chapter One-General Introduction

to meet the real-time requirements. Thus, there is a tradeoff needed between compression and encryption. 3. High Redundancy: Image and video data have high redundancy. In the case of image the redundancy is spatial redundancy, whereas in the case of video data the redundancy is both spatial and temporal. The redundancy within the image and video data are so much that encryption may fail to conceal all perceptual information by using standard block ciphers [8].

1.6 Classification of Digital Video Encryption Techniques Various digital video encryption algorithms have been proposed, which can be classified into various types. According to the encryption method, the algorithms can be classified into direct or complete encryption, and partial encryption. Generally, different algorithms encrypt different data volumes and thus get different security and efficiency. In direct encryption, the video data is encrypted with a novel or traditional cipher directly. The decryption process is symmetric to the encryption process [9]. In partial encryption, only some significant parts of the video data are encrypted, while the other parts are left unencrypted. Intuitively, direct encryption often encrypts the largest data volumes, and thus, is of the highest security and lowest efficiency. Partial encryption reduces the encrypted data volumes, and thus, gets higher efficiency and lower security [10, 11]. Until now, various data encryption algorithms have been proposed and widely used, such as AES, RSA, or IDEA [12], most of which are used in text or binary data. But it is difficult to use them directly in multimedia data, for multimedia data are often of high redundancy, of large volumes and require real-time interactions, such as displaying, cutting, copying, bit rate conversion, 7   

Chapter One-General Introduction

etc. Besides the security issue, encrypting images or videos with these ciphers directly is time consuming and not suitable for real-time applications [13].

1.7 Literature Survey Many researchers use digital video encryption as headlines in their work; some of the published works are the following:  1- In 1997, Qiao and Nahrstedt in [14] suggested a new video encryption algorithm called VEA. Video encryption algorithm upon the statistical properties of MPEG video standard and symmetric key algorithm standard to reduce the amount of data that is encrypted. Encryption ratio may vary based on which parameters are encrypted. Encrypting only headers have very less encryption ratio. But encrypting all the bitstreams have 100% encryption ratio. Speed of this methodology again varies based on traditional algorithm in use such as DES or RSA and number of parameters that are encrypted .Many security levels can be obtained. Encrypting only stream headers is not sufficient since this part is easily predictable. But encrypting all the bit streams can provide high security. 

2- In 2002, Eskicioglu A.M., and Delp E.J.[15]have presented an integrated approach to encrypting multiple layers. The proposal is a prepositioned shared secret scheme that enables the reconstruction of different keys by communicating different activating shares for the same prepositioned information.

3- In 2002, Wen J., severa M., Zeng W., Luttrell M., and Jin W.[16] proposed a general selective encryption approach for fixed and variable length codes (FLC and VLC). FLC and VLC codewords corresponding to important 8   

Chapter One-General Introduction

information carrying fields are selected. Then, each codeword in the VLC and FLC (if the FLC code space is not full) table is assigned a fixed length code index, when encrypted the concatenation of some VLC (or FLC) codewords, only the indices are encrypted (using DES). Then the encrypted concatenated indices are mapped back to a different but existing VLC. The encryption process compromises the compression efficiency. Indeed, some short VLC codewords (which are the most probable/frequent) can be replaced by longer ones. This is antagonistic with the entropy coding idea. 4- In 2003, Lookabaugh T. et al. [17] proposed the selective encryption of MPEG-2 video, the one that used in most current digital television applications. They use the fact that the typical high performance MPEG-2 encoded bit streams only uses a small portion of bits in important headers (video sequence, group of pictures, picture, and slice). It can be simple to vague such headers because of a usual practice in encoding of aligning these headers and the multiplex level at which encryption is performed. However, fields in such headers can be quite defenseless to attack, even if obscured by selective encryption, for a variety of reasons: the fields are often static, they can be guessed from external information that is probably available to an attacker, they can be guessed from other information in the bitstream (e.g., picture type can be guessed from picture size, an example of the cryptanalytic technique of traffic analysis), or they can be ignored, albeit with nontrivial.

5- In 2003,  Zeng W. and Lei S. [18] presented a joint encryption and compression framework in which video data are scrambled efficiently in the frequency domain by employing selective bit scrambling, block shuffling and block rotation of the transform coefficients and motion vectors. The new 9   

Chapter One-General Introduction

approach is very simple to implement, yet provides considerable levels of security and different levels of transparency, and has very limited adverse impact on the compression efficiency and no adverse impact on error resiliency. Furthermore, it allows transcodability/scalability and some other content processing functionality without having to access the cryptographic key and to perform decryption and re-encryption. 6- In 2004, Bhargava B., Shi C., and Wang S. Y. [19], proposed four fast MPEG video encryption algorithms. These algorithms use a secret key to randomly change the sign bits of Discrete Cosine Transform (DCT) coefficients and/or the sign bits of motion vectors. The encryption is accomplished by the inverse DCT (IDCT) during the MPEG video decompression processing. These algorithms add a small overhead to MPEG codec. Software implementations are fast enough to meet the real time requirement of MPEG video applications. The experimental results show that these algorithms achieve satisfactory results. They can be used to secure video-on-demand, video conferencing, and video email applications. 7- In 2006, Lian S., Liu Z., Ren Z., and Wang H. [20], presented a selective video encryption scheme based on Advanced Video Coding (AVC) scheme. In the scheme, some sensitive data, such as intra-prediction mode, residue data and motion vector, are encrypted selectively. The intra-prediction mode is encrypted based on Exp-Golomb entropy coding, the DC’s of intramacroblock are encrypted based on context based adaptive variable length coding, and AC’s of intra-macroblocks and MVDs of the inter-macroblocks are encrypted with a stream cipher. 8- In 2007, Choo E., Lee J., Lee H. and Nam G. [21]proposed a lightweight encryption scheme without loss of security and media QoS, called 10   

Chapter One-General Introduction

secure real-time media transmission (SRMT) using two block transpositions and a XOR operation. SRMT is studied with respect to MPEG-4, which is widely used in today's multimedia applications. Experimental results with various MPEG-4 movies show that the SRMT scheme achieves real-time transmission of encrypted media data without loss of security and media QoS. Though SRMT is conducted on uncompressed raw data, SRMT encrypts 3 times faster than the AES encryption of MPEG compressed data. Also, we show that manipulating key frames and a compression method can lessen increasing ratio of encrypted MPEG size, e.g., 70.5% improvement over an existing combination method of block transpositions and XOR operations. 9- In 2007, Socek D., Magliveras S., Culibrk D. , Marques O., Kalva H., and Furht B.[22] proposed a video encryption model relies on the encryptioncompression duality of certain types of permutations acting on video frames. In essence, the proposed encryption process preserves the spatial correlation and, as such, can be applied prior to the compression stage of a spatial-only video encoder. Several algorithmic modes of the proposed model targeted for different application requirements are presented and analyzed in terms of security and performance. Experimental results are generated for a number of standard benchmark sequences showing that the proposed method, in addition to providing confidentiality, preserves or improves the compression ratio. 10- In 2008, Fong S. [23]  proposed an improvement algorithm to the VEA namely the rotation algorithm, the XOR algorithm and one that combines VEA with IDEA (I-VEA). They are able to secure digital video with minimal computational overhead, which do not reduce the video compression ratio, do not rely upon the key generator to generate an effective key and can better

11   

Chapter One-General Introduction

resist the known-plaintext attack. The rotation algorithm is the fastest of the three, but is relatively weak. 11- In 2009, Sun H.M.,and Leu M.C.[24] proposed a real time selective video encryption using context key control. The new context key control encryption in this scheme is modified from ElGamal encryption. Using context key control, the scheme can perform a low exponent operation and secure encryption. This encryption scheme is applied to perform selective encryption on video DCT coefficients. In performance and security analysis, the scheme is a secure and efficient video encryption scheme, and can be well applied to the video protection.

12- In 2011, Varlakshmia L.M., Sudhab G.F., and Jaikishan G.[25] proposed a new encryption scheme. The proposed scheme performs encryption in three domains: Intra-Prediction mode (IPM), residual data and motion vector difference values. For enhancement layers, temporal scalability and spatial/SNR scalability are distinguished.

1.8 Aim of the Thesis This thesis aims at securing the broadcasting system channel in realtime with high protection by means of designing and implementing partial digital video encryption and decryption system using a new proposed encryption and decryption algorithm called (symmetric Dynamic Dual Key(SDD).

12   

Chapter One-General Introduction

1.9 Layout of the Thesis Structurally this thesis is divided into six chapters. Chapter two is concerned with mathematical concepts of finite fields that used in the proposed encryption and decryption algorithm (SDD). It also reviews cryptography and cryptanalysis concepts. Chapter three provides the fundamentals and the structure of digital video which will be useful for understanding the practical chapter; finally, this chapter shows the types of video format. Chapter four is devoted to explain the proposed digital video partial encryption system steps and presents the evaluation of the development stages of SDD encryption algorithm. The chapter starts with the tables that represent the addition, multiplication, addition  inverse and multiplication inverse in GF (2 ) , GF (2 ) , and GF (2 ). Chapter five is dedicated to implement the partial digital video encryption system and to present the results of encryption. Chapter six lists some conclusions obtained from the analysis of test results. Also, some proposals are presented for future works.

13   

Chapter Two-Introduction to Finite Fields and Cryptography    

   

Chapter Two-Introduction to Finite Fields and Cryptography    

2.1 Introduction In order to understand the encryption algorithm and methods presented in this thesis, it is needed to review some mathematical concepts. The chapter provides a brief, but sufficient, coverage of the abstract algebra mathematical concepts, and polynomial representation for finite field elements is introduced as it is used throughout this thesis. Moreover, Finite Field Operations on

(2 ), addition, multiplication, and inverse multiplication are discussed

with an examples. Finally the chapter reviews cryptography and cryptanalysis concepts, the DES and AES algorithms are presented as examples of block cipher with cryptanalysis for each one. Finite fields are, not surprisingly, fields with only finitely many elements. These are also called Galois fields, in honor of Evariste Galois (1811-1832) who, in his study of roots of polynomials, discovered many of their fundamental properties. For a long time, the theory of finite fields was considered a branch of mathematics of purely theoretical interest. Yet, following the dawn of computers, practical applications have been found in e.g. error-correcting codes and cryptography. Finite fields are, by far, the most widely used algebraic structure in the construction of cryptographic schemes. Examples include: the Advanced Encryption Standard (AES) [26], the Diffie-Hellman key exchange protocol [27].

2.2 Abstract Algebra Mathematical Concepts For the following mathematical concepts see [28, 29]. Definition 2.1. Let S be a set. Then, the mapping from × is called a binary operation on . In particular, a binary operation is a rule that assigns 14   

Chapter Two-Introduction to Finite Fields and Cryptography    

ordered pairs ( , ), with , ∈ , to an element of . Notice that under this definition the image of the mapping is require to be also in . This is known as the closure property .

2.2.1 Groups Definition 2.2. A group is a set together with a binary operation # on the set, such that the following properties are satisfied:

(i) The group operation is associative. That is # ( # ) = ( # )# ,



, , ∈ .

(ii) There is an element ∈ , called the identity element, such that # = # = for all ∈ . (iii) For all ∈ , there is an element

# = . The element

∈ , such that #

=

is called the inverse of .

If the group also satisfies # = #



, ∈ , then the group is

said to be abelian . Definition 2.3. A group if its order, denoted |

is finite if the number of elements in it is finite, i.e., |, is finite.

Definition 2.4. A group

is cyclic if there is an element ∈

for each ∈ , there is an integer such that called a generator of The order of = , where



. Such an element is

and we write =< >. is defined to be the least positive integer

is the identity element in

15   

=

such that

.

such that

Chapter Two-Introduction to Finite Fields and Cryptography    

2.2.2 Rings A ring, ( , +,∗), is a set

Definition 2.5.

together with two binary

, arbitrarily denoted + (addition) and ∗ (multiplication),

operations on

which satisfy the following properties: (i)

( ,+) is an abelian(commutative) group with identity element denoted by 0.

(ii)

The operation ∗ is associative, that is, ∗ ( ∗ ) = ( ∗ ) ∗ ,

(iii)



, , ∈ .

There is a multiplicative identity element denoted by 1, with 0 ≠ 1, such that for all ∈ , ∗ 1 = 1 ∗ = .

(iv)

The operation ∗ is distributive over the + operation. In other words, ∗ ( + ) = ( ∗ ) + ( ∗ ) and ( + ) ∗ = ( ∗ ) + ( ∗ ) for all , , ∈ .

If the operation ∗ is also commutative, i.e., ∗ = ∗ then the ring is said to be commutative.

2.2.3 Fields Definition 2.6. A field

is a commutative ring in which every non-zero

element (i.e., all elements except for the additive identity element) have multiplicative inverses. A subset respect to operations in

of a field

is called a subfield of . In this case

be an extension field of .

16   

which itself is a field with is said to

Chapter Two-Introduction to Finite Fields and Cryptography    

Definition 2.6 implies that a field

is a set on which two binary operations

are defined, called addition and multiplication, and which contains two elements, 0 and 1, which satisfy 0 ≠1. In particular, ( , +, 0) is an abelian group with additive identity 0 and (



,∗, 1) is an abelian group under the

multiplication operation with 1 as its multiplicative identity. The two operations of addition and multiplication are related to each other via the distributive law, i.e., ∗ ( + ) = ( ∗ ) + ( ∗ ), and ( + ) ∗ = ∗ ( + ) = ( ∗ ) + ( ∗ ) follows automatically from the fact that (



,∗, 1) is an abelian group under

multiplication.

2.2.4 Polynomial Rings Definition 2.7. If indeterminate ( )= and in

n

n

+

is a commutative ring, then a polynomial in the

over n−1

is an expression of the form: n−1

+· · · +

2

2

+

1

1

+

0

where each

n



≥ 0. As in classical algebra, the element a is called the coefficient of ( ) and the largest

for which

≠ 0 is called the degree of

n

denoted by deg( ( )). The coefficient

( ),

is called the leading coefficient of

( ). Let

[ ] be a ring of polynomials over the ring , and

( ) be an irreducible

polynomial . The set of all polynomials of the form

( ) ∗ [ ], that is the

( ) with each member of [ ]. Clearly

( ) ∗ [ ] is an ideal

product of of

( ) which is a maximal polynomial. The quotient ring

[ ] is a field, If

=

, where

is a prime number and

[ ] / ( ) ∗ ( ) is an

irreducible polynomial of degree , then the quotient ring [ ] / ( ) ∗ [ ] is a field called Galois Field and denoted by 17   

(

).

Chapter Two-Introduction to Finite Fields and Cryptography    

Two polynomials ( ) = ∑ to be equal if and only if



=

i and ( ) = ∑

for 0 ≤



b

over

are said

.

Example 2.1 (i)The sum of two polynomials is realized in the familiar ways as : ( ) + ( ) =

(



+

(ii) The product of two polynomials: ( ) = ∑ ∑



)

and

( )=

over , is defined as follows:

( ) = ( ). ( ) = ∑



where =

and addition and multiplication of coefficients is performed in . Together with the operations of addition and multiplication as defined above, it is easily seen that the set of polynomials over forms a ring.

Definition 2.8. Let

be a commutative ring. Then the set of polynomials over

with addition and multiplication of polynomials defined as in Example 2.1 is called a polynomial ring and it is denote it by [ ].  

 

2.3 Finite Field Operations on The finite field with

(

)

elements is denoted

(

), and is also called

the Galois Field, a particular case of Finite Field that this thesis is interested 18   

Chapter Two-Introduction to Finite Fields and Cryptography    

when prime (p) = 2, it is conventional to express elements of

(2 ) as 

binary numbers. Arithmetic in a finite field is different from standard integer arithmetic. There are a limited number of elements in the finite field; all operations performed in the finite field result in an element within that field. Elements of GF(p ) may be represented as polynomials of degree strictly less than n over GF(p). A polynomial f(x) in GF (2 ) is representing as: (x ) = a Can (a

a

be

x

uniquely

+a

x



+ ⋯ + a x + a =

represented

by

its

n

ax

binary

coefficients

. . . a ). Thus, every polynomial in GF (2 ) can be represented by

an n-bit number [30]. In this thesis the concerned are with the finite field GF (2 ), particularly in GF (2 ) , GF(2 ), GF (2 ) and GF (2 ).

2.3.1 Addition The addition of two finite field elements is achieved by adding the coefficients for Corresponding powers in their polynomial representations, this addition being performed in

(2), that is, modulo 2, so that 1 + 1 = 0.

Consequently, addition and subtraction are both equivalent to an exclusive-or operation on the n-bits that represent the field elements of

(2 ).

The following examples show the addition of two polynomials in a finite field

(2 ), and their equivalent representations in binary and

hexadecimal system [30]. Example 2.2 The addition of two polynomials in a finite field in GF (2 ):

19   

Chapter Two-Introduction to Finite Fields and Cryptography    

Polynomial: (x + x + x + 1) + (x + x + x + x) = x + x + x + 1. Binary: {01010011} + {11001010} = {10011001}. Hexadecimal: {53} + {CA} = {99}. Example 2.3 The addition of two polynomials in a finite field GF (2 )   Polynomial: (x + x + 1) + (x + x + 1) = x + x . Binary: {1101} + {0111} = {1010}. Hexadecimal: {D} + {7} = {A}. Example 2.4 The addition of two polynomials in a finite field GF (2 ) Polynomial: (x + x + 1) + (x + 1) = x . Binary: {111} + {101} = {010}. Hexadecimal: {7} + {5} = {2}. Table 2.1 represents the addition in GF (2 )   Table 2.1: Addition in

(

). [31]

 

Table 2.2, represents the addition inverse in GF (2 ) .

20   

Chapter Two-Introduction to Finite Fields and Cryptography    

Table 2.2: Addition Inverse in

(

). [31]

             

2.3.2 Multiplication Finite field multiplication is more difficult than addition and is achieved by multiplying the two polynomials for the two elements concerned and collecting like powers of x in the result. If multiplication results in a polynomial of degree greater than n-1, then the polynomial is reduced modulo some irreducible polynomial m(x) of degree n. That is, it is divided by m(x) and kept the remainder. The definition of irreducible polynomial is a polynomial f(x) over a field F is called irreducible if and only if f(x) cannot be expressed as a product of two polynomials, both over F, and both of degree lower than that of f(x) (no of which in of degree zero)[31].   Since each polynomial for 3 bits block can have powers of x up to 3, the multiplication result can have powers of x up to 6 and will no longer fit within a 3bits form, for 4, 5, and 6 bits block will be the same and powers of x will be 8, 10, 12, respectively.

21   

Chapter Two-Introduction to Finite Fields and Cryptography    

This situation is handled by replacing the result with the remainder polynomial after division by a special order irreducible polynomial; irreducible polynomial of degree 3 there are only two such polynomials: (x + x + 1 ) and ( x + x + 1), of degree 4, there are three: (x + x + 1), ( x + x + x + x + 1) and (x + x + 1), of degree 5 there are only six such polynomials:(x + x + 1 ) ,( x + x + 1),(x + x + x + x + 1), (x + x + x + x + 1), (x + x + x + x + 1)and (x + x + x + x + 1), and of degree 6, there are nine: (x + x + 1), ( x + x + 1) , (x + x + x + x + 1), (x + x + x + x + 1), (x + x + 1) , (x + x + x + x + 1), (x + x + x + x + 1), (x + x + x + x + 1), and (x + x + x + x + 1) [32]. The following examples show the multiplication of two polynomials in a finite field

(2 ), and their equivalent representations in binary and

hexadecimal systems.  

Example 2.4: The multiplication of two polynomials in a finite field in                                        (2 )   Consider

the two polynomials:  ( ) =

+

+

+ + 1

and ( ) = + + 1 in finite field (2 ),with the irreducible polynomial ( ) = + + + + 1 then: ( )

+ + =

+

∗ ( ) =

+

+

+

+

+ +

+ 22 

 

+

+

+

+

+

+ 1

+ +

+ + 1 +

+

Chapter Two-Introduction to Finite Fields and Cryptography    

The multiplication operation   results in a polynomial of degree greater ( − 1) = (8 − 1) = 7 , then the polynomial is reduced modulo

than

irreducible polynomial of

( ) of degree ( = 8) ,that is we divide by

( ) and keep the remainder , for a polynomial ( ) .             

Therefore, ( ) ( )

( ) =

+

+ 1.

Example 2.5: The multiplication of two polynomials in a finite field in

(2 ).

Consider the two polynomials ( ) = ( + 1) in finite field

+

+

+ 1) and ( ) = (

(2 ), with the irreducible polynomial

+ 1 then:

( )  ( ) =

+

+ +

+ +

+ =

+ 1

+ + 1 23 

 

+

( ) =

+

Chapter Two-Introduction to Finite Fields and Cryptography    

The multiplication operation results in a polynomial of degree greater than 3, then the polynomial is divided by m(x) and kept the remainder as result, therefore ( ) ∗ ( )

( ) = 2 + 1.

Example 2.6: The multiplication of two polynomials in a finite field in

(2 ).

Consider the two polynomials ( ) = ( in finite field

+ + 1) and ( ) = (

(2 ), with the irreducible polynomial

then: ( )  ( ) = 

+

+

( ) =

+

+ 1) +1

+

+ + 1

=

+

+

+ 1

The multiplication operation results in a polynomial of degree greater 2, then the polynomial is divided by m(x) and kept the remainder as result. ( ) ∗ ( )

( ) = 2 + .

 

24   

Chapter Two-Introduction to Finite Fields and Cryptography    

To construct the multiplication finite field GF(2 ) table requires choosing an irreducible polynomial of degree n. The number of rows and columns in the table represent the number of elements in the GF(2 ) that stand for as polynomial. The table is constructed by multiplying each row number with each column, the result is stored in the location represented by the row and the column number which are multiply by each other. But if the multiplication operation result in a polynomial of degree is greater than n-1, then the polynomial is divided by choosing irreducible polynomial of m(x) and kept the remainder as the result as it is shown in the example 2.6. The following table 2.3 represents multiplication in finite field GF (2 ) .

Table 2.3: Multiplication in + ) [31].

(

) with the Irreducible Polynomial m(x) = (



+

 

 

2.3.2.1 Finding the Multiplicative Inverse Each element of the finite field set other than 0 has a multiplicative inverse. Just as the Euclidean algorithm can be adapted to find the greatest common divisor (gcd) of two polynomials, the extended Euclidean algorithm can be adapted to find the multiplicative inverse of a polynomial. Specifically, the algorithm will find the multiplicative inverse of b(x) modulo m(x) if the 25   

Chapter Two-Introduction to Finite Fields and Cryptography    

degree of b(x) is less than the degree of m(x) and gcd[m(x), b(x)] = 1. If m(x) is an irreducible polynomial, then it has no factor other than itself or 1, so that gcd[m(x), b(x)] = 1.The multiplicative inverse table of GF(2 ) could be found directly from multiplication table of GF(2 ) [31]. The following table 2.4 represents multiplication inverse in finite field GF (2 ) with irreducible polynomials m(x) = x + x + 1. Table 2.4: Multiplication Inverse in m(x) = + + [31].

(

) with the Irreducible Polynomial

          2.4 Cryptography and Cryptanalysis Cryptography is the subset of science concerned in encoding data, also called encryption, so that it can only be decoded, also called as decryption, by specific individuals. A system for encrypting and decrypting data is a cryptosystem. Encryption usually involves an algorithm for combining the original data (“plaintext”) with one or more “keys” numbers or strings of characters known only to the sender and/or recipient. The resulting output of encryption is known as “ciphertext”. There are two main classes of cryptosystems, Asymmetric key algorithm and symmetric key algorithm [33], this thesis is 26   

Chapter Two-Introduction to Finite Fields and Cryptography    

concentrates on symmetric key encryption.

2.4.1 Symmetric Key Encryption Symmetric key encryption, the sender and receiver use the same key for encryption and decryption, symmetric key encryption is also called secret key, because both sender and receiver have to keep the key secret and properly protected. Basically, the security level of the symmetric keys encryption method totally depend on how well the users keep the keys protected. If the key is known by an intruder, then all data encrypted with that key can be decrypted, this is what makes it more complicated, how symmetric keys are practically shared and updated when necessary. Symmetric key methods can be classified into two groups, namely block and stream chipers[34]. 1. Block Ciphers: A block cipher operates on fixed-length of bits, termed blocks, with an unvarying transformation. The fixed length can be either 64bit, 128-bit or 256-bit. For example a block cipher might take a 128-bit block of plaintext as input and produce a 128-bit block of ciphertext as output. The exact transformation is dependent on the secret key. Similarly during decryption, the decryption algorithm takes a 128-bit block of ciphertext together with the secret key, and yields the original 128-bit block of plaintext. To encrypt messages longer than the block size, the entire message is divided into blocks and are encrypted under a mode of operation. The various modes of operation supported by block cipher based encryption systems are electronic codebook (ECB), cipher-block chaining (CBC), output feedback (OFB) and cipher feedback (CFB). DES and Rijndael are examples of algorithms based on this idea [35, 36].  27   

Chapter Two-Introduction to Finite Fields and Cryptography    

2.Stream Cipher: A stream cipher is an important method of encryption in which the plaintext is encrypted bit-by-bit or symbol-by-symbol to produce the corresponding ciphertext. A stream cipher can be constructed by generating a pseudo-random key stream using a block cipher output to exclusive-or (XOR) with the plaintext to produce ciphertext at the transmitter. At the receiver, the plaintext is recovered by generating the identical key stream which is then XORed with the ciphertext. Stream ciphers can be used for high-speed networks at the physical layer in a communication system [37]. A stream cipher eliminates the need to pad a message to be an integral number of blocks. It can also operate in real time. Thus, if a character stream is being transmitted, each character can be encrypted and transmitted immediately using a character-oriented stream cipher. One desirable property of a stream cipher is that the ciphertext be of the same length as the plaintext. Thus, if 8bit characters are being transmitted, each character should be encrypted to produce a cipher text output of 8 bits [31].

2.4.2 Examples of Block Ciphers It is astonishing how many different designs of block ciphers have been proposed in the academic literature. Few of them have a real impact in the practical life, while most of them suggest interesting questions and open problems about their security. In the next parts, we describe two block ciphers which are probably the most frequently encountered ones in practice, namely DES, and AES; moreover , the mathematical idea of the proposed algorithm in this thesis is inferred from or used in the AES algorithm.

28   

Chapter Two-Introduction to Finite Fields and Cryptography    

2.4.2.1 Data Encryption Standard (DES) The most widely used encryption scheme is based on the DES adopted in 1977 by the National Bureau of Standards. For DES, data are encrypted in  64-bit blocks using a 56-bit key. The algorithm transforms 64-bit input in a series of steps into a 64-bit output. The same steps, with the same key, are used to reverse the encryption [31]. DES uses 56-bit key, and has 16-round feistel cipher. Similar to any symmetric scheme, the algorithm is assumed to be known to everybody, but the key is only shared by sender and receiver. The decryption uses the same key to convert the ciphertext back to the plaintext. In each of 16 rounds, the fundamental operations of permutation and substitution are mixed so that every bit of the ciphertext can depend on every bit of the data plus every bit of the key [38].

2.4.2.2 Advanced Encryption Standard (AES) Due to the improvement of sciences and technology, DES is no longer appropriate for securing electronic communications. The NIST decided to launch in 1997 a new standardization process, known as Advanced Encryption Standard, it is also known as Rijndael[26,31, 39].

AES processes 128-bit data blocks under a 128-, 192- or 256-bit key. Its design consists in writing the 128-bit plaintext as a 4×4 square matrix of bytes (this principle was first proposed in Square). The encryption process is made of 10, 12 or 14 rounds, for keys of 128-, 192- and 256-bit, respectively. The fundamental of AES is based on operations over the finite field. It begins with the addition (through a XOR operation) of a round subkey to the input data. Then, a fixed number of rounds of a substitution-permutation 29   

Chapter Two-Introduction to Finite Fields and Cryptography    

network (SPN) is applied. Each round consists of four operations: First, a bijection, SubBytes, is applied to the matrix, consisting basically of 16 byte-wise substitutions defined by the same substitution table. SubBytes is a bijective mapping offering optimal characteristics regarding non-linearity. It consists in the inversion operation in GF(2 ) where elements of the field are polynomials of degree at most 7 on GF(2) modulo the irreducible polynomial

+

+

+

+ 1; it is followed by an affine

transformation over GF(2 ). Second, a circular shift called ShiftRows of all rows of the matrix is applied:Row number, : 1 ≤ ≤ 4 is rotated to the right by

positions. Third, a linear transformation, defined by a 4 ×4 matrix

over GF(2 ), called MixColumns, is applied on each column (the last round omitting the MixColumns and ShiftRows steps); more precisely, this operation considers a column as the coefficients of a polynomial over GF(2 )/( polynomial

+

+

0x03.

+ + 1) and the columns are multiplied by the + 0x01.

+ 0x01. + 0x02 modulo

+ 1. Finally

AddRoundKey combines the 128-bit State with a 128-bit round key by adding corresponding bits mod 2. This transformation corresponds to a XORoperation of the State and the round key. The decryption process consists simply in applying the respective inverse operations in the reverse order. The final round excludes the MixColumns operation, while the key-schedule algorithm description may be found in [40]. The AES code is found in appendix implemented in thesis by using visual basic language.

30   

Chapter Two-Introduction to Finite Fields and Cryptography    

2.4.3 Cryptanalysis Cryptanalysis is the science concerned in breaking cryptosystems. Cryptanalysis generally involves the following main methods: • A cryptanalyst can inspect a number of particular chipertexts for certain patterns and correlations. This method of attempting to break a cryptosystem is called a chipertext-only attack. • The cryptanalyst may have the plaintexts besides the chipertexts. In this case, it may be possible to investigate the relation between the plaintexts and the corresponding chipertexts. This type of attack is called a known-plaintext attack. • In a chosen-plaintext attack, the cryptanalyst has access to the cryptosystem and is able to get the chipertexts for the plaintexts he/she provides. • As a last method, one can exhaustively try a set of keys until a decryption decided to be valid is achieved, which is impractical for large amounts of data or large key spaces[35] .

2.4.3.1 Cryptanalysis of DES More than any other block cipher, and since it was one of the first commercially developed block cipher with open specifications, DES has motivated a large amount of cryptanalytical efforts: differential cryptanalysis, linear cryptanalysis, and Davies' attack are generic attacks invented for the purpose of breaking DES. The main weakness of DES is its short key length which allows nowadays to break it practically using an exhaustive key search; for instance, a dedicated machine has been built in 1998 by the Electronic Frontier Foundation to demonstrate the vulnerability of such a small key length. More 31   

Chapter Two-Introduction to Finite Fields and Cryptography    

information is given in Hellman's time-memory tradeoff [41] can break DES using about 2

cells of memory and 2

precomputation of 2

operations after a single

operations.

Biham and Shamir's differential cryptanalysis [42,43] breaks DES faster than an exhaustive search if 2

chosen plaintexts are available. Another

attack breaking DES faster than exhaustive search is an improvement of Davies' attack [44], by Biham and Biryukov [45, 46]; this known-plaintext attack requires 2

known plaintext-ciphertext pairs.

In 1993, Matsui demonstrated [47, 48] that linear cryptanalysis can break DES as well, provided 2

known plaintext-ciphertext pairs are

available. Based on the same principles, Shimoyama and Kaneko[49] replaced linear approximations by probabilistic quadratic relations to slightly reduce the data complexity. Matsui's attack was transformed later by Knudsen and Matthiassen [50] in a chosen-plaintext attack, hence slightly reducing the required amount of data as well.

2.4.3.2 Cryptanalysis of AES There is no (undisputed) attack against the full version of AES breaking it faster than an exhaustive key search. The designers of AES claim [40] that no 4-round differential characteristic hold with probability greater than 2 than 2

, and no 4-round linear characteristic exist with a bias greater , as an analysis of the propagation of activity patterns leads to the

conclusion that any linear or differential characteristic activate at least 25 Sboxes. Note however that such numbers have to be taken with a grain of salt, since there must exist at least a differential or a linear hull which holds with a probability of 2

or a bias equal to 2 32 

 

, respectively; this

Chapter Two-Introduction to Finite Fields and Cryptography    

demonstrates that the cumulative effect of characteristics is huge in AES. However, more recently, Keliher et al. [51-53] obtained (with help of about 200'000 hours of computations) an upper bound on the maximum average linear hull probability (and on the maximum expected differential probability) of 2

for 9 rounds or more. Using more theoretical arguments, Park et al. and of 2

obtained [54] an upper bound of 2

on the maximum

differential probability, and on the maximum linear hull probability for 4 rounds of AES, respectively. Biham and Keller [55] have proposed an impossible differential cryptanalysis on 5 rounds which was later extended to 6 rounds in [56] and to 7 rounds, with help of a weakness of the key-schedule algorithm, by Phan [57].Several types of integral attacks [58, 59, 60] have been applied with success against reduced-round versions of AES, the best having been proposed by Gilbert and Minier [59]. Furthermore, as AES has a simple algebraic structure, several papers have demonstrated puzzling properties, which may eventually be exploited in the future in an attack [61-66].

33   

 

Chapter Three-Introduction to Digital Video Structure   

 

Chapter Three-Introduction to Digital Video Structure   

3.1 Introduction This chapter introduces the fundamentals of digital video which include digital images, color spaces, sampling and resolution, frames and fields, then, the structure of digital video is presented which will be useful for understanding the next practical chapter. Finally, this chapter shows the types of video format. But, the problem that leads to design the system and the proposed encryption / decryption algorithm are described at the beginning. The development of video processing techniques is closely coupled to the video technology; the video signal can be digitalized into pixels and stored in a memory, which allows easy and flexible fetch and operation on the pixels to achieve more advanced video processing. The digital video signal contains more dimensions of data than other types of signal such as audio. To enable real-time processing, it requires much more processing power to cope with the ever increasing demand for better picture quality, such as higher resolution and frame rate. The analog video signal is a one-dimensional electrical signal of time. It is obtained by a scanning process which includes sampling the video intensity pattern in the vertical and temporal coordinates [67]. Digital video is obtained by sampling and quantizing the continuous analog video signal into a discrete signal. Compared to analog video, digital video has many advantages. The digital video signal is more robust to noise and is easier to use for encryption, editing and conversion [67]. The digital video frames are stored in a memory, which provides access to neighboring pixels or frames. For video system design, it also allows first time right design of complex processing. The video processing algorithms can be mapped to a 34   

Chapter Three-Introduction to Digital Video Structure   

programmable platform and the design time is greatly reduced. These advantages allow a number of new services and applications to be introduced. For example, the TV broadcasting industry has introduced new services like interactivity, search and retrieval, video-on-demand, and high definition television (HDTV). With the rapid development of information technology, the security of digital video has more and more important. But the different properties between traditional text and video data make the traditional text encryption scheme fail to encrypt video data efficiently, so study Digital video structure and format are very necessary for designing an efficient encryption technique[68].

3.2 Digital Video Fundamentals and Representation Digital video consists of a stream of images captured at regular time intervals. The images are represented as digitized samples containing visual (color and intensity) information at each spatial and temporal location [68].

3.2.1 Digital Images A digital image is a discrete two-dimensional function, f(x, y), which has been quantized over its domain and range. Without loss of generality, it will be assumed that the image is rectangular, consisting of Y rows and X columns. The resolution of such an image is written as

X × Y. By

convention, f(0,0), is taken to be the top left corner of the image, and f(X − 1, Y − 1) the bottom right corner. This is summarized in Figure 3.1.

35   

Chapter Three-Introduction to Digital Video Structure   

Figure 3.1: A Rectangular Digital Image of Resolution 16 ×8.

Each distinct coordinate in an image is called a pixel, which is short for picture element. The nature of the output of f(x, y) for each pixel is dependent on the type of image. Most images are the result of measuring a specific physical phenomenon, such as light, heat, distance, or energy. The measurement could take any numerical form. A grayscale image measures light intensity only. Each pixel is a scalar proportional to the brightness. The minimum brightness is called black, while the maximum brightness is called white. A color image measures the intensity and chrominance of light. Each color pixel is a vector of color components. Common color spaces are RGB (red, green and blue), YUV, and YCbCr[69].

3.2.1.1 Color Spaces A color is a visual sensation produced by the light in the visible region of the spectrum incident on the retina. Since the human visual system has three types of color photoreceptor cone ells, three components are necessary and sufficient to describe a color. Color spaces (also called color models or 36   

Chapter Three-Introduction to Digital Video Structure   

color systems) provide a standard method of defining and representing colors. There are many existing color spaces and most of them represent each color as a point in a 3D coordinate system. Visual information at each sample point may be represented by the values of color components. Each value is stored in an ‘n’ -bit number. For example; an 8-bit number can store 256 levels to represent each color component. Each color space is optimized for a well-defined application area. The three most popular color models are RGB (used in computer graphics), YUV and YCrCb (used in video systems). All of the color spaces can be derived from the RGB information supplied by devices such as cameras and scanners [70].

3.2.1.1.1 RGB In the RGB color space, a color image sample is represented with three numbers that indicate the relative proportions of Red, Green and Blue (the three additive primary colors of light). Any color can be created by combining red, green and blue in varying proportions. Figure 3.2 shows the red, green and blue components of a color image: the red component consists of all the red samples, the green component contains all the green samples and the blue component contains the blue samples, the three channels hold equal information. The RGB color space is well-suited to capture and display color images. Capturing an RGB image involves filtering out the red, green and blue components of the scene and capturing each with a separate sensor array. Color Cathode Ray Tubes (CRTs) and Liquid Crystal Displays (LCDs) display an RGB image by separately illuminating the red, green and blue components of each pixel according to the intensity of each component. From 37   

Chapter Three-Introduction to Digital Video Structure   

a normal viewing distance, the separate components merge to give the appearance of ‘true’ color. Processing an image in the RGB color space, with a set of RGB values for each pixel is not the most efficient method [71].

a

b

c

d

Figure 3.2: Player Image in RGB System, (a) Original Image, (b) Red Channel of Image, (c) Green Channel of Image, (d) Blue Channel of Image.

3.2.1.1.2 YUV The YUV color space consists of luminance channel Y (luma) and two color difference channels U and V, which are also sometimes noted together as C (chroma). The U channel is comprised of the difference of blue color and luma channel. The V channel is similarly the difference of red color and luma channel. The YUV color space is used in composite color video standards, and for example PAL (Phase Alternation Line) uses this color space. The original black and white broadcasting system only used luma information. When color 38   

Chapter Three-Introduction to Digital Video Structure   

information was added to the system, the information had to be added in a way that the black and white devices still could display the black and white image from the color signal. A color television simply decodes the extra information of the signal and produces a color image [72].

3.2.1.1.3 YCbCr The YCbCr belongs to the same family of color spaces as the YUV color space. YCbCr is a digital color system as YUV is analogue. Otherwise YCbCr is similar to YUV; it consists of a luma channel (Y) and two chrominance channels. Cb represents the difference between the blue component and a reference value. Cr represents the difference between the red component and a reference value. The Y component on its own is a grayscale representation of the color image. The YCbCr color space is similar to the one used in television sets that allows color images to be compatible with black and white sets. In the RGB color space the three colors are equally important as it is shown in Figure 3.2 and so are usually all stored at the same resolution but it is possible to represent a color image more efficiently by separating the luminance from the color information and representing luma with a higher resolution than colors as it is shown in Figure 3.3. It is clear that Y channel holds more information than two other channels.

a

b 39 

 

Chapter Three-Introduction to Digital Video Structure   

c

d

Figure 3.3:(a) Player Image in YCbCr System, (b) Y Channel of Image, (c) Cb Channel of Image, (d) Cr Channel of Image.

An RGB image may be converted to YCbCr after capture in order to reduce storage and/or transmission requirements. Before displaying the image, it is usually necessary to convert back to RGB color space. The equations for converting an RGB image to YCbCr color space and vice versa are given in Equation 3.1 and Equation 3.2 respectively [73,74].



16 + 128 …………………(3.1) 128

0.257 0.504 0.098 = −0.148 − 0.291 0.439 0.439 − 0.368 − 0.071

1.164 0.000 1.596 = 1.164 − 0.392 − 0.813 1.164 2.017 0.000

− 16 − 128 …………(3.2) − 128

The human visual system has less sensitivity to color information than luminance (light intensity) information. Therefore, with the separation of luminance information from the color information, it is possible to represent color information with a lower resolution than the luminance information, Figure 3.4 illustrates the concept.

40   

Chapter Three-Introduction to Digital Video Structure   

Figure 3.4: Sub-Sampling Patterns for Chrominance Components[75].

In 4:4:4 format, each pixel position has both luminance and chrominance (“luma” and “chroma”) samples. In 4:2:2 format, chroma components are sub-sampled (every other pixel) in horizontal direction. In 4:2:0 format, chroma samples are sub-sampled in both vertical and horizontal directions[75]. This is the most popular format used in entertainment quality applications such as DVD video because the human eye does not easily recognize missing color information [76].

3.2.2 Sampling and Resolution Figure 3.5 shows the sampling process of digital video. The number of horizontal and vertical samples (which can also be referred to as picture elements or in short ‘pixels’) in the image determines the spatial resolution of the image. The frequency at which each image is captured (temporal sampling) determines the motion smoothness of the video.

41   

Chapter Three-Introduction to Digital Video Structure   

Figure 3.5: Digital Video Sampling [82].

Typical temporal sampling frequencies (frame rate) are 25 Hz and 30 Hz. The frame rate determines the motion smoothness of the video, where motion appears smoother at higher frame rates [75]. In digital video processing, different spatial resolutions are used depending on the target application. Some of the most widely used formats based on CIF (Common Intermediate Format) are shown in table 3.1.

Table 3.1: CIF Based Formats and Resolutions [71, 75].

42   

Chapter C Th hree-Introdu uction to Diigital Video Structure  

3.2.3 3 Fra ames an nd Fields s A video signaal can be sampled s inn either fraames (proggressive) or fields (interlaced ( d). In progressive vid deo, a com mplete fram me is samppled at eacch time instant. i In interlaced d video onlly a half o f the fram me is capturred (either odd or even e rows of samplees) at a parrticular tim me instant w which are called fieldds. The field f which h has the first f row (and ( subsequent odd rows) of samples iss called mples are called the bottom the t top fielld while th he field hav ving even rrows of sam field. f Figu ure 3.6 illusstrates the concept off frames annd fields [775].

a

b

c

Figure 3.6: Progressive and Inteerlaced Vid deo: (a) Fram me, (b) Top Field, (c) Botto om Field.

3.3 3 Structural Hierarchy H y of Digital Vide eo A viideo sequeence is sim mply a seriees of pictuures taken at closely spaced intervals i in n time. Except for th he special ccase of a sscene channge, these ppictures tend t to be quite similar from on ne to the nnext. Each of these pictures is ccalled a frame. f Intu uitively, a compressio c on system ought to bbe able to ttake advanntage of this t similaarity, that th he compreession techn hniques (coompressionn models) uused by 43  

Chapter Three-Introduction to Digital Video Structure   

digital video take advantage of this similarity or predictability from one picture to the next in a sequence. Compression techniques that use information from other pictures in the sequence are usually called interframe (temporal) techniques. When a scene change occurs (and sometimes for other reasons), interframe compression does not work and the compression model should be changed. In this case the compression model should be structured to take advantage of the similarity of a given region of a picture to immediately adjacent areas in the same picture. Compression techniques that only use information from a single picture are usually called intraframe (spatial) techniques. A digital video uses a hierarchical layered syntax to help with error handling, random search, and synchronization. As shown in Figure 3.7, the hierarchical syntax of the digital video consists of six layers: sequence, group of pictures (GOP), picture, slice, macroblock, and block. The data of higher layers consist of data from lower layers [77].

44   

Chapter Three-Introduction to Digital Video Structure   

Figure 3.7: Structural Hierarchy of Digital Video.

3.3.1 Sequence Layer The outermost layer of a video bitstream is the video sequence layer. Except for certain critical timing information in the video systems layer, a video sequence bitstream is completely self-contained. It is independent of other video (and audio) bitstreams. The sequence starts with a sequence header that describes certain key information about the coded sequence including picture resolution and frame rate. The sequence consists of a series of groups of pictures (GOPs), the next layer of the hierarchy[77].

45   

Chapter Three-Introduction to Digital Video Structure   

3.3.2 Group of Pictures (GOP) Layer Each video sequence is divided into one or more groups of pictures, and each group of pictures is composed of one or more pictures of three different types, I-, P-, and B-, as illustrated in Figure 3.8. Typically a group of pictures (GOP) has a single I-frame and many P and B-frames[77].

Figure 3.8: Group Of Pictures

3.3.3 Picture Layer A picture is a primary coding unit of a video sequence. It consists of three rectangular matrices representing luminance (Y) and two chrominance (Cb and Cr) values. Being rectangular, the Y matrix has an even number of rows and columns. The Cb and Cr matrices are one-half the size of the Y matrix in each direction (horizontal and vertical). There are three major types of pictures defined in video: I, B and P. I-Pictures (intra-coded pictures): Intra frame is essentially the first frame to encode but with less amount of compression. This frame is also known as ‘key 46   

Chapter Three-Introduction to Digital Video Structure   

frame’ because the preceding frames are encoded using the information available from this frame. Intra-prediction utilizes spatial correlation in each frame to reduce the amount of transmission data necessary to represent the picture. P- Pictures (Predicted pictures): P-frames are inter frames and predicted by using the previous P or I-frame, the inter frames are encoded from the second frame onwards from the incoming frames as is shown in Figure 3.8. This type of frames is responsible for the most reduction of the video stream.

Figure 3.9: P-frame and its relation with other frames [78].

B- Pictures (Bi-predictive pictures): are bidirectional predicted frames. As the name suggests, B-frames rely on the frames preceding and following them. They contain only the data that have changed from the preceding frame or are different from the data in the very next frame. Since B-frames depend on both past and future picture as shown in Figure 3.9, the decoder have to be fed with future I-P frames before being able to decode them [78].

47   

Chapter Three-Introduction to Digital Video Structure   

Figure 3.10: B-frame and its relation with other frames [78].

3.3.4 Slice Layer A picture is made up of a number of slices, each of which contains an integral number of macroblocks. A slice starts with a slice header that defines its position. Each slice may be decoded independently of other slices within the picture and this helps the decoder to recover from transmission errors, if an error occurs within a slice, the decoder can always restart decoding from the next slice header. The Slices can continue from one macroblock row to the next. This slice structure, among other things, allows for great flexibility in signaling changes in some of the coding parameters. This is needed both to optimize quality for a given bitrate and to control that bitrate[77].

3.3.5 Macroblock Layer A slice is made up of an integral number of macroblocks, each of which consists of six blocks as illustrated in Figure 3.10.The macroblock consists of a 16×16 sample array of luminance(grayscale) samples together with one 8×8 block of samples for each of two chrominance (color) 48   

Chapter Three-Introduction to Digital Video Structure   

components. The 16×16 sample array of luminance samples is actually composed of four 8×8 blocks of samples. The macroblock header describes the type of macroblock, motion vector(s) and defines which 8 x 8 blocks actually contain coded transform data. The picture type (I, P or B) defines the default prediction mode for each macroblock, but individual macroblocks within P- or B-pictures may be intra-coded if required (i.e. coded without any motion-compensated prediction). This can be useful if no good match can be found within the search area in the reference frames since it may be more efficient to code the macroblock without any prediction[77].

Figure 3.11: Macroblock

3.3.6 Block Layer A block contains variable-length code(s) that represents the quantized transform coefficients in an 8 x 8 block. Each DC coefficient is coded differentially from the DC coefficient of the previous coded block, to exploit the fact that neighboring blocks tend to have very similar DC (average) values[77].

49   

Chapter Three-Introduction to Digital Video Structure   

3.4 I-Frame Detection A video sequence always starts with a sequence header. The sequence header is followed at by least one or more groups of pictures (GOP) and ends with an additional sequence headers may appear between any groups of pictures within the video sequence. A group of pictures always starts with a group of pictures header and is followed by at least one picture. Each picture in the GOP has a picture header determines the type of picture, always the first picture in GOP is Iframe type [77].

3.5 Digital Video Files Technological

developments

in

the

networking

technology,

broadcasting, and the computers make use of video possible. Storing and transmitting uncompressed raw video is not a good idea; it requires large storage space and bandwidth. Special algorithms which take the characteristics of the video into account can compress the video with high compression ratio. This section will provide an overview of the standardization efforts on digital video format.

3.5.1 AVI Format The AVI (Audio Video Interleave) format was developed by Microsoft (Seattle, Washington). It is a special case of the RIFF (Resource Interchange File Format). It is the most common format for audio/video data on PC's, and comes with the Windows operating system as part of the "Video for Windows (VfW)" distribution. The format is interleaved such that video and audio data are stored consecutively in an AVI file (i.e., a segment of video data is immediately followed by a segment of audio data). 50   

Chapter Three-Introduction to Digital Video Structure   

BMP is the bitmap file format of the Microsoft Windows (Microsoft, Seattle, Washington) environment. There are many other file formats for the same purpose, including JPEG, TIFF, TGA, PCX, PNG, and GIF. For two-color data files that store an image, each bit in the data file represents one pixel; a 1 meant the pixel was on, a 0 meant the pixel was off. Therefore, a two-color image is a map of bits. Windows bitmap files are stored in a device-independent bitmap (DIB) format that allows Windows to display the bitmap on any type of display device. The term "device independent" means that the bitmap specifies pixel color in a form independent of the method used by a display to represent color. Windows BMP format can be stored uncompressed, so reading BMP files is fairly simple; most other graphics formats are compressed, and some, like GIF, are difficult to decompress. There are a few different sub-types of the BMP file format. For 256-color bitmaps, it has a 54-byte header followed by a 1024-byte palette table. After that is the actual bitmap, which starts at the lower-left hand comer. It efficiently stores mapped or unmapped RGB graphics data with pixels 1-, 4-, 8-, or 24-bits in size. Data may be stored raw or compressed using a 4-bits or 8-bits RLE data compression algorithm. BMP is an excellent choice for a simple bitmap format which supports a wide range of RGB image data [79].

3.5.2 MPEG In 1988, the International Standards Organization (ISO) formed the Moving Pictures Expert Group (MPEG), with the formal designation ISOIEC/JTC1 SC29/WG11, to develop standards for the digital encoding of moving pictures (video) and associated audio. In 1991, the MPEG committee 51   

Chapter Three-Introduction to Digital Video Structure   

completed its first international standard, MPEG-1, formally ISO 11172.As a generic video coding specification, MPEG-1 supports multiple image formats, including, CIF, SIF, and QCIF. Image sizes up to 4,095 × 4,095 are supported. However, only progressive scan and 4:2:0 color subsampling are supported. While MPEG-1 proved successful for the computer entertainment industry, its lack of support for interlaced scan prevented its use in digital television [80, 81]. In 1990, the MPEG committee started work on MPEG-2, formally ISO 13818. MPEG-2 is an extension of MPEG-1 that remedies several major shortcomings of MPEG-1 by adding support for interlaced video, more color subsampling formats, and other advanced coding features. To lever-age existing MPEG-1 titles and to promote its adoption, MPEG-2 retains backward compatibility with MPEG-1. As an international standard, MPEG-2 is gaining success. For example, it is being considered as a component in several proposals for high definition television (HDTV); it is currently used in direct digital satellite broadcast and is part of standards for digital video broadcast (DVB); and it is specified as the video compression technology for use with the upcoming digital video disk (DVD). MPEG-3 was intended for EDTV and HDTV for higher bit rates and later merged with MPEG-2[82]. MPEG-4 was originally created as a standard for very low bit rate coding of limited complexity audiovisual material [79]. The concept of content-based coding of MPEG-4 is shown in Figure 3.11. Each input picture is decomposed into a number of arbitrarily shaped regions called video object planes (VOPs). Each VOP is then coded with a coding algorithm that is similar to H.263. The shape of each VOP is encoded using context-based 52   

Chapter C Th hree-Introdu uction to Diigital Video Structure  

arithmetic a coding. Success of digittal televission, interactive ggraphics application a ns and inteeractive multimedia m encourageed MPEG G group to design MPEG-4 M which w allow ws the user to interacct with thee objects inn the scenee within the t limits set s by the author. It also bringgs multimedia to low bit rate neetworks [83, 84, 85 5, 86].

Figure 3.1 12: Object-L Layer-Based d Video Cod ding in MPE EG-4.

MPE EG-7 is fo ormally callled Multim media Conntent Desccription Intterface. Thus, T it iss not a staandard wh hich deals with the aactual encoding of m moving pictures p an nd audio, liike MPEG G-1, MPEG G-2 and MP PEG-4.Thee aim of M MPEG-7 is i to speciify a set of descripto ors to desccribe varioous forms of multim media. It will w also standardizee ways to define d otheer descriptoors as welll as structuures for the t descrip ptors and th heir relatio onship. Thiis informaation will bbe associateed with the t contentt to allow fast f and effficient sear arch [87].

53  

Chapter Three-Introduction to Digital Video Structure   

3.5.3 H.261 and H.263 H.261 was the first widely-used standard for videoconferencing, developed by the ITU-T to support video telephony and videoconferencing over ISDN circuit-switched networks [88]. These networks operate at multiples of 64 kbit/s and the standard was designed to offer computationallysimple video coding for these bitrates. The standard uses the familiar hybrid DPCM/DCT model with integer-accuracy motion compensation. In an attempt to improve on the compression performance of H.261, the ITU-T working group developed H.263 [89]. H.263 was designed for very low bit rate coding applications. H.263 uses block motion-compensated DCT structure for encoding. This provides better compression than H.261, supporting basic video quality at bitrates of below 30 k bit/s, and is part of a suite of standards designed to operate over a wide range of circuit- and packet-switched networks. The ‘baseline’ H.263 coding model (hybrid DPCM/DCT with half-pixel motion compensation) was adopted as the core of MPEG-4 Visual’s Simple Profile. The original version of H.263 includes four optional coding modes and Issue 2 added a series of further optional modes to support features such as improved compression efficiency and robust transmission over lossy networks. The terms ‘H.263+’ and ‘H.263++’ are used to describe CODECs that support some or all of the optional coding modes. The choice of supported modes is up to the CODEC manufacturer and the wide range of possible mode combinations (and the corresponding difficulty of ensuring compatibility between CODECs) was one motivation for the relatively simple structure of H.264’s three profiles [90].

54   

Chapter Four-The Proposed Design     

   

Chapter Four-The Proposed Design   

4.1 Introduction This chapter is devoted to explain the proposed digital Video Partial Encryption system steps. First the tables that represent the addition, multiplication, addition inverse and multiplication inverse in GF (2 ), GF (2 ), and GF (2 ) are constructed. The proposed system model consists of two parts; the first part extracts the first image, the I-frame (Intraframe) of the digital video scene. I-Frame can be thought of as conventional, full sized frames. The second part is encryption section that applies the proposed algorithm to the channel Y of I-frame and reconstructed the video file before broadcasting. The Novel Symmetric Dynamic Dual Tiny Block Ciphering (SDD) Algorithm is the proposed algorithm, this approach (SDD) uses dual key for encryption with variable (dynamic) block bits size, at the receiver side, the decryption part of proposed algorithm will decrypt the Y channel.

4.2 Construction Addition and Multiplication Tables for ( ) , ( ) and ( ) The tables are constructed for addition and multiplication mathematical operation in GF (2 ) , GF (2 ) and GF (2 ). Tables 4.1, 4.2, and 4.3 represent the addition in GF (2 ) , GF (2 ) and GF (2 ) consecutively.

     

55

Chapter Four-The Proposed Design 

                                                                ( ). Table 4.1: Addition in                                                                                                                                                                                                                                                    Table 4.2: Addition in ( ).                                                                                 

56

Chapter Four-The Proposed Design        Table 4.3: Addition in                                                                                                          

(

).

     

Tables 4.4, 4.5, and 4.6 represent the addition inverse in GF (2 ), GF (2 ), and GF (2 ) consecutively.   

 

 Table 4.4: Addition Inverse in ( ). Table 4.5: Addition Inverse in                                                                                                                                                                                                                 

 

 

 

 

 

 

 

57

.

                                                                                                     

Chapter Four-The Proposed Design 

                                                                                                                                                                                                                                                                                                         Table 4.6: Addition Inverse in ( ).                                                                                                                                                                                                                               

To construct the multiplication finite filed GF(2 ) requires choosing an irreducible polynomial of degree n. The following tables 4.7, 4.8, and 4.9 represent multiplication in finite field GF (2 ) , GF (2 ) and GF (2 ) where the chosen irreducible polynomials are m(x) = x + x + 1, m(x) = x + x + 1 , m(x) = x + x + 1 and m(x) = x + x + 1 consecutively.                                          

58

Chapter Four-The Proposed Design      Table 4.7: Multiplication in (   m(x) = + + .                                                                                                Table 4.8: Multiplication in                 m(x) = + +                           

(

) with the Irreducible Polynomial

) with the Irreducible Polynomial

.

59

Chapter Four-The Proposed Design   

Table 4.9: Multiplication in ( m(x) = + + .

) with the Irreducible Polynomial

The following tables 4.10, 4.11 and 4.12 represent multiplication inverse in finite field GF (2 ), GF (2 ) and GF (2 ) with irreducible polynomials m(x) = x + x + 1, m(x) = x + x + 1, m(x) = x + x + 1 and m(x) = x + x + 1 consecutively.

60

Chapter Four-The Proposed Design   

Table 4.10: Multiplication Inverse in ( ) with the Irreducible Polynomial m(x) = + + .

Table 4.11: Multiplication Inverse in ( )  with the Irreducible Polynomial m(x) = + + 1.

Table 4.12: Multiplication Inverse in ( )                                                                                                                                with the Irreducible Polynomial m(x) = + + .                                  

 

 

 

          

61

Chapter Four-The Proposed Design   

The Galois Field tables are represented by one dimension or two dimension arrays and stored within the program as data base or they can be stored in cache memory for speed up the performance, for example the multiplication inverse and additive inverse tables are represented by one dimension arrays, while the multiplication and addition tables are represented by two dimension arrays.

The indexing search method is applied to find the multiplication or addition results. For example to find the multiplication result of two numbers 5 and 6 in GF(2 ) , one of these numbers (5 or 6) will represent the row and other the column ,the number stored in this location is 13 which is retrieved as the result of multiplication. The indexing search method is also applied on one dimension arrays tables.

4.3The Modification of the Security Broadcasting System Broadcasting system converts the digital video into YCbCr color vector before broadcasting, at the receiver station, the receiver converts it into RGB vector and display it as illustrated in Figure 4.1.This thesis adds to this system, encryption and decryption parts as it is shown in Figure 4.2 .

62

Chapter Four-The Proposed Design   

Figure 4.1 Broadcasting System.

63

Chapter Four-The Proposed Design   

Figure 4.2 Broadcasting System after Adding Encryption and Decryption Parts.

4.4 Symmetric Dynamic Dual (SDD) Tiny Block Ciphering Algorithm The symmetric dynamic dual tiny block ciphering (SDD) algorithm is the proposed algorithm that encrypts and decrypts the digital video in broadcasting system which uses dual key for encryption with four variable (dynamic) block bits size, each block bits size (3,4,5 or 6 bits ) are interpreted as an element of a finite field. The first key is called control key determines 64

Chapter Four-The Proposed Design   

the length of bits block (3, 4, 5 or 6 bits block) size to encrypt, and the second key is used for encryption by using an equation:      Y

= X ⋇ A + B   , where X bits is block, A and B are the encryption keys.

The mathematical operations addition and multiplication in this equation are based on mathematical theory of Galois field GF(2 ). Each block bits size (3 or 4 or 5 or 6 bits block) are interpreted as finite field elements using a representation in which a 3 or 4 or 5 or 6 bits with bits







represents the

polynomial consecutively.

4.4.1Partial Video Encryption Based on SDD Algorithm The partial video encryption technique is based on SDD algorithm which applied on Y-channel of I-frame of digital video scene. The SDD algorithm uses two keys, the first key is called control key (keyOne) which is used to determine the size of bit block and the second one(KeyTwo) is used for encryption. The size of bit block is 3 or 4 or 5 or 6 bits. The first step of the technique is reading the two least significant bits from control key(KeyOne) , if the value is 0 or 1 or 2 or 3 the block size will be 3 or 4 or 5 or 6 consecutively. Suppose the value of these two bits is 0, then 3bits from Y-channel is to be read and stored in (X) varible. 3bits from KeyTwo is to be read and stored in (A) variable and the next three bits is also to be read and stored in (B) variable. Second step, the encryption equation is performed on the 3bits block: Y = X ⋇ A + B .

65

Chapter Four-The Proposed Design   

If two bits’ value of KeyOne is 1 or 2 or 3 the same steps are applied but with four or five or six bits consecutively instead of three bits. These steps are applied to the rest Y channel’s content. Addition and multiplication in the encryption equation are based on a Galois field F(2 ), GF(2 ), GF (2 ) and GF (2 ) .

Algorithm (4.1) SDD Encryption algorithm   

Goal: Encrypt Y channel content  Input:            Y channel  , KeyOne , KeyTwo  Output :            Encrypted Y channel                  No_K1 //number of bits from keyOne that are used in first round               No_K2       //number of bits from keyTwo that are used in first round     Step 0:             ‐ No_K1=0  - No_K2= 0  - Round= 0

While Round < 2 do :  Step 1: Read a portion of KeyOne (Control key)  Step 2: Depending on the value of KeyOne’s portion do the following:  - Select the block size ( 3or 4 or 5 or 6 bits) from Y channel. - Read from KeyTwo A and B Keys. - Perform the following Encryption : = ⋇ + Step3 : Compute the number of bits for KeyOne and KeyTwo that are used in first round Check If Round =0 then No_K1=No_K1 + 2 No_k2=No_K2 + block size * 2 End if Step 4: Repeat steps 1, 2 and 3 until Y channel is finished. Round=Round+1 End while.   

The length of KeyOne and KeyTwo depend on the length of plaintext and are considered as the maximum by finding the maximum number of plaintext blocks when the block size is 3 bits , then by applying the 66

Chapter Four-The Proposed Design   

following equations to find the length of the first and second keys: KeyOne Length= Number of blocks * 2 KeyTwo Length= Number of blocks *6*2, where number six represents the maximum size block. It is possible to use one of the pseudorandom number generator algorithms to generate the keys. For example linear congruential generator algorithm or using Linear Feedback Shift Registers to increase the complexity of the guess keys process.      The

number of bits from keyOne and KeyTwo that are used in first

round can be encrypted by using Electronic Code Book mode and sent within algorithm. The following example illustrates the proposed technique in the encryption part, suppose the following: Plaintext= 11101101. keyOne =10011000. KeyTwo=1000100101101110111101111001101110. With Irreducible polynomial chosen for each bits. To encrypt the plaintext do the following: Step1: Read a portion (the first two bits) from KeyOne, the two bits are 00, the bit block size will be read from plaintext to encrypt is 3bits, it is 101. Read two 3bits block from KeyTwo and store them into variables A, and B, A =110, B =101. Step 2: Perform the following equation: Y = X ⋇ A + B The result of multiplication according to Table 2.3 is 101* 110 =011 67

Chapter Four-The Proposed Design   

The result of addition according to Table 2.1 is 011 + 101=110, the ciphertext for 3bits block=110. Step3 is executed then: No_K1= 2 No_k2= 6 To encrypt the next block, the same steps are applied, The next two bits from KeyOne is 10 , next 5bits from plaintext is 11101, The two 5bits blocks from keyTwo are A =11001, and B =11011. Perform the equation: 11101 ∗ 11001+ 11011= 10110 Ciphertext for 5bits block=10110. Step3: is executed then: No_K1=4 No_k2= 16 The numbers of bits of KeyOne and KeyTwo that are used in first round are 4 and 16 consecutively. The ciphertext 10110110 is the result of the first round of encryption plaintext 11101101. The same steps are applied in the second round: Step1 The next two bits from KeyOne is 01, next 4bits from ciphertext is 0110, the two 4bits blocks from keyTwo are A =1011, and B =1011. Perform the equation: 0110∗ 1011+ 1011=0100 The next two bits from KeyOne is 10, next 5bits from is 01011 (adding 0 pad at most left), the two 5bits blocks from keyTwo are A =00101, and B =10001 01011 ∗ 00101+ 10001= 10011 68

Chapter Four-The Proposed Design   

The ciphertext 100110100 is the result of encryption 11101101.

4.4.2 Partial Video Decryption Based on SDD Algorithm  The

partial video decryption technique is applied on encrypted Y-

channel of I-frame at receiver side of broadcasting system, and it can be described by the following steps:

Algorithm (4.2) SDD Decryption algorithm  

Goal: Decrypt Y channel content.   

Input :    Encrypted Y channel    , KeyOne , KeyTwo Output : Y channel       

Step 0 :             ‐Apply a circular left shift of (No_K1) bits and (No_K2) bits for KeyOne and KeyTwo consecutively -Round=0  

Step 1: While Round < 2 do    Step 2 : Read a portion of KeyOne(Control key)  Step 3 : Depending on the value of KeyOne’s portion do the following - Select the block size ( 3or 4 or 5 or 6 bits) from Encrypted Y channel - Read from KeyTwo A and B Keys - Perform the following Decryption Equation : =( + ( )) ∗ ( ) Step 4: Repeat steps 2 and 3 until Encrypted Y channel is finished Round=Round+1 End while   

For decryption the same steps of encryption are applied but with reverse equation’s operations are performed. 69

Chapter Four-The Proposed Design   

The following example illustrates the technique in the decryption part. Suppose the following: Ciphertext= 100110100 keyOne= 10011000. KeyTwo=1000100101101110111101111001101110.

With Irreducible polynomial chosen for each bits block. To decrypt the ciphertext the steps are: Step 0: Rotate left 4 bits of KeyOne and 16 bits of KeyTwo: keyOne =10001001. KeyTwo=1101111001101110 100010010110111011. Step2: The first two bits of KeyOne is 01, The first block size is read from ciphertext is 4bits, it is 0100, Read two 4bits blocks from KeyTwo, store them into A=1011, and B =1011. Step3: Perform the decryption equation: (0100 + addtion inverse (1011)) * multiplicative Inverse (1011) =0110. To decrypt second block, the same steps are applied, The next two bits from KeyOne is 10, the next 5bits from ciphertext is 10011, The next 5bits from KeyTwo are A =00101, and B =10001. Perform decryption equation: (10011+addtion inverse (10001)) * multiplicative Inverse (00101) = 01011. The result from the first decrypt round is 010110110, (last 0 is padding zero) The same steps are applied in the second round: 70

Chapter Four-The Proposed Design   

Step1: The next two bits from KeyOne is 00, next 3bits is 110, The two 3bits blocks from keyTwo are A =110, and B =101. Perform decryption equation: (110 +addtion inverse (101)) * multiplicative Inverse (110) =101 The next two bits from KeyOne is 10, next 5bits is 10110, the two 5bits blocks from keyTwo are A =11001, and B =11011. (10110+addtion inverse (11011)) * multiplicative Inverse (11001) =11101 The ciphertext 11101101 (after remove padding zero) is the result of the second round.

4.5 The Encryption Digital Video System Model

The Suggested Technique model consists of two parts; the main stages of the first part are started from reading video file in view that the frames of digital video is in YCbCr color system, converting it into frames, the output of this stage is frames in YCbCr color representation. The last stage deals with selecting the I-frame.

In the second part of system, the proposed Symmetric Dynamic Dual Tiny Block Ciphering (SDD) encryption algorithm is applied on Y-channel of I-frame, then reconstructing the video file before broadcasting. At the receiver side, the video file will be converted into frames, applying the decryption algorithm on Y-channel of I-frame. Figure 4.3 illustrates the steps of proposed system.

71

Chapter Four-The Proposed Design   

Input video file, in  view that it is in  YCbCr color system 

Convert video file  into frames    

At receiver side,  convert video file  into frames  

Reconstruct the  video file before  broadcasting  

Select the I‐frame   of video scene   

Apply decryption  algorithm on the Y  channel  

Select the I‐frame   of video scene   

Apply encryption  algorithm on the Y  channel  

Figure 4.3: The Steps of Partial Video Encryption Technique.

4.5.1 Converting Digital Video File into Frames The input to this system is digital video scene file considering that it is in YCbCr color system, the output of this stage is frames in YCbCr color system, then the I-frame (Intra-frame) of the digital video scene is selected, which is the first picture of the scene considering it as GOPs. and decomposed the color picture into its three color channels: Y, Cb, Cr.

The three color channels of YCbCr model are: Y-channel which represents the luminance, and (Cb, Cr) channels which represent the chrominance channels of the color image. Most of the data energy is concentrated in Y channel, while the channels Cb, Cr convey little part of the image information energy. The Human Vision System (HVS) is more 72

Chapter Four-The Proposed Design   

sensitive to brightness Y channel than to the two other (Cb, Cr) color channels, so Y channel of I-frame is selected for encryption.

4.5.2 Encryption Y Channel The encryption algorithm (4.1) is applied on Y channel of I-frame.

4.5.3 Reconstruct Video File before Broadcasting The video file is reconstructed by collecting the frames into video file. The input to this stage are frames of video file (I-frame and the rest frames, where I frame is encrypted); the images files was used as an input to this stage, the output will be the encrypted video file.

4.5.4 Decryption Y Channel At the receiver side, the digital video is converted into frames and the decryption algorithm (4.2) is applied on Y channel of I-frame after it is decomposed into three channels Y,Cb, and Cr .

4.6 Evaluation of the Symmetric Dynamic Dual (SDD) Algorithm The proposed algorithm SDD has passed through different developing stages, at the beginning the suggested algorithm used two dynamic blocks (3, 4) bits block with one round , then it was increased from one round into two rounds ,in spite of doubling the encryption and decryption time as illustrated in the table 4.13, but the security has increased greatly thousands of times which is illustrated in the table 4.14, the detailed description of the proposed algorithm evaluation security is illustrated clearly in chapter five. Afterwards the proposed algorithm is developed by using four dynamic blocks instead of two dynamic blocks, this leads to the higher security than when using two blocks, and no difference in the encryption time is noticed by 73

Chapter Four-The Proposed Design   

comparing the algorithm using two blocks with four blocks during one round, and also by comparing the algorithm using two blocks with four blocks during two rounds. Table 4.13: The Encryption and Decryption Time of the Proposed (SDD) Algorithm with Single Round and Dual Round.

Frame

Lion

Frame Single Round Algorithm Dual Round Algorithm Size(KB) Encryption Decryption Encryption Decryption Time Time Time Time (second) (second) (second) (second) 148 0.437 1.015 1.268 3.099

Car

60

0.219

0.484

0.656

1.282

Girl

332

1.203

2.641

3.489

8.063

Wedding

1180

4.360

9.703

12.468

28.594

Player

160

0.531

1.219

1.590

3.228

Xylophone

225

0.797

1.781

2.312

5.438

baseball

64

0.219

0.469

0.635

1.432

Table 4.14: The Number of Possibilities of Keys that Needed to Decrypt the Ciphertext with 128 bits Size by Using (SDD) Technique.

SDD Single Round algorithm Using two Minimum Maximum blocks 2.97753112e+94 8.89701700e +126 Using four blocks

Dual Round Minimum Maximum 8.86569157e+188 7.91569097e+253

1.36486587e+102 4.243027599e+199 1.86285884e+204 1.80032832e+399

The proposed algorithm was applied on the image on the red, green, blue channels separately, for instance the red channel is chosen for encryption, 74

Chapter Four-The Proposed Design   

then forming the image, but the image was distinguished, the same result was achieved when either green or blue channel is encrypted, that is shown in Figure 4.4. It is also applied on Cb or Cr channel in color system YCbCr, still the aspects of the image were noticed, but when it was applied on the Y channel, the aspects of the image vanished; this is illustrated in Figure 4.5.

a                                                                    b         

c

 

 

d

Figure 4.4: (a) Original Boy Image in RGB, (b) Boy Image in RGB after Encrypting Red Channel, (c) Boy Image in RGB after Encrypting Green Channel, (d) Boy Image in RGB after Encrypting Blue Channel .

75

Chapter Four-The Proposed Design   

a

b

c

Figure 4.5: (a) Boy Image in RGB after Encrypting Y Channel, (b) Boy Image in RGB after Encrypting Cb Channel, (c) Boy Image in RGB after Encrypting Cr Channel.

76

Chapter Five- Simulate Results  

           

Chapter Five-Simulate Results  

5.1 Introduction This chapter is dedicated to implement encryption digital video and to present the results of encryption. First the chapter evaluates RGB and YCbCr color specification models to determine the most color space channel that carrying more information. By finding the Histogram for each channel for both RGB and YCbCr color spaces, the results indicate that the Y channel in the luminance-chrominance (YCbCr) space is the best channel for encryption since it contains more information than two other Cb and Cr channels and the human eye is more sensitive to frequencies in luminance channel. Second a new Symmetric Dynamic Dual Tiny Block Ciphering (SDD) encryption/decryption approach is applied to data, at the beginning, this algorithm uses two dynamic blocks size (3 and 4 bits). The proposed algorithm was compared to the AES, and it achieved best results. The proposed algorithm is applied to video scene and compared to AES algorithm; the proposed algorithm achieved best result. The chapter also presents cryptanalysis of Dynamic Dual Tiny Block Ciphering (SDD) Algorithm. Finally, the video film cases have been completely studied throughout applying of suggested encryption technique on three difference films as regards velocity and color aspect.

5.2 Histogram for Each Channel According to the following images results and

color histogram in

Figure 5.1and Figure 5.2 it is seen, Red ,Green and blue channels contain the 77             

Chapter Five-Simulate Results  

same level of information. In the RGB color space the three colors are equally important as shown in Figure 5.1 and so are usually all stored at the same resolution. But it is possible to represent a color image more efficiently by separating the luminance from the color information and representing luma with a higher resolution than color by converting into YCbCr color space.

b

a

 

c

d

Figure 5.1: (a) Original Family Image in RGB, (b) Red Channel of Family Image in RGB, (c) Green Channel of Family Image in RGB, (d) Blue Channel of Family Image in RGB.

78             

Chapter Five-Simulate Results  

a

Intensity of Pixels

Intensity of Pixels

b

Intensity of Pixels

c Figure 5.2: (a) Red Channel Histogram of Family Image in RGB, ( b) Green Channel Histogram of Family Image in RGB (c) Blue Channel Histogram of Family Image in RGB. 79             

Chapter Five-Simulate Results  

The image is converted into YCbCr system, the following Figures 5.3 and 5.4 are shown that Y channel holds more information than two channels Cb,and Cr. For this reason Y-Channal is chosen to applied SDD encryption algorithm to it.

a b c Figure 5.3: (a) Y Channel of Family Image in YCbCr Color System, (b) Cb Channel of Family Image in YCbCr Color System, (d) Cr Channel of Family Image in YCbCr Color System.

Intensity of Pixels

a

80             

Chapter Five-Simulate Results  

Intensity of Pixels

b

Intensity of Pixels

c

Figure 5.4: (a) Y Channel Histogram of Family Image in YCbCr Color System, (b) Cb Channel Histogram of Family Image in YCbCr Color system, (c) Cr Channel Histogram of Family Image in YCbCr Color System.

81             

Chapter Five-Simulate Results  

5.3 Applied Symmetric Dynamic Dual (SDD) Tiny Block Ciphering Algorithm This section presents a comparison between proposed (SDD) algorithm and AES algorithm, at first the (SDD) algorithm is applied to data and the following tables represent the experimental results for the speed of the Symmetric Dynamic Dual (SDD) Key algorithm in first and second round, and the speed of AES algorithm.      

Table 5.1: The Encryption and Decryption Times for Symmetric Dynamic Dual (SDD) Key in the First Round. 

Data Size (byte) 19000 20000 40000 50000

Encryption Time(ms) 69.86 71 144 178

Decryption Time(ms) 105 73 178 214

Table 5.2: The Encryption and Decryption Times for Symmetric Dynamic Dual (SDD) Key Algorithm in the Second Round.    

Data Size (byte) 19000 20000 40000 50000

Encryption Time(ms) 157.72 158 303 372

82             

Decryption Time(ms) 165 160 372 428

Chapter Five-Simulate Results  

Table 5.3: The Encryption and Decryption Times for AES Algorithm Using key Size 128bit. 

Data Size (byte) 19000 20000 40000 50000

Encryption Time(ms) 6500 6813 13812 17156

Decryption Time(ms) 10641 11188 22141 27516

According to the output results of (SDD) algorithm as shown in tables 5.13, and 5.14 the proposed encryption algorithm is much better than all other known techniques like 3-DES, AES-Rijndael, and RSA [91]. Advanced Encryption Standard (AES) is an algorithm of the first category which is used nowadays in communication and encrypted video broadcasting, and it provides much higher security level than DES and perform it in 3 to 10 less computational power than 3-DES  [92], it has better performance than DES, 3DES, and RC2 [93],  based on these facts, AES is to be compared with proposed technique. A comparison between AES and the (SDD) algorithm is illustrated in tables 5.1, 5.2 and 5.3. From tables 5.1 and 5.3, it can be noted that (SDD) algorithm in the first round achieves best results, where it is approximately 93 times faster than AES encryption and 100 times faster than AES decryption. From tables 5.2 and 5.3, can be observed that the Symmetric Dynamic Dual (SDD) Key algorithm is approximately 43 times faster than AES encryption and 64 times faster than AES decryption.

83             

Chapter Five-Simulate Results  

The algorithm is applied to some digital video scenes, car, wedding and xylophone scene, on the I-frame, mutually on Y channel and compared the results with AES algorithm results. Table 5.4: The Encryption and Decryption Times for AES Algorithm Using Key size 128bit on I-Frame.  

Security Algorithm

I-Frame Name

AES-Rijndael

Car Wedding xylophone

Size of Frame KB 60 1180 225

Encryption Time (Second) 8 175 28

Decryption Time (Second) 12 260 46

Table 5.5: The Encryption and Decryption Times for Symmetric Dynamic Dual (SDD) Key Algorithm on I-Frame.

Security Algorithm

I-Frame Name

SDD algorithm

Car Wedding xylophone

Size of Frame KB 60 1180 225

Encryption Time (Second) 0.656 12.468 2.312

Decryption Time (Second) 1.282 28.594 5.438

From tables 5.4 and 5.5, can be observed that the Symmetric Dynamic Dual (SDD) Key algorithm is approximately 13 times faster than AES encryption and 9 times faster than AES decryption. The work in this thesis attempts to develop a new encryption/decryption approach which minimizes the encryption and decryption time that makes it appropriate for Real-Time Applications RTA.

84             

Chapter Five-Simulate Results  

In addition, it provides high level of security by using dual key, another interesting property of the algorithm is using dynamic tiny block cipher. Some of the test videos along with their frame numbers like car and xylophone are shown in Figure 5.5, Figure 5.6 and Figure 5.7.

a

c

b

d

Figure 5.5: The Encryption Results after Applying Partial Video Encryption Based on SDD Algorithm for the 1st Frame in Car and Xylophone Video, (a)Original I-Frame of Car Video, (b) car I-Frame after Encryption, (c) Original I-Frame of Xylophone Video, (d) Xylophone I-Frame after Encryption.

85             

Chapter Five-Simulate Results  

a

c

b

d

Figure 5.6:The Effect of the Partial Video Encryption Based on SDD Algorithm on Car Video Frames is Used as Test Object, (a) Original Car Film after 4 Seconds, (b) Encryption Car film after 4 Seconds,(c) Original Car Film after 8 Seconds, (d) Encryption Car Film after 8 Seconds.

86             

Chapter Five-Simulate Results  

a

b

c

e

d

f

Figure 5.7 :The Effect of the Partial Video Encryption Based on SDD Algorithm on Xylophone Video Frames is Used as Test Object, (a) Original Xylophone Film after 2 Seconds, (b) Encryption Xylophone Film after 2 Seconds , (c) Original Xylophone Film after 5 Seconds, (d) Encryption Xylophone Film after 5 Seconds, (e) Original Xylophone Film after 8 Seconds,( f) Encryption Xylophone Film after 8 Seconds. 87             

Chapter Five-Simulate Results  

5.4 Security of Dynamic Dual (SDD) Tiny Block Ciphering

Algorithm.  Cryptography

may

be

described

as

the

science

of

secure

communication over a public channel. An important area of cryptography is symmetric key cryptography. In symmetric key cryptography, the two parties share a secret piece of information, the key, and a public encryption algorithm. The message (M) is encrypted by using the encryption half of algorithm C=E k(M). The message is decrypted by computing D k(C) = D k (E k (M)) =M. M, K, and C may are taken to be finite sequences of bits. Without knowing K, an attacker cannot compute M from C. A more common assumption in modern cryptography is to assume that an attacker may have several pairs Mi,Ci from which to try to recover the key (a known plaintext attack), or may even be able to pick M’s or C’s to have encrypted or decrypted. (a chosen plaintext or chosen ciphertext attack, or, if both are allowed, a chosen text attack). In these cases, simply by trying all possible keys an attacker will eventually recover the key K. This is known as a brute force attack, or exhaustive key search [30]. The proposed algorithm is resistant against brute force attacks, because it employs dual key and dynamic block cipher, hence it will be very difficult to guess the key. The following example illustrates a number of possibilities of keys that the attacker needs to decrypt the ciphertext with 128 bits by using Dual key technique with two dynamic blocks 3 and 4 bits size:

88             

Chapter Five-Simulate Results  

The control key (KeyOne) determines the block size either 3bits or 4bits block size. To construct GF(2 ), there are two an irreducible polynomials degree 3, and for construct GF(2 ), there are three with degree 4.The equation is: Y = X ⋇ A + B, A and B are keys, the size of both is either 3 bits or 4 bits. If the block size is 3 bits, the number of possible keys for each key is 2 . The number of possibility of keys to decrypt one 3bits block size for each round is: 2 ∗ 2 ∗ 2 = 2 . The number of possibility of keys to decrypt one 4bits block size for each round is: 3 ∗ 2 ∗ 2 = 3 ∗ 2 . To decrypt only one block, the number of possibility of keys for each round is: 2 + 3 ∗ 2 = 896. It is possible to compute the minimum and maximum number of possibility of keys to decrypt 128 bits of ciphertext, first the maximum number of blocks is computed when all blocks are of 3bits size, 128 ÷3=42.6, the result with reminder will be increased by one, thus the maximum number of blocks is 43, and the minimum number of blocks is computed when all blocks are of 4bits size, 128 ÷4=32. it can be computed the minimum and maximum number of possibility of keys to decrypt 128 ciphertext bits. The minimum number of possibility of keys for each round is: 89             

Chapter Five-Simulate Results  

(2 + 3 ∗ 2 )

= 2.97753112e + 94.

The maximum number of possibility of keys for each round is: (2 + 3 ∗ 2 )

= 8.89701700e + 126.

The algorithm has two rounds hence the minimum number of possibility of keys is: (2 + 3 ∗ 2 )

∗ (2 + 3 ∗ 2 )

= (2 + 3 ∗ 2 )

=8.86569157e+188

The maximum number of possibility of keys for two rounds is: (2 + 3 ∗ 2 )

∗ (2 + 3 ∗ 2 )

= (2 + 3 ∗ 2 )

= 7.91569097e + 253. The proposed algorithm is developed by using four dynamic blocks instead of two dynamic blocks, this lead to the higher security than when using two blocks. The number of possibilities of keys that the attacker needs to decrypt the ciphertext with 128 bits by using Dual key technique with four dynamic blocks is found in the following steps: The control key (KeyOne) determines the block size either 3, 4, 5 or 6 bits block size. To construct GF(2 ), there are two an irreducible polynomials degree 3, for construct GF(2 ), GF(2 ), and GF(2 ) there are three with degree 4, six with degree 5, nine with degree 6 consecutively . The equation is: Y = X ⋇ A + B, A and B are keys, the size of both is 3, 4, 5 or 6 bits. If the block size is 3 bits, the number of possible keys for each key is 2 . The number of possibility of keys to decrypt one 3bits block size is: 2 ∗ 2 ∗ 2 = 2 . 90             

Chapter Five-Simulate Results  

The number of possibility of keys to decrypt one 4bits block size is: 3 ∗ 2 ∗ 2 = 3 ∗ 2 . The number of possibility of keys to decrypt one 5bits block size is: 6 ∗ 2 ∗ 2 = 6 ∗ 2

= 6144 .

The number of possibility of keys to decrypt one 6 bits block size is: 9 ∗ 2 ∗ 2 = 9 ∗ 2 = 36864. To decrypt only one block, the number of possibility of keys for each round is: (2 + 3 ∗ 2 + 6 ∗ 2

+ 9 ∗ 2 ) = 43904.

It is possible to compute the minimum and maximum number of possibility of keys to decrypt 128 bits of ciphertext, first the maximum number of blocks is computed when all blocks are of 3bits size, 128 ÷3=42.6, the result with reminder will be increased by one, thus the maximum number of blocks is 43, and the minimum number of blocks is computed when all blocks are of 6bits size, 128 ÷6=21.3, the result will increased by one, therefore the minimum number of blocks is 22.It can be computed the minimum and maximum number of possibility of keys to decrypt 128 ciphertext bits. The maximum number of possibility of keys for each round is: (2 + 3 ∗ 2 + 6 ∗ 2

+ 9 ∗ 2 )

= 4.243027599e + 199.

The minimum number of possibility of keys for each round is: (2 + 3 ∗ 2 + 6 ∗ 2

+ 9 ∗ 2 )

= 1.36486587e + 102.

The algorithm has two rounds hence the maximum number of possibility of keys is:

91             

Chapter Five-Simulate Results  

(2 + 3 ∗ 2 + 6 ∗ 2 2 )

+ 9 ∗ 2 ) *(2 + 3 ∗ 2 + 6 ∗ 2

+ 9 ∗

= 1.80032832e + 399.

The minimum number of possibility of keys is: (2 + 3 ∗ 2 + 6 ∗ 2 2 )

+ 9 ∗ 2 ) *(2 + 3 ∗ 2 + 6 ∗ 2

+ 9 ∗

= 1.86285884e + 204.

5.5 Security of AES Algorithm. The following example illustrates a number of possibilities of keys that the attacker needs to decrypt the ciphertext with 128 bits by using AES algorithm with key length128 bits. First, AES has four stages, only AddRoundKey stage uses key, to encrypt plaintext 128 bits, the plaintext is divided into four words, each one has 32bits size, and is encrypted as independent unit from each other by using AddRoundKey stage. To encrypt one word during one AddRoundKey stage a key with 32bits size is needed .To break a key for one word within one stage, the attacker needs 2 possibility number of keys, and in order to break ciphertext has 128 bits size within one AddRoundKey stage, the attacker needs: 2

+2

+2

+2

= 17179869184 possibility number of keys.

AES algorithm has 10 rounds, each round has one AddRoundKey stage, as well as another AddRoundKey outside the rounds loop, so the number of possibility of keys to decrypt ciphertext with 128bits size is: (2 )

+ (2 )

+ (2 )

+ (2 )

92             

= 3.66959779e + 106

Chapter Five-Simulate Results  

By comparing AES with SDD algorithm using dual rounds with four dynamic bits blocks, it is found that the number of possibility of keys that SDD algorithm needs to decrypt ciphertext with 128 bits size is much greater than AES algorithm, as illustrate in the following: The minimum difference in number of possibility of keys between SDD and AES algorithm is as shown in the following: 1.86285884e + 204. −3.66959779e + 106 = 1.49589906e + 98. The maximum difference in number of possibility of keys between SDD and AES algorithm is as shown in the following: 1.80032832e + 399 − 3.66959779e + 106 = 1.43336854e + 293. 5.6 Cases Study for Digital Video Films In this section, the suggested encryption technique has been completely applied on the various cases of video films. Firstly, it was applied on cartoon video film containing colored homogenous spots; secondly it was also applied on a traditional baptism day film which contains difference in color spots but with limited motion. Finally, it was applied on football team film which contains fast difference in frames faster than the previous two films, the result of encryption is illustrated in Figures 5.8, 5.9, 5.10 of cartoon as well as baptism day and football team films consecutively.

93             

Chapter Five-Simulate Results  

a

b

c

e

d

f

94             

Chapter Five-Simulate Results  

g

h

i)

i

j

Figure 5.8: The Effect of the Partial Video Encryption Based on SDD Algorithm on Cartoon Video Frames is Used as Test Object, (a) Original Cartoon Film after 1 Second, (b) Encryption Cartoon Film after 1 Second, (c) Original Cartoon Film after 3 Seconds, (d) Encryption Cartoon Film after 3 Seconds, (e) Original Cartoon Film after 5 Seconds,(f) Encryption Cartoon Film after 5 Seconds, (g) Original Cartoon Film after 8 Seconds, (h) Encryption Cartoon Film after 8 Seconds,(i) Original Cartoon Film after 13 Seconds, (j) Encryption Cartoon Film after 13 Seconds.

95             

Chapter Five-Simulate Results  

a

b

c

d

e

f

96             

Chapter Five-Simulate Results  

g

i

h

j

Figure 5.9: The Effect of the Partial Video Encryption Based on SDD Algorithm on Baptism Video Frames is Used as Test Object, (a) Original Baptism Film after 1 Second, (b) Encryption Baptism Film after 1 Second, (c) Original Baptism Film after 3 Seconds, (d) Encryption Baptism Film after 3 Seconds, (e) Original Baptism film after 5 Seconds, (f) Encryption Baptism Film after 5 Seconds,(g)Original Baptism Film after 8 Seconds, (h) Encryption Baptism Film after 8 Seconds, (i) Original Baptism Film after 13 Seconds, (j) Encryption Baptism Film after 13 Seconds .

97             

Chapter Five-Simulate Results  

a

b

c

d

c

f

98             

Chapter Five-Simulate Results  

g

h

i

j

Figure 5.10: The Effect of the Partial Video Encryption Based on SDD Algorithm on Football Video Frames is Used as Test Object, (a) Original Football Film after 1 Second, (b) Encryption Football Film after 1 Second, (c) Original Football film after 3 Seconds, (d) Encryption Football Film after 3 Seconds, (e) Original Football Film after 5 Seconds, (f) Encryption Football Film after 5 Seconds, (g) Original Football Film after 8 Seconds,(h)Encryption Football Film after 8 Seconds, (i) Original Football Film after 13 Seconds, (j) Encryption Football Film after 13 Seconds.

99             

Chapter Six- Conclusions and Future Works   

 

Chapter Six- Conclusions and Future Works     

6.1 Conclusions Encryption mechanisms cannot be used directly for any application without knowing requirements. For an application like military, it is needed to encrypt all frames in the video, using good encryption algorithm. On the other hand for some applications like real-time video transfer, it is needed to encrypt the frames at a limited time than the encryption of all the frames. Various encryption algorithms were proposed for the protection of individual data. All these encryption algorithms need to satisfy these two constraints security and speed. In this thesis, the (SDD) algorithm is proposed for the protection of video data based on the encryption of Y channel of I-Frame. The proposed algorithm has been designed with two major factors in mind; first, decreasing the time needed for encryption/decryption, second, increasing the high security so attackers cannot obtain the encryption /decryption key easily. The mathematical operations in this algorithm are based on mathematical theory of Galois field GF 2 , the efficiency of this method is that using a Dual key and it supports a variable length bits block. The entire work is summarized as follows:

1-No variation has been made in the digital video structure, because of making use of the present broadcasting technique; whereas a change has been made in the part of complete structure. 2-At the beginning a proposed Symmetric Dynamic Dual Tiny Block Ciphering (SDD) encryption/decryption approach used two dynamic blocks (3, 4) bits block with one round, then it was increased from one round into two 100   

Chapter Six- Conclusions and Future Works     

rounds, it is at first, applied to data, then to frame with one and two rounds, and comparison with AES algorithm where it is faster than AES encryption and decryption.

3- The high speed of computers and the need to raise the security led to the development of

proposed algorithm (SDD) by using four dynamic blocks

instead of two dynamic blocks. It is first applied to the data then to the frame. In comparison with AES algorithm, it was found that it is faster than AES encryption and decryption.

4-Dynamically partition the video sequences into GOPs. Then a color video data of I-frame is converted into YCbCr color system, each Y Channel Of I-frame of GOP is individually encrypted by applying SDD algorithm. The test results of the comparison between AES algorithm and SDD algorithm have reflected that the Symmetric Dynamic Dual (SDD) Key algorithm is approximately 13 times faster than AES encryption and 9 times faster than AES decryption.

5-The encryption methods proposed here, provide good computational security and minimize the encryption and decryption time that makes it appropriate for Real-Time Applications RTA, like broadcasting video Video On Demand, PAY-TV, Video conferencing, etc.

6-According to the output results of the proposed algorithm, it is much faster than all other known techniques like 3-DES, AES-Rijndael, and RSA[91]. It appropriate for Real-Time Applications RTA such as broadcasting.

101   

Chapter Six- Conclusions and Future Works     

6.2 Suggestions for Future Works The proposed future works is based on, First, the development in the techniques and structures of satellite broadcasting. Second, the development in the speed of computers gives enough time for attackers to break the encryption key, and at the same it gives us an opportunity to raise the efficiency of the proposed algorithm. Among the different suggestions that are stimulated during the discussion of the test results, the following suggestions are made as topics for future research work: 1- Improving the efficiency of security using additional variable (dynamic )block size, block such as 7,8 ,9 block size. 2- Increasing the number of rounds will increase security against differential cryptanalysis. But by increasing the speed of the computer the attack will be much easier, the security of algorithm also can kept by increasing the rounds and dynamic block number.

3-Editing mathematical operations of the SDD algorithm by using new mathematical equation more complicated. 4-Add transform stage in SDD algorithm for the I-frame i.e. rotates the number of bits in each byte according to the value of first and second keys.

102   

References [1] Schneier B., " Applied Cryptography – Protocols, Algorithms, and Source Code in C", John Wiley & Sons, Inc.,New York, second edition, 1996. [2] Matias Y., and Shamir A., "A Video Scrambling Technique Based on Space Filling Curves", Proceedings on Advances in CryptologyCRYPTO’87, Lecture Notes in Computer Science, Vol. 293, pp.398417, 1987. [3] CENELEC,"European Committee for Electro technical Standardization", Dec.1992. Access control system for the MAC/packet family: EUROCRYPT,European Standard EN 50094. Brussels: CENELEC. [4] Lian S., "Multimedia Content Encryption", CRC Press, Taylor & Francis Group, 2009. [5] Tudor P. N., "MPEG-2 Video Compression", Electronics and Communication Engineering Journal, Vol.7, No. 6, pp. 257 - 264, 1995. [6] Chen Z., Xiong Z., and Tang L.,"A Novel Scrambling Scheme for Digital Video Encryption", Proc. of Pacific-Rim Symposium on Image and Video Technology (PSIVT), pp.997-1006, 2006. [7] Sun L. G., Kung Y. and Larsen J., "Multimedia Image and Video Processing", Library of Congress, USA, 2000. [8] Yekkala A. K., "Analysis and Design of Image and Video Encryption Algorithms", Master of Science Engineering, Computer Science and Automation, Indian Institute of Science, 2006.

103

[9] Mao Y. B., Chen G. R., and Lian S. G.,"A Novel Fast Image Encryption Scheme Based on the 3D Chaotic Baker Map", International Journal of Bifurcation and Chaos, pp.3613-3624,2004. [10] Shi C., Wang S., and Bhargava B., "MPEG Video Encryption in Real-Time Using Secret Key Cryptography", In Proceedings of Parallel and Distributed Processing, Technologies and Applications 99 Las Vegas, pp.2822-2828, 1999. [11] Zeng W., and Lei S., "Efficient Frequency Domain Selective Scrambling of Digital Video", IEEE Transactions multimedia, Vol. 5, No.1 pp.118-129, 2003. [12] Vanstone S. A., Menezes A. J., and Oorschot P. C., "Handbook of Applied Cryptography", Boca Raton, FL: CRC Press.1996. [13] Furht B.,"Handbook of Internet and Multimedia Systems and Applications",Boca Raton, FL: CRC Press. 1999. [14] Qiao L. and Nahrstedt K.,"A New Algorithm for MPEG Video Encryption", in Proceedings of the First International Conference on Imaging Science, Systems, and Technology, Las Vegas , pp.21-29, 1997.

[15] Eskicioglu A.M.,and Delp E.J.," An Integrated Approach to Encrypting Scalable Video ", Multimedia and Expo Journal, Vol.1 pp. 573-576,2002. [16] Wen J., Severa M., Zeng W., Luttrell M. and Jin W. “A FormatCompliant Configurable Encryption Framework for Access Control of Video”, IEEE transactions on circuit and systems for video technology. Vol.12, No. 6, 2002.

104

[17] Lookabaugh T. et al.,"Selective Encryption of MPEG-2 Video", in Proceedings of the SPIE Multimedia Systems and Applications VI, Orlando, FL, 2003. [18] Zeng W. and Lei S., "Efficient Frequency Domain Selective Scrambling of Digital Video", IEEE transactions Multimedia on, Vol.5 .No.1,pp.118-129, 2003. [19] Bhargava B. C. Shi. And Wang S. Y.,"MPEG Video Encryption Algorithms", Multimedia Tools and Applications, Vol 24. No.1, pp.57-79, 2004.

[20] Lian S., Liu Z., Ren Z., and Wang H., "Secure Advanced Video Coding Based on Selective Encryption Algorithms",IEEE transactions on consumer electronics ,Vol.528,No.2, pp.621-629, 2006. [21] Choo E., Lee J., Lee H. and Nam G. "SRMT: A Lightweight Encryption Scheme for Secure Real-time Multimedia Transmission", Multimedia and Ubiquitous Engineering, 2007. MUE '07. International Conference ,pp.60-65,2007. [22] Socek D., Magliveras S., Culibrk D. , Marques O., Kalva H., and Furht B, "Digital Video Encryption Algorithms Based on Correlation-Preserving Permutations", EURASIP Journal on Information Security, Vol. 2007, No.1, pp. 052965-052965, 2007.

[23] Fong S, "On Improving the LightWeight Video Encryption Algorithms for Real-Time Video Transmission ", Communications and Networking, 3th International Conference , China, pp.1287-1293, 2008. 105

[24] Sun H.M., and Leu M. C., "A Real-Time Selective Video Encryption Using Context-Key Control",5th International Conference on Information Assurance and Security, Vol. 2, pp.114-117, 2009. [25] Varlakshmia L.M., Sudhab G.F., Jaikishan G .,"An Efficient Scalable Video Encryption Scheme for Real time applications", International Conference on Communication Technology and System Design 2011, Procedia Engineering, Vol.30, pp. 852860,2012. [26] NIST," Advanced Encryption Standard (AES)", Federal Information Processing Standards Publication (FIPS PUB) 197, Nov 2001. [27] Diffie W. and Hellman M. E.," New Directions in Cryptography", IEEE Transactions on Information Theory, Vol.22, No.6, pp.644-654, 1976. [28] Bhattacharya P. B., Jain S. K., and Nagpaul S. R.,"Basic Abstract Algebra",Cambridge University Press, 2nd edition , 1995. [29] Buchmann J. A.," Introduction to Cryptography ", springer-Verlag New York, Inc., 2001. [30] Talbot J. and Welsh D., "Complexity and Cryptography A Introduction", Cambridge University Press, 2006. [31] Stallings W., "Cryptography and Network Security", 4th edition, Prentice-Hall, 2005. [32] Graham R., Knuth E. D., and Patashnik O.," Concrete Mathematics: A Foundation for Computer Science", Addison-Wesley,Reading, Massachusetts, 1992.

106

[33] Harris Sh.," SICCP Exam Guide", 4th edition, McGraw-Hall , 2007. [34] Stallings W., "Network Security Essentials, Applications and Standards ", Pearson Education, Inch. 2007. [35] Schneier B., "Applied Cryptography - Protocols, Algorithms, and Source Code in C", 2nd edition, John Wiley and Sons, Inc., New York, 1996. [36] Nalini C., Anandmohan P.V , Poomaiah D.V, and kulkami V.D., "Compact Designs of SubBytes and MixColumn for AES", IEEE International Advance Computing Conference,pp.1241-1247,2009. [37] Zhang. L and Howard H. M., "Hardware Design and Analysis of Statistical Cipher Feedback Mode Using Serial Transfer", IEEE Canadian Conference on Electrical and Computer Engineering, pp.1133-1136, 2007. [38] Xiao Y., Chen H. H., Xiaojiang D., and Guizani M., "Stream-Based Cipher Feedback Mode in Wireless Error Channel",IEEE Transaction on Wireless Communications, Vol.8, NO.2, pp. 622-626,2009. [39] Daemen J. and Rijmen V.," AES Proposal: Rijndael", NIST AES Proposal,June 1998. [40] Daemen J. and Rijmen V., "The Design of Rijndae, Information Security and Cryptography", Springer, 2002. [41] Hellman M. E.," A Cryptanalytic Time-memory Tradeo", IEEE Transactions on Information Theory, Vol. 26, No.4, pp.401-406, 1980. [42] Biham E. and Shamir A., "Differential Cryptanalysis of DES-like Cryptosystems ", Advances in Cryptology -Crypto'90, 10th Annual 107

International Cryptology Conference,Vol. 537 of Lecture Notes in Computer Science,pp. 2-21, Springer-Verlag, 1990.

[43] Biham E. and Shamir A.," Differential cryptanalysis of DES-like cryptosystems", Journal of Cryptology ,Vol. 4,No.1,pp.3-72, 1991. [44] Davies D. and Murphy S.,"Pairs and triples of DES S-boxes", Journal of Cryptology, Vol.8, No.1, pp.1-25,1995.

[45] Biham E. and Biryukov A.," An Improvement of Davies Attack on DES", Advances in Cryptology, Eurocrypt'94, Workshop, Vol. 950 of Lecture Notes in Computer Science, pp. 461-467 ,Springer-Verlag, 1995. [46] Biham E. and Biryukov A.," An Improvement of Davies' Attack on DES", Journal of Cryptology, Vol.10, No.3, pp.195-205, 1997. [47] Matsui M.," Linear Cryptanalysis Method for DES Cipher", Advances in Cryptology - Eurocrypt'93, workshop, Vol. 765 of Lecture Notes in Computer Science, pp. 386-397, Springer-Verlag, 1993. [48] Matsui M., "The First Experimental Cryptanalysis of the Data Encryption Standard", Advances in Cryptology -Crypto'94,14th Annual International Cryptology Conference, USA, Vol.839 of Lecture Notes in Computer Science, pp. 1-11, Springer-Verlag, 1994. [49] Shimoyama T. and Kaneko T.," Quadratic Relation of S-box and its Application to the Linear Attack of Full Round DES", Advances in Cryptology - Crypto'98, 18th Annual International Cryptology Conference,USA, Vol. 1462 of Lecture Notes in Computer Science, pp. 200-211,Springer-Verlag, 1998. 108

[50] Knudsen L. and Mathiassen J.,"A Chosen-Plaintext Linear Attack On DES", Fast Software Encryption: 7th International workshop USA, Vol. 1978 of Lecture Notes in Computer Science, pp.262-272, Springer-Verlag, 2001.

[51] Keliher L., Meijer H., and Tavares S., "Improving the Upper Bound on the Maximum Average Linear Hull Probability for Rijndael", Selected Areas in Cryptography: 8th Annual International Workshop, Vol. 2259 of Lecture Notes in Computer Science, pp.112128, Springer-Verlag, 2001. [52] Keliher L., Meijer H., Tavares and S.,"New Method for Upper Bounding the Maximum Average Linear Hull Probability for SPNs", Advances in Cryptology-Eurocrypt 2001: International Conference on the Theory and Application of Cryptographic Techniques, Vol. 2045 of Lecture Notes in Computer Science, pp.420436 Springer-Verlag, 2001. [53] Keliher L., Meijer H., Tavares S.E., "Improving the Upper Bound on the Maximum Average Linear Hull Probability for Rijndael", in the proceedings of SAC 2001,Vol.2259 of Lecture Notes in Computer Science, pp. 112-128,Springer-Verlag, 2001.

[54] Park S., Sung H., Lee S., and Lim J.," Improving the Upper Bound on the Maximum Differential and Maximum Linear Hull Probability for SPN structures and AES", Fast software Encryption, 10th International Workshop, Vol. 2887 of Lecture Notes in Computer Science, Springer-Verlag, 2003.

109

[55] Biham E. and Keller N.," Cryptanalysis of Reduced Variants of Rijndael",Third AES Candidate Conference (AES3), New-York, 2000. [56] Cheon J., Kim M., Kim K., Lee J.-Y., and Kang S.," Improved

Impossible Differential Cryptanalysis of Rijndael and Crypton", Information Security and Cryptology -ICISC 2001: 4th International Conference, Vol. 2288 of Lecture Notes in Computer Science, pp.3949, Springer-Verlag, 2002. [57] Phan R.," Impossible Differential Cryptanalysis of 7-Rounds Advanced Encryption Standard (AES)", Information Processing Letters,No. 91,Vol.1,pp.33-38, 2004. [58] Ferguson N., Kelsey J., Lucks S., Schneier B., Stay M., Wagner D., and Whiting D.,"Improved Cryptanalysis of Rijndael", Fast Software Encryption: 7th International Workshop, Vol. 1978 of Lecture Notes in Computer Science, pp. 213-230, springer-Verlag, 2001. [59] Gilbert H. and Minier M.," A Collision Attack on Seven Rounds of Rijndael",Third AES Candidate Conference (AES3), New-York, 2000. [60] Lucks S.," Attacking Seven Rounds of Rijndael under 192- and 256-bit Keys", Third AES Candidate Conference (AES3), New-York, 2000. [61] Aoki K. and Vaudenay S.," On the Use of GF-inversion as a Cryptographic Primitive", In Selected Areas in Cryptography: 10th Annual International Workshop, Vol. 3006 of Lecture Notes in Computer Science,pp. 234-247 , springer-Verlag, 2004. 110

[62] Barkan E. and Biham E.," In How Many Ways Can You Write Rijndael?", Advances in Cryptology - Asiacrypt 2002: 8th International Conference on the Theory and Application of Cryptology and Information Security, Vol. 2501 of Lecture Notes in Computer Science,pp. 160-175, Springer-Verlag, 2002. [63] Courtois N. and Pieprzyk J.," Cryptanalysis of Block Ciphers with Over Defined Systems of Equations", Advances in Cryptology – Asia crypt 2002: 8th International Conference on the Theory and Application of Cryptology and Information Security, Vol.2501 of Lecture Notes in Computer Science, pp. 267-287, springer-Verlag, 2002. [64] Ferguson N., Schroeppel R., and Whiting D., "A Simple Algebraic Representation of Rijndael", Selected Areas in Cryptography: 8th Annual International Workshop, Vol. 2259 of Lecture Notes in Computer Science, pp.103-111, springer-Verlag, 2001. [65] Fuller J. and Millan W.," Linear Redundancy in S-boxes", Fast Software Encryption, 10th International Workshop, Vol.2887 of Lecture Notes in Computer Science, pp.12-19, springer-Verlag, 2003. [66] Murphy S. and Robshaw M.,"Essential algebraic structure within The AES", 22nd Annual International Cryptology Conference, Vol. 2442 of Lecture Notes in Computer Science, pp.1-16, springer-Verlag, 2002. [67] Mohammed A., Canagarajah C. N. and Bull D. R., "Video Coding for Mobile Communications", Academic Press, UK, 2002,

111

[68] Poynton C., "Digital Video and HDTV Algorithms and Interfaces", Morgan Kaufmann, 2003. [69] Gray R.M. and Neuhoff D. L., "Quantization". IEEE Transactions on Information Theory, Vol.44,No.6,pp.1-63, 1998. [70] Gonzalez R. C. and Woods R. E.," Digital Image Processing", 2nd edition, Printice Hall Inc, 2002. [71] Richardson I. E. G., "H.264 and MPEG-4 Video Compression Video Coding for Next-generation Multimedia", The Robert Gordon University, Aberdeen, UK, 2003. [72] Jack K.,"Video Demystified a Handbook for the Digital Engineer",4th edition, Elsevier Inc, 2005. [73] Richardson I. E. G., "Video Codec Design", The Robert Gordon University, Aberdeen, UK, 2002. [74] Li & Drew,"Fundamentals of Multimedia", Chapter 5, Prentice Hall 2003. [75] Kannangara,C.S, "Complexity Management of H.264/AVC Video Compression", Ph.D. Thesis; Robert Gordon University, UK, 2006.

[76] Westland S., "Models of the Visual System and Their Application to Image-Quality Assessment", presented at AIC Color 05 - 10th Congress of the International Color Association, Spain, 2005. [77] Mitchell J. L., Pennebaker W. B.,Chad E. Fogg, and LeGall D. J., "MPEG Video Compression Standard ",Kluwer Academic Publishers,New York, 2002.

112

[78] Ugla R. A., "Digital Video Compression Scheme Using Enhanced Fractal Coding "; Ph.D. Thesis; University of Technology, College of Science; 2009. [79] Miano J.,"Compressed Image File Formats", ACM Press, Massachusetts,1999. [80] ISO. Cd11172-2:"Coding of Moving Pictures and Associated Audio for Digital Storage Media at Up to About 1.5 mbits/s", 1991. [81] LeGall D. J.," MPEG: A Video Compression Standard for Multimedia Applications", Communications of the ACM, No.34,Vol.4,pp.46-58, 1991. [82] ISO-IEC/JTC1/SC29/WG11/N0802."Generic Coding of Moving Pictures and Associated Audio Information:Video", 1994. MPEG Draft Recommendation ITU-T H.262, ISO/IEC13818-2.

[83] Wen J., Villasenor J. D.,"Reversible Variable Length Codes for Efficient and Robust Image and Video Coding", Proceedings of the IEEE Data Compression Conference, pp. 471-480, Snowbird Utah, 1998. [84] Villasenor J., Zhang Y. Q., Wen J., "Robust Video Coding Algorithms and Systems", Special Issue of the Proceedings of the IEEE on Wireless Video, Vol. 87, No. 10, 1999. [85] German A. M., Gunsel B., Tekalp A. M., "Object Based Indexing of MPEG-4 Compressed Video", Proceedings of IST/SPIE Symposium on Electronic Imaging Vol. 3024, No.716, 1997. [86] Avaro O., Chou P. A., Eleftheriadis A., Herpel C., Cliff Reader, Signes J., "The MPEG-4 Systems and Description Languages: 113

a Way Ahead in Audio Visual Representation", Signal Processing Image Communication, Special Issue on MPEG-4, 1997.

[87] Chang S.F., Sikora T., and Puri A., "Overview of the MPEG-7 Standard", IEEE Transaction on circuits and system for video technology ,Vol.11,No.6,pp. 688 - 695 , 2001.

[88] Spanier J. R., Keane G., Hunter J. and Woods R., "Low Power Implementation of a Discrete Cosine Transform IP Core", Proc. DATE-2000, Paris, Mar. 2000. [89] Aggarwal G. and Gajski D., "Exploring DCT Implementations", UC Irvine Tech Report TR-98-10, Mar. 1998. [90] Rao K. R., Hwang J. J., "Techniques and Standards for Image, Video and Audio Coding", Prentice Hall, 1996.

[91] Omari A. H., Al-Kasasbeh B. M., Al-Qutaish R. E. and Muhairat M. I.,"DEA-RTA: A Dynamic Encryption Algorithm for the RealTime Applications", International Journal of computers, Vol.3, No.1, pp.191-199, 2009. [92] Dray J., "Report on the NIST Java AES Candidate Algorithm Analysis ", NIST, 1999. [93] Abd Elminaam D. S., Abdual Kader H. M., and Hadhoud M. M., "Evaluating the Performance of Symmetric Encryption Algorithms", International Journal of Network Security, Vol.10, No.3, PP.216-222, 2010.

114

Publication [1] Abdul Monem S. Rahma, and Basima Z.Yacob,"The Dynamic Dual Key Encryption Algorithm Based on joint Galois Fields", International Journal of Computer Science and Network Security, VOL.11 No.8, August 2011. http://paper.ijcsns.org/07_book/201108/20110828.pdf

[2] Abdul Monem S. Rahma, and Basima Z.Yacob," Using Dynamic Dual Keys Encryption Algorithm As Partial Encryption For A RealTime Digital Video", International Journal of Advances in Engineering & Technology – IJAET, VOL.2 Issue 1, January 2012. http://www.archives-ijaet.org/media/2I6-IJAET0612605.pdf [3] Abdul Monem S. Rahma , and Basima Z.Yacob," Real-time Partial Encryption of digital video using Symmetric Dynamic Dual keys Algorithm (SDD)",Accepted for publication in the Engineering and technology Journal in the next issue, ISSN 1681-6900.

115   

Appendix                                                                                                                  AES Code in Visual Basic    '-----------------------------------------------------------------------------------------------------------------'-----------------------------------AES Program In Visual Basic-------------------------------------'------------------------------------------ Module File------------------------------------------------------'-----------------------------------------------------------------------------------------------------------------'------------ Declaration Part -----------------Option Explicit Public Declare Function GetTickCount Lib "kernel32" () As Long Dim StartTime As Date Dim EndTime As Variant Dim ElapsedTime As Variant 'The number of rounds in AES Cipher. It is simply initiated to zero. The actual value is received in the program. Global Nr As Integer ' The number of 32 bit words in the key. It is simply initiated to zero. The actual value is received in the program. Global NK As Integer ' The number of columns comprising a state in AES. This is a constant in AES. Value=4 Global Nb As Integer ' in - it is the array that holds the plain text to be encrypted. ' out - it is the array that holds the key for encryption. ' state - the array that holds the intermediate results during encryption. Global in1(16) As Byte Global out(16) As Byte Global state(3, 3) As Byte 'The array that stores the round keys. Global RoundKey(240) As Byte 'As String ' The Key input to the AES Program Global Key(32) As Byte Global Rcon(254) As Byte Dim i As Integer : Dim stret, sttit, stmsg, stdefl As String I   

Appendix                                                                                                                  AES Code in Visual Basic    Global temp(31) As Byte, temp2(31) As Byte: Dim ss As Integer

'===============Procedures and functions===================== '------------ Create_Rcon -----------------Public Sub Create_Rcon() Rcon(0) = &H8D: Rcon(1) = &H1: Rcon(2) = &H2: Rcon(3) = &H4: Rcon(4) = &H8: Rcon(5) = &H10: Rcon(6) = &H20:Rcon(7) = &H40: Rcon(8) = &H80: Rcon(9) = &H1B: Rcon(10) = &H36: Rcon(11) = &H6C: Rcon(12) = &HD8: Rcon(13) = &HAB :Rcon(14) = &H4D: Rcon(15) = &H9A: Rcon(16) = &H2F: Rcon(17) = &H5E: Rcon(18) = &HBC: Rcon(19) = &H63: Rcon(20) = &HC6: Rcon(21) = &H97:Rcon(22) = &H35: Rcon(23) = &H6A: Rcon(24) = &HD4: Rcon(25) = &HB3: Rcon(26) = &H7D: Rcon(27) = &HFA:Rcon(28) = &HEF: Rcon(29) = &HC5: Rcon(30) = &H91: Rcon(31) = &H39: Rcon(32) = &H72: Rcon(33) = &HE4: Rcon(34) = &HD3: Rcon(35) = &HBD: Rcon(36) = &H61: Rcon(37) = &HC2: Rcon(38) = &H9F:Rcon(39) = &H25: Rcon(40) = &H4A: Rcon(41) = &H94: Rcon(42) = &H33: Rcon(43) = &H66: Rcon(44) = &HCC: Rcon(45) = &H83:Rcon(46) = &H1D: Rcon(47) = &H3A: Rcon(48) = &H74: Rcon(49) = &HE8: Rcon(50) = &HCB: Rcon(51) = &H8D: Rcon(52) = &H1:Rcon(53) = &H2: Rcon(54) = &H4: Rcon(55) = &H8: Rcon(56) = &H10: Rcon(57) = &H20: Rcon(58) = &H40: Rcon(59) = &H80:Rcon(60) = &H1B: Rcon(61) = &H36: Rcon(62) = &H6C: Rcon(63) = &HD8: Rcon(64) = &HAB: Rcon(65) = &H4D: Rcon(66) = &H9A:Rcon(67) = &H2F: Rcon(68) = &H5E: Rcon(69) = &HBC: Rcon(70) = &H63: Rcon(71) = &HC6:Rcon(74) = &H6A: Rcon(75) = &HD4: Rcon(76) = &HB3: Rcon(77) = &H7D: Rcon(78) = &HFA: Rcon(79) = &HEF:Rcon(80) = &HC5: Rcon(81) = &H91: Rcon(82) = &H39: Rcon(83) = &H72: Rcon(84) = &HE4: Rcon(85) = &HD3: Rcon(86) = &HBD:Rcon(87) = &H61: Rcon(88) = &HC2: Rcon(89) = &H9F: Rcon(90) = &H25: Rcon(91) = &H4A: Rcon(92) = &H94: Rcon(93) = &H33:Rcon(94) = &H66: Rcon(95) = &HCC: Rcon(96) = &H83: Rcon(97) = &H1D: Rcon(98) = &H3A: Rcon(99) = &H74:Rcon(100) = &HE8: Rcon(101) = &HCB: Rcon(102) = &H8D: Rcon(103) = &H1: Rcon(104) = &H2: Rcon(105) = &H4:Rcon(106) = &H8: Rcon(107) = &H10: Rcon(108) = &H20: Rcon(109) = &H40: Rcon(110) = &H80: Rcon(111) = &H1B:Rcon(112) = &H36: Rcon(113) = &H6C: Rcon(114) = HD8:Rcon(115) = &HAB: Rcon(116) = &H4D: Rcon(117) = &H9A: Rcon(118) = &H2F: Rcon(119) = &H5E: Rcon(120) = &HBC: Rcon(121) = &H63: Rcon(122) = &HC6: Rcon(123) = &H97: Rcon(124) = &H35: Rcon(125) = &H6A: Rcon(126) = &HD4: Rcon(127) = &HB3: Rcon(128) = &H7D: Rcon(129) = &HFA: Rcon(130) = &HEF:Rcon(131) = &HC5: Rcon(132) = &H91: Rcon(133) = &H39: Rcon(134) = &H72: Rcon(135) = &HE4: Rcon(136) = &HD3: Rcon(137) = &HBD:Rcon(138) = &H61: Rcon(139) = &HC2: Rcon(140) = &H9F: Rcon(141) = &H25: Rcon(142) = &H4A: Rcon(143) = H94:Rcon(144) = &H33: Rcon(145) = &H66: Rcon(146) = &HCC: Rcon(147) = &H83: Rcon(148) = &H1D: Rcon(149) = &H3A:Rcon(150) = &H74: Rcon(151) &HCB: Rcon(153) = &H8D: Rcon(154) = &H1: Rcon(155) = &H2: Rcon(156) = &H4:Rcon(157) = &H8: Rcon(158) = &H10: Rcon(159) = &H20: Rcon(160) = &H40: Rcon(161) = &H80: Rcon(162) = &H1B:Rcon(163) = &H36: Rcon(164) = &H6C: Rcon(165) = &HD8 Rcon(166) = &HAB: Rcon(167) = &H4D: Rcon(168) = &H9A: Rcon(169) = H2FRcon(170) = &H5E: Rcon(171) = &HBC: Rcon(172) = &H63: Rcon(173) = &HC6: Rcon(174) = &H97: Rcon(175) = &H35:Rcon(176) = &H6A: Rcon(177) = &HD4: Rcon(178) = &HB3: Rcon(179) = &H7D: Rcon(180) = &HFA: Rcon(181) = &HEF: Rcon(184) = &H39: Rcon(185) = &H72: Rcon(186) = &HE4: Rcon(187) = &HD3: Rcon(188) = &HBD: Rcon(189) = &H61:Rcon(190) = &HC2: Rcon(191) = &H9F: Rcon(192) = &H25: Rcon(193) = &H4A: Rcon(194) = &H94: Rcon(195) = &H33: Rcon(196) = &H66:Rcon(197) = &HCC: Rcon(198) = II   

Appendix                                                                                                                  AES Code in Visual Basic    &H83: Rcon(199) = &H1D: Rcon(200) = &H3A: Rcon(201) = &H74: Rcon(202) = &HE8: Rcon(203) = HCBRcon(204) = &H8D: Rcon(205) = &H1: Rcon(206) = &H2: Rcon(207) = &H4: Rcon(208) = &H8: Rcon(209) = &H10: Rcon(210) = &H20:Rcon(211) = &H40: Rcon(212) = &H80: Rcon(213) = &H1B: Rcon(214) = &H36: Rcon(215) = &H6C: Rcon(216) = &HD8: Rcon(217) = &HAB:Rcon(218) = &H4D: Rcon(219) = &H9A: Rcon(220) = &H2F: Rcon(221) = &H5E: Rcon(222) = &HBC: Rcon(223) = &H63:Rcon(224) = &HC6: Rcon(225) = &H97: Rcon(226) = &H35: Rcon(227) = &H6A: Rcon(228) = &HD4: Rcon(229) = &HB3: Rcon(230) = &H7D:Rcon(231) = &HFA: Rcon(232) = &HEF: Rcon(233) = &HC5: Rcon(234) = &H91: Rcon(235) = &H39: Rcon(236) = &H72: Rcon(237) = &HE4:Rcon(238) = &HD3: Rcon(239) = &HBD: Rcon(240) = &H61:Rcon(241) = &HC2: Rcon(242) = &H9F: Rcon(243) = &H25: Rcon(244) = &H4A: Rcon(245) = &H94: Rcon(246) = &H33: Rcon(247) = &H66:Rcon(248) = &HCC: Rcon(249) = &H83: Rcon(250) = &H1D: Rcon(251) = &H3A: Rcon(252) = &H74: Rcon(253) = &HE8: Rcon(254) = &HCB End Sub '------------ getSBoxValue -----------------Function getSBoxValue(num As Byte) As Integer Dim sbox(255) As Integer '0

1 2

3

4 5

6

7

8 9

A

B C

D

E

F

sbox(0) = &H63: sbox(1) = &H7C: sbox(2) = &H77: sbox(3) = &H7B: sbox(4) = &HF2: sbox(5) = &H6B: sbox(6) = &H6F: sbox(7) = &HC5: sbox(8) = &H30: sbox(9) = &H1: sbox(10) = &H67: sbox(11) = &H2B: sbox(12) = &HFE: sbox(13) = &HD7: sbox(14) = &HAB: sbox(15) = &H76: sbox(16) = &HCA: sbox(17) = &H82: sbox(18) = &HC9: sbox(19) = &H7D: sbox(20) = &HFA: sbox(21) = &H59: sbox(22) = &H47: sbox(23) = &HF0: sbox(24) = &HAD: sbox(25) = &HD4: sbox(26) = &HA2: sbox(27) = &HAF sbox(28) = &H9C: sbox(29) = &HA4: sbox(30) = &H72: sbox(31) = &HC0: sbox(32) = &HB7: sbox(33) = &HFD: sbox(34) = &H93: sbox(35) = &H26: sbox(36) = &H36: sbox(37) = &H3F: sbox(38) = &HF7: sbox(39) = &HCC: sbox(40) = &H34: sbox(41) = &HA5: sbox(42) = &HE5: sbox(43) = &HF1: sbox(44) = &H71: sbox(45) = &HD8: sbox(46) = &H31: sbox(47) = &H15: sbox(48) = &H4: sbox(49) = &HC7: sbox(50) = &H23: sbox(51) = &HC3: sbox(52) = &H18: sbox(53) = &H96: sbox(54) = &H5: sbox(55) = &H9A: sbox(56) = &H7: sbox(57) = &H12: sbox(58) = &H80: sbox(59) = &HE2: sbox(60) = &HEB: sbox(61) = &H27: sbox(62) = &HB2: sbox(63) = &H75: sbox(64) = &H9: sbox(65) = &H83: sbox(66) = &H2C: sbox(67) = &H1A: sbox(68) = &H1B: sbox(69) = &H6E: sbox(70) = &H5A: sbox(71) = &HA0: sbox(72) = &H52: sbox(73) = &H3B: sbox(74) = &HD6: sbox(75) = &HB3: sbox(76) = &H29: sbox(77) = &HE3: sbox(78) = &H2F: sbox(79) = &H84: sbox(80) = &H53: sbox(81) = &HD1: sbox(82) = &H0: sbox(83) = &HED: sbox(84) = &H20: sbox(85) = &HFC: sbox(86) = &HB1: sbox(87) = &H5B: sbox(88) = &H6A: sbox(89) = &HCB: sbox(90) = &HBE: sbox(91) = &H39: sbox(92) = &H4A: sbox(93) = &H4C: sbox(94) = &H58: sbox(95) = &HCF: sbox(96) = &HD0: sbox(97) = &HEF: sbox(98) = &HAA: sbox(99) = &HFB: sbox(100) = &H43: sbox(101) = &H4D: sbox(102) = &H33: sbox(103) = &H85: sbox(104) = &H45: sbox(105) = &HF9: sbox(106) = &H2: sbox(107) = &H7F: sbox(108) = &H50: sbox(109) = &H3C: sbox(110) = &H9F: sbox(111) = &HA8: sbox(112) = &H51: sbox(113) = &HA3: sbox(114) = &H40: sbox(115) = &H8F: sbox(116) = &H92: sbox(117) = &H9D: sbox(118) = &H38: sbox(119) = &HF5: sbox(120) = &HBC: sbox(121) = &HB6: sbox(122) = &HDA: sbox(123) = &H21: sbox(124) = &H10: sbox(125) = &HFF: sbox(126) = &HF3: sbox(127) = &HD2: sbox(128) = &HCD: sbox(129) = &HC: sbox(130) = &H13: sbox(131) = &HEC: sbox(132) = &H5F: sbox(133) = &H97: sbox(134) = &H44: III   

Appendix                                                                                                                  AES Code in Visual Basic    sbox(135) = &H17: sbox(136) = &HC4: sbox(137) = &HA7: sbox(138) = &H7E: sbox(139) = &H3D: sbox(140) = &H64: sbox(141) = &H5D: sbox(142) = &H19: sbox(143) = &H73: sbox(144) = &H60: sbox(145) = &H81: sbox(146) = &H4F: sbox(147) = &HDC: sbox(148) = &H22: sbox(149) = &H2A: sbox(150) = &H90: sbox(151) = &H88: sbox(152) = &H46: sbox(153) = &HEE: sbox(154) = &HB8: sbox(155) = &H14: sbox(156) = &HDE: sbox(157) = &H5E: sbox(158) = 11: sbox(159) = &HDB: sbox(160) = &HE0: sbox(161) = &H32: sbox(162) = &H3A: sbox(163) = &HA: sbox(164) = &H49: sbox(165) = &H6: sbox(166) = &H24: sbox(167) = &H5C: sbox(168) = &HC2: sbox(169) = &HD3: sbox(170) = &HAC: sbox(171) = &H62: sbox(172) = &H91: sbox(173) = &H95: sbox(174) = &HE4: sbox(175) = &H79: sbox(176) = &HE7: sbox(177) = &HC8: sbox(178) = &H37: sbox(179) = &H6D: sbox(180) = &H8D: sbox(181) = &HD5: sbox(182) = &H4E sbox(183) = &HA9: sbox(184) = &H6C: sbox(185) = &H56: sbox(186) = &HF4: sbox(187) = &HEA: sbox(188) = &H65: sbox(189) = &H7A: sbox(190) = 174: sbox(191) = &H8 sbox(192) = &HBA: sbox(193) = &H78: sbox(194) = &H25: sbox(195) = &H2E: sbox(196) = &H1C: sbox(197) = &HA6: sbox(198) = &HB4: sbox(199) = &HC6: sbox(200) = &HE8: sbox(201) = &HDD: sbox(202) = &H74: sbox(203) = &H1F: sbox(204) = &H4B: sbox(205) = &HBD: sbox(206) = 139: sbox(207) = &H8A: sbox(208) = &H70: sbox(209) = &H3E: sbox(210) = &HB5: sbox(211) = &H66: sbox(212) = &H48: sbox(213) = &H3: sbox(214) = &HF6: sbox(215) = &HE: sbox(216) = &H61: sbox(217) = &H35: sbox(218) = &H57 sbox(219) = &HB9: sbox(220) = &H86: sbox(221) = &HC1: sbox(222) = &H1D: sbox(223) = &H9E: sbox(224) = &HE1: sbox(225) = &HF8: sbox(226) = &H98: sbox(227) = &H11: sbox(228) = &H69: sbox(229) = &HD9: sbox(230) = &H8E: sbox(231) = &H94: sbox(232) = &H9B: sbox(233) = &H1E: sbox(234) = &H87: sbox(235) = &HE9: sbox(236) = &HCE: sbox(237) = &H55: sbox(238) = &H28: sbox(239) = &HDF: sbox(240) = &H8C: sbox(241) = &HA1: sbox(242) = &H89: sbox(243) = &HD: sbox(244) = &HBF: sbox(245) = &HE6 sbox(246) = &H42: sbox(247) = 104: sbox(248) = &H41: sbox(249) = &H99: sbox(250) = &H2D: sbox(251) = &HF: sbox(252) = &HB0: sbox(253) = &H54: sbox(254) = &HBB: sbox(255) = &H16 getSBoxValue = sbox(num) End Function '------------ Temprory_Store_Key_InArrayTemp_PlanitextInTemp -----------------Public Sub Temprory_Store_Key_InArrayTemp_PlanitextInTemp _CopyintoKey_and_In_array() Nr = 128:Nb = 4:NK = Nr \ 32:Nr = NK + 6 temp(0) = &H2B: temp(1) = &H7E: temp(2) = &H15: temp(3) = &H16: temp(4) = &H28: temp(5) = &HAE:temp(6) = &HD2: temp(7) = &HA6: temp(8) = &HAB: temp(9) = &HF7: temp(10) = &H15: temp(11) = &H88: temp(12) = &H9: temp(13) = &HCF: temp(14) = &H4F: temp(15) = &H3C: temp2(0) = &H0: temp2(1) = &H11: temp2(2) = &H22: temp2(3) = &H33: temp2(4) = &H44: temp2(5) = &H55: temp2(6) = &H66: temp2(7) = &H77: temp2(8) = &H88: temp2(9) = &H99: temp2(10) = &HAA:temp2(11) = &HBB: temp2(12) = &HCC: temp2(13) = &HDD: temp2(14) = &HEE: temp2(15) = &HFF

' Copy the Key and PlainText For i = 0 To (NK * 4 - 1) IV   

Appendix                                                                                                                  AES Code in Visual Basic    Key(i) = temp(i) in1(i) = temp2(i) Next i End Sub ' MixColumns function mixes the columns of the state matrix '------------ MixColumns-----------------Public Sub MixColumns() Dim i As Integer Dim Tmp As Byte, Tm As Integer, t As Byte, tep As Double, st As String, y1 As Integer For i = 0 To 3 t = state(0, i) Tmp = state(0, i) Xor state(1, i) Xor state(2, i) Xor state(3, i) st = "state(0,i)=" & Hex(state(0, i)) & "state(1,i)= " & Hex(state(1, i)) & "state(2,i)=" & Hex(state(2, i)) & "state(3,i)= " & Hex(state(3, i)) st = "" Tm = state(0, i) Xor state(1, i) st = "state(0,i)=" & Hex(state(0, i)) & "state(1,i)= " & Hex(state(1, i)) Tm = Xtime(Tm) state(0, i) = state(0, i) Xor Tm Xor Tmp Tm = state(1, i) Xor state(2, i) Tm = Xtime(Tm) state(1, i) = state(1, i) Xor (Tm) Xor (Tmp) Tm = state(2, i) Xor state(3, i) Tm = Xtime(Tm) state(2, i) = state(2, i) Xor Tm Xor Tmp Tm = state(3, i) Xor t state(3, i) = state(3, i) Xor Tm Xor Tmp Next i End Sub V   

Appendix                                                                                                                  AES Code in Visual Basic    ' This function produces Nb(Nr+1) round keys. The round keys are used in each round 'to encrypt the states. '------------ KeyExpansion -----------------Public Sub KeyExpansion() Dim i, j As Integer Dim temp(3) As Byte, k As Byte, y1 As Integer, sum As String ' The first round key is the key itself. For i = 0 To (NK - 1) RoundKey(i * 4) = Key(i * 4) sum = sum & ": " & Hex(RoundKey(i * 4)) RoundKey(i * 4 + 1) = Key(i * 4 + 1) sum = sum & ": " & Hex(RoundKey(i * 4 + 1)) RoundKey(i * 4 + 2) = Key(i * 4 + 2) sum = sum & ": " & Hex(RoundKey(i * 4 + 2)) RoundKey(i * 4 + 3) = Key(i * 4 + 3) sum = sum & ": " & Hex(RoundKey(i * 4 + 3)) Next sum = "" Do While (i < (Nb * (Nr + 1))) For j = 0 To 3 temp(j) = RoundKey((i - 1) * 4 + j) sum = sum & ": " & Hex(temp(j)) Next j sum = "" If (i Mod NK = 0) Then '

// This function rotates the 4 bytes in a word to the left once.

'

// (a0,a1,a2,a3) becomes (a1,a2,a3,a0) '

// Function RotWord() k = temp(0) VI   

Appendix                                                                                                                  AES Code in Visual Basic    temp(0) = temp(1) temp(1) = temp(2) temp(2) = temp(3) temp(3) = k ' // Function Subword() temp(0) = getSBoxValue(temp(0)) sum = sum & " " & Hex(temp(0)) temp(1) = getSBoxValue(temp(1)) sum = sum & " " & Hex(temp(1)) temp(2) = getSBoxValue(temp(2)) sum = sum & " " & Hex(temp(2)) temp(3) = getSBoxValue(temp(3)) sum = sum & " " & Hex(temp(3)) Else If (NK > 6 And (i Mod NK = 4)) Then ' Function Subword() temp(0) = getSBoxValue(temp(0)) : temp(1) = getSBoxValue(temp(1)) temp(2) = getSBoxValue(temp(2)) : temp(3) = getSBoxValue(temp(3)) End If End If sum = "" RoundKey(i * 4 + 0) = RoundKey((i - NK) * 4 + 0) Xor temp(0) RoundKey(i * 4 + 1) = RoundKey((i - NK) * 4 + 1) Xor temp(1) RoundKey(i * 4 + 2) = RoundKey((i - NK) * 4 + 2) Xor temp(2) RoundKey(i * 4 + 3) = RoundKey((i - NK) * 4 + 3) Xor temp(3) i=i+1 Loop End Sub '------------ SubBytes -----------------VII   

Appendix                                                                                                                  AES Code in Visual Basic    ' The SubBytes Function Substitutes the values in the ' state matrix with values in an S-box. Public Sub SubBytes() Dim i As Integer, j As Integer, y3 As Integer For i = 0 To 3 For j = 0 To 3 state(i, j) = getSBoxValue(CByte(state(i, j))) Next j : Next i End Sub ' The ShiftRows() function shifts the rows in the state to the left. ' Each row is shifted with different offset. ' Offset = Row number. So the first row is not shifted. '------------ ShiftRows -----------------Public Sub ShiftRows() Dim temp As String, y2 As Integer ' Rotate first row 1 columns to left temp = state(1, 0) :

state(1, 0) = state(1, 1): state(1, 1) = state(1, 2)

state(1, 2) = state(1, 3):

state(1, 3) = temp

' Rotate second row 2 columns to left temp = state(2, 0):

state(2, 0) = state(2, 2): state(2, 2) = temp

temp = state(2, 1):

state(2, 1) = state(2, 3): state(2, 3) = temp

' Rotate third row 3 columns to left temp = state(3, 0):

state(3, 0) = state(3, 3): state(3, 3) = state(3, 2)

state(3, 2) = state(3, 1):

state(3, 1) = temp

End Sub '------------ PrintArray -----------------Public Sub PrintArray() Dim i As Integer, j As Integer, y1 As Integer : TempString = "" For i = 0 To 3 For j = 0 To 3 VIII   

Appendix                                                                                                                  AES Code in Visual Basic    TempString = TempString & " " & " " & Hex(state(i, j)) Next j TempString = TempString & vbNewLine Next i Form1.Lbl6 = TempString y1 = MsgBox("print array", vbInformation, " OK") End Sub '------------ SubWord -----------------Public Sub SubWord(Tmp() As Byte) Dim sbox(255) As Integer '0

1 2

3

4 5

6

7

8 9

A

B C

D

E

F

sbox(0) = &H63: sbox(1) = &H7C: sbox(2) = &H77: sbox(3) = &H7B: sbox(4) = &HF2: sbox(5) = &H6B: sbox(6) = &H6F : sbox(7) = &HC5: sbox(8) = &H30: sbox(9) = &H1: sbox(10) = &H67: sbox(11) = &H2B: sbox(12) = &HFE: sbox(13) = &HD7: sbox(14) = &HAB: sbox(15) = &H76: sbox(16) = &HCA: sbox(17) = &H82: sbox(18) = &HC9: sbox(19) = &H7D: sbox(20) = &HFA sbox(21) = &H59: sbox(22) = &H47: sbox(23) = &HF0: sbox(24) = &HAD: sbox(25) = &HD4: sbox(26) = &HA2: sbox(27) = &HAF: sbox(28) = &H9C: sbox(29) = &HA4: sbox(30) = &H72: sbox(31) = &HC0: sbox(32) = &HB7: sbox(33) = &HFD: sbox(34) = &H93: sbox(35) = &H26: sbox(36) = &H36: sbox(37) = &H3F: sbox(38) = &HF7: sbox(39) = &HCC: sbox(40) = &H34 sbox(41) = &HA5: sbox(42) = &HE5: sbox(43) = &HF1: sbox(44) = &H71: sbox(45) = &HD8: sbox(46) = &H31: sbox(47) = &H15: sbox(48) = &H4: sbox(49) = &HC7: sbox(50) = &H23: sbox(51) = &HC3: sbox(52) = &H18: sbox(53) = &H96: sbox(54) = &H5: sbox(55) = &H9A: sbox(56) = &H7: sbox(57) = &H12: sbox(58) = &H80: sbox(59) = &HE2: sbox(60) = &HEB: sbox(61) = &H27: sbox(62) = &HB2: sbox(63) = &H75: sbox(64) = &H9: sbox(65) = &H83: sbox(66) = &H2C: sbox(67) = &H1A: sbox(68) = &H1B: sbox(69) = &H6E: sbox(70) = &H5A: sbox(71) = &HA0: sbox(72) = &H52: sbox(73) = &H3B: sbox(74) = &HD6: sbox(75) = &HB3: sbox(76) = &H29: sbox(77) = &HE3: sbox(78) = &H2F: sbox(79) = &H84: sbox(80) = &H53: sbox(81) = &HD1: sbox(82) = &H0: sbox(83) = &HED: sbox(84) = &H20: sbox(85) = &HFC: sbox(86) = &HB1: sbox(87) = &H5B: sbox(88) = &H6A: sbox(89) = &HCB: sbox(90) = &HBE sbox(91) = &H39: sbox(92) = &H4A: sbox(93) = &H4C: sbox(94) = &H58: sbox(95) = &HCF: sbox(96) = &HD0: sbox(97) = &HEF: sbox(98) = &HAA: sbox(99) = &HFB: sbox(100) = &H43: sbox(101) = &H4D: sbox(102) = &H33: sbox(103) = &H85: sbox(104) = &H45: sbox(105) = &HF9: sbox(106) = &H2: sbox(107) = &H7F: sbox(108) = &H50: sbox(109) = &H3C: sbox(110) = &H9F: sbox(111) = &HA8: sbox(114) = &H40: sbox(115) = &H8F: sbox(116) = &H92: sbox(117) = &H9D: sbox(118) = &H38: sbox(119) = &HF5: sbox(120) = &HBC: sbox(121) = &HB6: sbox(122) = &HDA: sbox(123) = &H21: sbox(124) = &H10 sbox(125) = &HFF: sbox(126) = &HF3: sbox(127) = &HD2: sbox(128) = &HCD: sbox(129) = &HC: sbox(130) = &H13: sbox(131) = &HEC: sbox(132) = &H5F: sbox(133) = &H97: sbox(134) = &H44: sbox(135) = &H17: sbox(136) = &HC4: sbox(137) = &HA7: sbox(138) = &H7E: sbox(139) = &H3D: sbox(140) = &H64: sbox(141) = &H5D: sbox(142) = &H19: sbox(143) = &H73: sbox(144) = &H60: sbox(145) = &H81: sbox(146) = &H4F: sbox(147) = &HDC: sbox(148) = &H22: sbox(149) = &H2A: sbox(150) IX   

Appendix                                                                                                                  AES Code in Visual Basic    = &H90: sbox(151) = &H88: sbox(152) = &H46: sbox(153) = &HEE: sbox(154) = &HB8: sbox(155) = &H14: sbox(156) = &HDE: sbox(157) = &H5E: sbox(158) = 11: sbox(159) = &HDB: sbox(160) = &HE0: sbox(161) = &H32: sbox(162) = &H3A: sbox(163) = &HA: sbox(164) = &H49: sbox(165) = &H6: sbox(166) = &H24: sbox(167) = &H5C: sbox(168) = &HC2: sbox(169) = &HD3: sbox(170) = &HAC: sbox(171) = &H62: sbox(172) = &H91: sbox(173) = &H95: sbox(174) = &HE4: sbox(175) = &H79: sbox(176) = &HE7: sbox(177) = &HC8: sbox(178) = &H37: sbox(179) = &H6D: sbox(180) = &H8D: sbox(183) = &HA9: sbox(184) = &H6C: sbox(185) = &H56: sbox(186) = &HF4: sbox(187) = &HEA: sbox(188) = &H65: sbox(189) = &H7A: sbox(190) = 174: sbox(191) = &H8: sbox(192) = &HBA: sbox(193) = &H78: sbox(194) = &H25: sbox(195) = &H2E: sbox(196) = &H1C: sbox(197) = &HA6: sbox(198) = &HB4:sbox(199) = &HC6: sbox(200) = &HE8: sbox(201) = &HDD: sbox(202) = &H74: sbox(203) = &H1F: sbox(204) = &H4B: sbox(205) = &HBD: sbox(206) = 139: sbox(207) = &H8A:sbox(208) = &H70: sbox(209) = &H3E: sbox(210) = &HB5: sbox(211) = &H66: sbox(212) = &H48: sbox(213) = &H3: sbox(214) = &HF6: sbox(215) = &HE: sbox(216) = &H61: sbox(217) = &H35: sbox(218) = &H57: sbox(219) = &HB9: sbox(220) = &H86: sbox(221) = &HC1: sbox(222) = &H1D: sbox(223) = &H9E: sbox(224) = &HE1: sbox(225) = &HF8: sbox(226) = &H98: sbox(227) = &H11: sbox(228) = &H69: sbox(229) = &HD9: sbox(230) = &H8E:sbox(231) = &H94: sbox(232) = &H9B: sbox(233) = &H1E: sbox(234) = &H87: sbox(235) = &HE9 sbox(236) = &HCE: sbox(237) = &H55: sbox(238) = &H28: sbox(239) = &HDF: sbox(240) = &H8C: sbox(241) = &HA1: sbox(242) = &H89: sbox(243) = &HD: sbox(244) = &HBF: sbox(245) = &HE6: sbox(246) = &H42: sbox(247) = 104: sbox(248) = &H41: sbox(249) = &H99: sbox(250) = &H2D: sbox(251) = &HF: sbox(252) = &HB0: sbox(253) = &H54: sbox(254) = &HBB: sbox(255) = &H16 Tmp(0) = sbox(Tmp(0)): Tmp(1) = sbox(Tmp(1)): Tmp(2) = sbox(Tmp(2)): Tmp(3) = sbox(Tmp(3)) End Sub '------------ KeyExpansion -----------------Public Sub KeyExpansion_usingSubwordFunction() ' This function produces Nb(Nr+1) round keys. The round keys are used in each round 'to encrypt the states. Dim i, j As Integer Dim temp(3) As Byte, k As Byte, y1 As Integer ' The first round key is the key itself. For i = 0 To (NK - 1) RoundKey(i * 4) = Key(i * 4) RoundKey(i * 4 + 1) = Key(i * 4 + 1) RoundKey(i * 4 + 2) = Key(i * 4 + 2) RoundKey(i * 4 + 3) = Key(i * 4 + 3) Next ' All other round keys are found from the previous round keys. X   

Appendix                                                                                                                  AES Code in Visual Basic    Do While (i < (Nb * (Nr + 1))) For j = 0 To j - 1 temp(j) = RoundKey((i - 1) * 4 + j) Next If (i Mod NK = 0) Then '

// This function rotates the 4 bytes in a word to the left once.

'

// (a0,a1,a2,a3) becomes (a1,a2,a3,a0) '

// Function RotWord() k = temp(0): temp(0) = temp(1):

temp(1) = temp(2)

temp(2) = temp(3): temp(3) = k ' // SubWord() is a function that takes a four-byte input word and ' // applies the S-box to each of the four bytes to produce an output word. ' // Function Subword() SubWord (temp(3)) 'temp(0) = getSBoxValue(temp(0)) 'temp(1) = getSBoxValue(temp(1)) 'temp(2) = getSBoxValue(temp(2)) 'temp(3) = getSBoxValue(temp(3)) temp(0) = temp(0) ^ Rcon(i / NK) Else If (NK > 6 And (i Mod NK = 4)) Then ' Function Subword() Call SubWord(temp(3)) ' temp(0) = getSBoxValue(temp(0)) ' temp(1) = getSBoxValue(temp(1)) ' temp(2) = getSBoxValue(temp(2)) ' temp(3) = getSBoxValue(temp(3)) End If End If XI   

Appendix                                                                                                                  AES Code in Visual Basic    RoundKey(i * 4 + 0) = RoundKey((i - NK) * 4 + 0) Xor temp(0) RoundKey(i * 4 + 1) = RoundKey((i - NK) * 4 + 1) Xor temp(1) RoundKey(i * 4 + 2) = RoundKey((i - NK) * 4 + 2) Xor temp(2) RoundKey(i * 4 + 3) = RoundKey((i - NK) * 4 + 3) Xor temp(3) i=i+1 Loop End Sub '------------ Xtime -----------------Function Xtime(x As Integer) As Integer Dim y As Integer, z As Integer : Static count As Integer:y = x y = (y * &H2) :z = x If z >= &H80 Then z=1 Else z=0 End If z = ((z And 1) * &H1B) y = y Xor z If y > 256 Then y = y - 256 End If Xtime = y End Function

'------------ AddRoundKey -----------------Public Sub AddRoundKey(round As Integer) Dim i As Integer, j As Integer, y As Integer RoundKey(0) = &H2B: RoundKey(1) = &H7E: RoundKey(2) = &H15: RoundKey(3) = &H16: RoundKey(4) = &H28: RoundKey(5) = &HAE:RoundKey(6) = &HD2: RoundKey(7) = &HA6: RoundKey(8) = &HAB: RoundKey(9) = &HF7: RoundKey(10) = &H15: RoundKey(11) = XII   

Appendix                                                                                                                  AES Code in Visual Basic    &H88RoundKey(12) = &H9: RoundKey(13) = &HCF: RoundKey(14) = &H4F: RoundKey(15) = &H3C For i = 0 To 3 For j = 0 To 3 state(j, i) = (state(j, i)) Xor (RoundKey(round * Nb * 4 + i * Nb + j)) Next j: Next i End Sub '------------ getSBoxInvert -----------------Function getSBoxInvert(num As Byte) As Integer Dim rsbox(255) As Integer rsbox(0) = &H52: rsbox(1) = &H9: rsbox(2) = &H6A: rsbox(3) = &HD5: rsbox(4) = &H30: rsbox(5) = &H36: rsbox(6) = &HA5: rsbox(7) = &H38: rsbox(8) = &HBF: rsbox(9) = &H40: rsbox(10) = &HA3: rsbox(11) = &H9E: rsbox(12) = &H81: rsbox(13) = &HF3: rsbox(14) = &HD7: rsbox(15) = &HFB:: rsbox(16) = &H7C: rsbox(17) = &HE3: rsbox(18) = &H39: rsbox(19) = &H82 rsbox(20) = &H9B: rsbox(21) = &H2F: rsbox(22) = &HFF: rsbox(23) = &H87: rsbox(24) = &H34: rsbox(25) = &H8E: rsbox(26) = &H43: rsbox(27) = &H44: rsbox(28) = &HC4: rsbox(29) = &HDE: rsbox(30) = &HE9: rsbox(31) = &HCB: rsbox(32) = &H54: rsbox(33) = &H7B: rsbox(34) = &H94 rsbox(35) = &H32: rsbox(36) = &HA6: rsbox(37) = &HC2: rsbox(38) = &H23: rsbox(39) = &H3D: rsbox(40) = &HEE: rsbox(41) = &H4C: rsbox(42) = &H95: rsbox(43) = &HB: rsbox(44) = &H42: rsbox(45) = &HFA: rsbox(46) = &HC3: rsbox(47) = &H4E: rsbox(48) = &H8: rsbox(49) = &H2E: rsbox(50) = &HA1: rsbox(51) = &H66: rsbox(52) = &H28: rsbox(53) = &HD9:: rsbox(54) = &H24: rsbox(55) = &HB2: rsbox(56) = &H76: rsbox(57) = &H5B: rsbox(58) = &HA2: rsbox(59) = &H49: rsbox(60) = &H6D: rsbox(61) = &H8B: rsbox(62) = &HD1: rsbox(63) = &H25 :rsbox(64) = &H72: rsbox(65) = &HF8: rsbox(66) = &HF6: rsbox(67) = &H64: rsbox(68) = &H86: rsbox(69) = &H68: rsbox(70) = &H98: rsbox(71) = &H16: rsbox(72) = &HD4: rsbox(73) = &HA4:rsbox(74) = &H5C: rsbox(75) = &HCC: rsbox(76) = &H5D: rsbox(77) = &H65: rsbox(78) = &HB6: rsbox(79) = &H92: rsbox(80) = &H6C: rsbox(81) = &H70: rsbox(82) = &H48: rsbox(83) = &H50: rsbox(84) = &HFD: rsbox(85) = &HED: rsbox(86) = &HB9: rsbox(87) = &HAD: rsbox(88) = &H5E: rsbox(89) = &H15: rsbox(90) = &H46: rsbox(91) = &H57:rsbox(92) = &HA7: rsbox(93) = &H8D: rsbox(94) = &H9D: rsbox(95) = &H84: rsbox(96) = &H90: rsbox(97) = &HD8: rsbox(98) = &HAB: rsbox(99) = &H0: rsbox(100) = &H8C: rsbox(101) = &HBC: rsbox(102) = &HD3: rsbox(103) = &HA: rsbox(104) = &HF7: rsbox(105) = &HE4: rsbox(106) = &H58: rsbox(107) = &H5: rsbox(108) = &HB8: rsbox(109) = &HB3: rsbox(110) = &H45: rsbox(111) = &H6: rsbox(112) = &HD0: rsbox(113) = &H2C: rsbox(114) = &H1E: rsbox(115) = &H8F: rsbox(116) = &HCA: rsbox(117) = &H3F: rsbox(118) = &HF: rsbox(119) = &H2: rsbox(120) = &HC1: rsbox(121) = &HAF: rsbox(122) = &HBD: rsbox(123) = &H3: rsbox(124) = &H1: rsbox(125) = &H13: rsbox(126) = &H8A: rsbox(127) = &H6B: rsbox(128) = &H3A: rsbox(129) = &H91: rsbox(130) = &H11: rsbox(131) = &H41: rsbox(132) = &H4F: rsbox(133) = &H67: rsbox(134) = &HDC: rsbox(135) = &HEA: rsbox(136) = &H97: rsbox(137) = &HF2: rsbox(138) = &HCF: rsbox(139) = &HCE: rsbox(140) = &HF0: rsbox(141) = &HB4: rsbox(142) = &HE6: rsbox(143) = &H73: rsbox(144) = &H96: rsbox(145) = &HAC: rsbox(146) = &H74: rsbox(147) = &H22: rsbox(148) = &HE7: rsbox(149) = XIII   

Appendix                                                                                                                  AES Code in Visual Basic    &HAD: rsbox(150) = &H35: rsbox(151) = &H85: rsbox(152) = &HE2: rsbox(153) = &HF9: rsbox(154) = &H37: rsbox(155) = &HE8: rsbox(156) = &H1C: rsbox(157) = &H75: rsbox(158) = &HDF: rsbox(159) = &H6E:rsbox(160) = &H47: rsbox(161) = &HF1: rsbox(162) = &H1A: rsbox(163) = &H71: rsbox(164) = &H1D: rsbox(165) = &H29: rsbox(166) = &HC5: rsbox(167) = &H89: rsbox(168) = &H6F: rsbox(169) = &HB7: rsbox(170) = &H62: rsbox(171) = &HE: rsbox(172) = &HAA: rsbox(173) = &H18: rsbox(174) = &HBE: rsbox(175) = &H1B rsbox(176) = &HFC: rsbox(177) = &H56: rsbox(178) = &H3E: rsbox(179) = &H4B: rsbox(180) = &HC6: rsbox(181) = &HD2: rsbox(182) = &H79: rsbox(183) = &H20: rsbox(184) = &H9A: rsbox(185) = &HDB:rsbox(186) = &HC0: rsbox(187) = &HFE: rsbox(188) = &H78: rsbox(189) = &HCD: rsbox(190) = &H5A: rsbox(191) = &HF4:: rsbox(192) = &H1F: rsbox(193) = &HDD rsbox(194) = &HA8: rsbox(195) = &H33: rsbox(196) = &H88: rsbox(197) = &H7: rsbox(198) = &HC7: rsbox(199) = &H31: rsbox(200) = &HB1: rsbox(201) = &H12: rsbox(202) = &H10: rsbox(203) = &H59: rsbox(204) = &H27: rsbox(205) = &H80: rsbox(206) = &HEC: rsbox(207) = &H5F: rsbox(208) = &H60: rsbox(209) = &H51: rsbox(210) = &H7F: rsbox(211) = &HA9: rsbox(212) = &H19: rsbox(213) = &HB5: rsbox(214) = &H4A: rsbox(215) = &HD: rsbox(216) = &H2D: rsbox(217) = &HE5: rsbox(218) = &H7A: rsbox(219) = &H9F: rsbox(220) = &H93: rsbox(221) = &HC9:rsbox(222) = &H9C: rsbox(223) = &HEF: rsbox(224) = &HA0: rsbox(225) = &HE0: rsbox(226) = &H3B: rsbox(227) = &H4D: rsbox(228) = &HAE: rsbox(229) = &H2A rsbox(230) = &HF5: rsbox(231) = &HB0: rsbox(232) = &HC8: rsbox(233) = &HEB: rsbox(234) = &HBB: rsbox(235) = &H3C: rsbox(236) = &H83: rsbox(237) = &H53: rsbox(238) = &H99: rsbox(239) = &H61: rsbox(240) = &H17: rsbox(241) = &H2B: rsbox(242) = &H4: rsbox(243) = &H7E: rsbox(244) = &HBA: rsbox(245) = &H77: rsbox(246) = &HD6: rsbox(247) = &H26: rsbox(248) = &HE1: rsbox(249) = &H69: rsbox(250) = &H14: rsbox(251) = &H63: rsbox(252) = &H55: rsbox(253) = &H21: rsbox(254) = &HC: rsbox(255) = &H7D getSBoxInvert = rsbox(num) End Function '------------ InvSubBytes -----------------Public Sub InvSubBytes() Dim i As Integer, j As Integer, y3 As Integer For i = 0 To 3 For j = 0 To 3 state(i, j) = getSBoxInvert(CByte(state(i, j))) Next j Next i End Sub '------------ InvShiftRows -----------------Public Sub InvShiftRows() Dim temp As String, y2 As Integer ' Rotate first row 1 columns to right XIV   

Appendix                                                                                                                  AES Code in Visual Basic    temp = state(1, 3):

state(1, 3) = state(1, 2): state(1, 2) = state(1, 1)

state(1, 1) = state(1, 0): state(1, 0) = temp ' Rotate second row 2 columns to right temp = state(2, 0):

state(2, 0) = state(2, 2):

state(2, 2) = temp

temp = state(2, 1):

state(2, 1) = state(2, 3):

state(2, 3) = temp

' Rotate third row 3 columns to right temp = state(3, 0):

state(3, 0) = state(3, 1):

state(3, 2) = state(3, 3):

state(3, 1) = state(3, 2)

state(3, 3) = temp

End Sub '// Multiplty is a macro used to multiply numbers in the field GF(2^8) '#define Multiply(x,y) (((y & 1) * x) ^ ((y>>1 & 1) * xtime(x)) ^ ((y>>2 & 1) * xtime(xtime(x))) ^ ((y>>3 & 1) * xtime(xtime(xtime(x)))) ^ ((y>>4 & 1) * xtime(xtime(xtime(xtime(x)))))) Function Multiply(x As Integer, y As Integer) As Integer Dim z, z1, z2, z3, z4, z5 As Integer z1 = ((y And 1) * x) z2 = ((y \ 2) And 1) * Xtime(x) z3 = ((y \ 4) And 1) * (Xtime(Xtime(x))) z4 = ((y \ 8 And 1)) * (Xtime(Xtime(Xtime(x)))) z5 = ((y \ 16) And 1) * (Xtime(Xtime(Xtime(Xtime(x))))) z = z1 Xor z2 Xor z3 Xor z4 Xor z5 'we can edit this part If z > 255 Then z = z - 256 End If Multiply = z End Function '------------ InvMixColumns -----------------'// MixColumns function mixes the columns of the state matrix. Public Sub InvMixColumns() Dim Tmp As Byte, Tm As Integer, t As Byte, tep As Double, st As String, y1 As Integer XV   

Appendix                                                                                                                  AES Code in Visual Basic    Dim a As Integer, b As Integer, c As Integer, d As Integer For i = 0 To 3 a = state(0, i): b = state(1, i): c = state(2, i): d = state(3, i) state(0, i) = Multiply(a, &HE) Xor Multiply(b, &HB) Xor Multiply(c, &HD) Xor Multiply(d, &H9) state(1, i) = Multiply(a, &H9) Xor Multiply(b, &HE) Xor Multiply(c, &HB) Xor Multiply(d, &HD) state(2, i) = Multiply(a, &HD) Xor Multiply(b, &H9) Xor Multiply(c, &HE) Xor Multiply(d, &HB) state(3, i) = Multiply(a, &HB) Xor Multiply(b, &HD) Xor Multiply(c, &H9) Xor Multiply(d, &HE) Next i End Sub '// InvCipher is the main function that decrypts the CipherText. '------------ InvCipher----------------Public Sub InvCipher() Form1.Cls Dim i As Integer, j As Integer, round As Integer, y2 As Integer round = 0:

Nr = 10

Call AddRoundKey(Nr) ' // There will be Nr rounds. '// The first Nr-1 rounds are identical. '// These Nr-1 rounds are executed in the loop below. For round = Nr - 1 To 1 Step -1 Form1.Lbl6 = "the round no =" & round

Call InvShiftRows Call InvSubBytes Call AddRoundKey(round) Call InvMixColumns Next round XVI   

Appendix                                                                                                                  AES Code in Visual Basic    Call InvShiftRows Call InvSubBytes Call AddRoundKey(0) ' // The decryption process is over. ' // Copy the state array to output array. For i = 0 To 3 For j = 0 To 3 out(i * 4 + j) = state(j, i) Next j : Next i End Sub '------------ InvSubBytes -----------------Public Function InvSubBytes_test() As Byte Dim i As Integer, st As Byte, y3 As Integer st = getSBoxInvert(CByte(&HC8)) InvSubBytes_test = st End Function '------------ initialize from_Y_array -----------------Public Sub initilzestate_from_Y_array_EncryptPhoto() Dim y1 As Integer:Dim k As Integer :Dim d As Integer, i, j, c1, r1 As Integer Static c As Integer :Static R As Integer d = ((BMPInfo.biHeight - 1) * (BMPInfo.biWidth - 1)) \ 16 k=0 While (k < d) And (R = BMPInfo.biWidth - 1 Then c = 0:R = R + 1 Else c=c+1 End If Next i: Next j r1 = R: c1 = c Call cipher For j = 3 To 0 Step -1 For i = 3 To 0 Step -1 If c = 0 Then c = BMPInfo.biWidth – 1:R = R - 1 Else c=c-1 End If XXV   

Appendix                                                                                                                  AES Code in Visual Basic    y(R, c) = state(i, j) Next i:Next j R = r1:c = c1 Wend For i = (BMPInfo.biHeight - 1) To 0 Step -1 For j = 0 To (BMPInfo.biWidth - 1) y(i, j) = y(i, j) Xor Random(0, 250) Next j :Next i End Sub '------------Save YCrCb as Image Bitmap file-----------------Public Sub save_YCrC_bbmp(imgf As String, imgin As String) Dim fid As Integer, fi As Integer Dim i As Integer, j As Integer, md As Integer, n As Integer, y1 As Integer, k As Integer Dim pdblCounter As Double fi = FreeFile() Open imgin For Binary As #fi ' Read File Get #fi, , bmpfile Get #fi, , BMPInfo fid = FreeFile() Open imgf For Binary As #fid ' Write file Put #fid, , bmpfile Put #fid, , BMPInfo n = BMPInfo.biWidth If ((n Mod 4) 0) Then md = n Mod 4 md = 4 - md Else md = 0 End If XXVI   

Appendix                                                                                                                  AES Code in Visual Basic    For i = 0 To (BMPInfo.biHeight - 1) Step 1 k = (BMPInfo.biHeight - 1) - i + 1 For j = 0 To (BMPInfo.biWidth - 1) Step 1 Put #fid, , CByte(y(k, j)) Put #fid, , CByte(Cr(k, j)) Put #fid, , CByte(Cb(k, j)) Next j : Next i Close #fi Close #fid End Sub '------------Save RGB as Image Bitmap file-----------------Public Sub savefusedbmp(imgf As String) Dim fid As Integer Dim i As Integer, j As Integer, md As Integer, n As Integer Dim k As Integer, a As Integer, b As Integer, y As Integer fid = FreeFile() bmpfile.lngBitmapOffset = 54 BMPInfo.byBitCount = 24 BMPInfo.biPlanes = 1 BMPInfo.biSize = 40 BMPInfo.biSizeImage = (BMPInfo.biHeight * BMPInfo.biWidth) * 3 bmpfile.lngFileSize = ((BMPInfo.biHeight * BMPInfo.biWidth) * 3) + bmpfile.lngBitmapOffset BMPInfo.biXPelsPerMeter = 0 BMPInfo.biYPelsPerMeter = 0 Open imgf For Binary As #fid Put #fid, , bmpfile Put #fid, , BMPInfo n = BMPInfo.biWidth * 3 If ((n Mod 4) 0) Then XXVII   

Appendix                                                                                                                  AES Code in Visual Basic    md = n Mod 4 md = 4 - md Else md = 0 End If For i = 0 To (BMPInfo.biHeight - 1) Step 1 k = (BMPInfo.biHeight - 1) - i + 1 For j = 0 To (BMPInfo.biWidth - 1) Step 1 Put #fid, , CByte(b(k, j)) Put #fid, , CByte(G(k, j)) Put #fid, , CByte(R(k, j)) Next j: Next i Close #fid End Sub -----------------------------------------------------------------------------------------------------------------'-----------------------------------AES Program In Visual Basic-------------------------------------'------------------------------------------ Form File---------------------------------------------------------'-----------------------------------------------------------------------------------------------------------------'------------Encrypt and Decrypt Image -----------------Private Sub CmdEncryptPhoto_Click() Call Start_Time Display_infoFile "d:\i0.bmp " Create_RGB_Channels "d:\i0.bmp " CONVERT_RGB_INTO_YCbCr Call initilzestate_from_Y_array_EncryptPhoto 'read data from y channel and call Encryption Call save_YCrC_bbmp("d:\resultImageofAES\YCrCbEncryptionSysColorYCB.bmp ", "d:\i0.bmp ") Call CONVERT_YCbCr_INTO_RGB Call savergbbmp("d:\resultImageofAES\AfterEncryptionY_Channel_andSaveInRGBSys.bmp ", "d:\i0.bmp ") XXVIII   

Appendix                                                                                                                  AES Code in Visual Basic    Call End_Time Call Start_Time Call initilzestate_from_Y_array_decryptiontPhoto read data from y channel and call Decryption Call CONVERT_YCbCr_INTO_RGB Call savergbbmp("d:\resultImageofAES\AfterdcryptionY_Channel_andSaveInRGBSys.bmp ", "d:\i0.bmp ") Call End_Time End Sub '------------Encrypt Data -----------------Private Sub cmdEncryptData_Click() Dim R As Integer, i As Integer Call Temprory_Store_Key_InArrayTemp_PlanitextInTemp_CopyintoKey_and_In_array Call Create_Rcon Call AddRoundKey_InitilizeValue(0) Call SubBytes Call ShiftRows Call MixColumns Call KeyExpansion Call AddRoundKey(1) For i = 2 To 9 Call SubBytes Call ShiftRows Call MixColumns Call AddRoundKey(i) Next i Call SubBytes Call ShiftRows Call AddRoundKey(10) End Sub '------------Decrypt Data -----------------XXIX   

Appendix                                                                                                                  AES Code in Visual Basic   

Private Sub Cmddcry_Click() Print "array state before decryption" Call PrintArray Call InvCipher Form1.Cls Print " the values of state array after call invcipher" Call PrintArray End Sub

XXX   

‫كورتي‬ ‫ى‬ ‫ل ساليَن دوماھي َى تةكنيكا ظديووا ذمارةيى بشيَوةيةك َى بةرضاظ دھيَتة بكارئينان دبوار َ‬ ‫طةھاندن َى و تةلةفزيون َى‪ ,‬ظيّجا بةرفرةه بوونا مةزن دبازرطانيا ثةخش ّى نمرةيى دا ‪,‬‬ ‫دبيتة ئةطةر ّ‬ ‫ى خاستنا ثاراستنا مافيّت ديتنا فلميّت دھيّتة بةرضاف كرن بؤ خةلكى ‪ ,‬وةكى‬ ‫ثرسةكا بازرطانى ئةوذى ب كارئينانا ريّكيّت تةكنيكى ييّت كو بتن ّى ئةو كةس بشيّت وان‬ ‫فلما ببينن ئةويّت بةرامبةر ثارا بدةن‪ ,‬ضارةسةركرنا ظ ّى ضةند ّ‬ ‫ى ذى ئةو بوو ب‬ ‫كارئينانا سيستةم ّى كؤدكرن ّى )التشفير( ضنكى ئةظ ريّكة بتن ّى دةستويري ّى ددةتة خودان ّى‬ ‫ھةبوونا كليال كؤدكرن ّى ظان فلما بينيت ‪ ,‬ل ظ ّى خال ّى ناكؤكى ثةيدابوو دناظبةرا ثيّتظى‬ ‫بوونا كؤدكرنا نھيّنى بةرز بؤ وةختى و وان فلميّت دظيّت بھيّنة ثيشاندان دةم ّى بةروةخت‬ ‫دا وةكى نمايشيّت يارييّت وةرزشى‪ .‬ئةظ ّى ظةكؤلّيين ّى ضارةسةركرن ثيّشكيّش كر‬ ‫ئةوذى ب ريّكا تةكنيكا كؤدكرنا بةشى ) كؤدكرنا ثشكا طرنط ذ داتاييّت ظيديويا نمرةي ّى‪,‬‬ ‫ضنكى كيّمتر وةخت ث ّى دضيت(‪ ,‬ھةروةسا ثيّشنياركرنا خوارزميطةريا دووانة كليل ‪,‬‬ ‫سةرةراى ظ ّى ضةند ّ‬ ‫ى ئةظ تةكنيكة ثةيكةرسازيا فلمى دثاريّزيت‪ .‬خوارزميا ‪ SDD‬كليليَن‬ ‫دووانى بو ظةشارتنا كومةلةكا بتا ب قةباريَن جيا كو ثيَكھاتى بوون ذ ‪5,4,3‬يان ‪ 6‬بتا‬ ‫ى‬ ‫ى كليلكا ئيَكى كونترول كرنا قةبار َ‬ ‫ى كومةال دوماھي َى ‪ .‬كار َ‬ ‫وةك ثيَكھاتى يا دبوار َ‬ ‫‪n‬‬ ‫ى دوماھي َى) ‪ GF(2‬ھاتة‬ ‫ى ظةشارتنة‪ .‬بيردوزا جاليوس دبوار َ‬ ‫كومةال بتاية ويا دوو َ‬ ‫ظةشارتنى‬ ‫بكارئينان وةك خوارزمي بو ثروسيَن ھةذمارتن َى وليَكدان َى ‪ ,‬خوارزميا‬ ‫َ‬ ‫ياثيَشنيار كري دھيَتة ئةنجام دان د دةمةك َى طةلةك كورتدا ھةروةسا ثيّشنياركرنا‬ ‫خوارزميطةريا دووانة كليل‪ ,‬سةرةراى ظ ّى ضةند ّ‬ ‫ى ئةظ تةكنيكة ثةيكةرسازيا فلمى‬ ‫دثاريّزيت‪ .‬ھةرضةندة يا ديارة كو كؤدكرنا بةشى ب كارئينانا ‪ SDD ‬خيّراترو بلةزترة‬ ‫‪ 13‬جارا ذ كؤدكرنا ب كارئينانا ‪AES ‬و‪ 9‬جارا بؤ ظةكرنا كؤدى ب كارئينا ‪AES ‬‬ ‫ى ذ كليلكا دووانى وقةباريَن‬ ‫‪.‬وئاستةك َى باش ي َى ھةيى دذى دزين َى ذبةر ثيَكھاتنا و َ‬ ‫جولةيى ييَن ظةشارتن َى ‪ .‬دةستظةئينا كليلكا ظ َى تةكنيك َى طةلةك يا ب زةحمةتة بو نمونة‬ ‫ظةكرنا نامةكا ظةشارتى يا ثيَكھاتى ذ ‪128 ‬بت ثيدظى)‪ (8.86569157e+188‬ھةوالية‬ ‫ب كيَماسى و)‪ (7.91569097e+253‬بزيدةيى ‪ .‬بةراورد كرنةك دناظبةرا ‪ SDD‬و‬ ‫‪AES ‬ذالي ّى دةليظيّت زانينا كليليّت ظةكرنا كؤديّت ھةردووان بؤ نامةك ّى دريّذيا و ّ‬ ‫ى ‪128‬‬ ‫بت ‪ ,‬ھاتة ديتن كو ‪ SDD‬ثيّتظى ھذمارةكا مةزنترة يا كليال ذ ‪ AES‬ب ئةنداز ّ‬ ‫ى كيّمترين‬ ‫رادة ئةوذى ‪ 1.49589906e+98 ‬وزيّدةترين رادة ئةوذى ‪1.43336854e+293 ‬‬ ‫ذدةليظيّت زانينا كليال‪.‬‬

‫باش كرنا خوارزميطةري َى ك َود كرنا بةش ياظيديويا‬ ‫ھذماردار‬ ‫نامةيةكة ثيَشكيَشكرية بو جظاتا كؤليذا ثةروةردة ل زانكويا زاخو وةك ثشكةك ذ‬ ‫ثيَداويستييَن ب دةستفةئينانا ثالدكتورا ل زانستيَن كومثيوتةرى‬

‫ذالي َى‬

‫بـاسـمـة زرقـو يـعـقـوب‬ ‫بةكالوريوس – زانستى كومبيوتةر –زانكويا موصل‪1991-‬‬ ‫ماستة ر – زانستى كومبيوتةر–زانكويا دھـوك ‪2005 -‬‬

‫ب سةرثةرشتيا‬

‫ثروفيسور دكتـ َور عبد المنعم رحمة أبو طبيخ‬

‫‪ 2012‬زاينى‬

‫‪ 2712‬كوردى‬ ‫‪ 1433‬كوضى‬

‫الخالصة‬ ‫في السنوات األخيرة ‪ ،‬استخدمت تقنيات الفيديو الرقمية على نطاق واسع في مجال االتصاالت‬ ‫و التلفزيون والبث الفضائي‪.‬فالتوسع الكبير في تجارة البث الرقمي ‪ ،‬تستدعي حماية حقوق‬ ‫المشاھدة لالفالم المعروضة كقضية تجارية و ذلك باستخدام تقنيات امنية تسمح فقط للمخولين‬ ‫)الذين يدفعون تكاليف المشاھدة ( بمشاھدة االفالم ‪ .‬فكان الحل ھو استخدام التشفير النه لن‬ ‫يسمح بالمشاھدة اال لمالك مفتاح التشفير‪.‬وھنا ظھرالتعارض بين احتياج التشفير عالي السريه‬ ‫الى الزمن واالفالم التي يجب ان تعرض في الزمن الحقيقي كالعروض الخاصة بااللعاب‬ ‫الرياضية‪.‬‬ ‫ھذا البحث قدم الحل في تقنية التشفير الجزئي )تشفير الجزء المھم من البيانات للفيديو الرقمي‬ ‫النه اقل تكلفة في الوقت(واقتراح خوارزمية ثنائية المفاتيح ديناميكية متناظرة )‪ (SDD‬التي لھا‬ ‫عال من التعقيد‪ .‬باالضافة‬ ‫السرعة الكافية لتلبية متطلبات الزمن الحقيقي مع امتالكھا مستوى‬ ‫ٍ‬ ‫الى ذلك فأن ھذه التقنية تحافظ على ھيكلية الفلم‪.‬‬ ‫خوارزمية ‪ SDD‬تستخدم مفتاحين ثنائيين للتشفير و كذلك كتلة من البت ذات حجم متغير )‬ ‫ديناميكي( ‪ ،‬و يتم تفسير حجم كتلة البت ) ‪ 3‬او ‪4‬او ‪ 5‬او ‪ 6‬بت( كعنصر ينتمي الى نطاق‬ ‫الحقول المنتھية‪ .‬و يسمى المفتاح االول مفتاح التحكم يحدد حجم الكتلة المراد تشفيرھا بالبت )‬ ‫‪ 3‬او ‪ 4‬او ‪ 5‬او ‪ 6‬بت ( ‪ ،‬اما المفتاح الثاني فيستخدم في التشفير‪ ،‬و تستند العمليات الحسابية‬ ‫المستخدمة في الخوارزمية على نظرية جالويس الرياضية للحقول المنتھية ) ‪.GF(2‬‬ ‫ان خوارزمية التشفير المقترحة تحقق أفضل نتائج الوقت ‪،‬حيث ان التشفير الجزئي باستخدام‬ ‫‪ SDD‬اسرع بحوالي ‪ 13‬مرة من التشفير باستخدام ‪ AES‬و ‪ 9‬مرات من فك الشفرة‬ ‫عال من التعقيد لمقاومتھا الكبيرة للھجمات ‪ ،‬وذلك‬ ‫باستخدام ‪.AES‬وأنھا كذلك توفر مستوى ٍ‬ ‫الستخدامھا المفتاح الثنائي و كذلك الكتل الديناميكية للتشفير ‪ ،‬وبذلك سيكون من الصعب للغاية‬ ‫تخمين المفتاح‪ .‬فمثالً لفك رسالة مشفرة متكونة من ‪128‬بت فالمھاجم يحتاج‬ ‫الى‪ 8.86569157e+188‬من احتماالت المفاتيح كحد ادنى و ‪7.91569097e+253‬‬ ‫كحد أقصى ‪ .‬وان مقارنة بين‪ SDD‬و ‪ AES‬من ناحية عدد احتماالت المفاتيح التي يحتاجھا كل‬ ‫منھما لفك شفرة رسالة طولھا ‪ 128‬بت فوجد ان ‪ SDD‬تحتاج الى عدد اكبر من المفاتيح من‬ ‫‪ AES‬بمقدار الحد االدنى ھو ‪1.49589906e + 98‬والحد االعلى ھو ‪ 1.43336854e +‬‬ ‫‪293‬من احتماالت المفاتيح‪.‬‬

‫تـحـسيـن خـوارزمـيـة التـشـفـيـر الجـزئـي‬ ‫للـفـيـديـو الـرقـمي‬ ‫أطـروحـة‬ ‫مقدمة الى مجلس كلية التربية في جامعة زاخو وھي كجزء من متطلبات‬ ‫نيل شھادة دكتوراه فلسفة‬ ‫في‬ ‫علوم الحاسبات ‪ ‬‬ ‫‪ ‬‬ ‫‪ ‬‬

‫من قبل‬

‫باسـمـة زرقـو يعـقـوب‬ ‫بكالوريوس علوم الحاسبات‪ -‬جامعة الموصل – ‪1991‬‬ ‫ماجستير علوم الحاسبات – جامعة دھوك ‪2005 -‬‬

‫باشراف‬

‫أستاذ الدكتور عبد المنعم رحمة أبو طبيخ‬

‫‪2012‬م‬ ‫‪ ‬‬

‫‪ 1433‬ھـ ‪ ‬‬

Suggest Documents