Proceedings of IMCIC - ICSIT 2016
Maximum Period Non-Binary Key Sequence Generation for Image Encryption/Decryption Sudeepa K B, Research Scholar, Department of CSE, NMAMIT, Nitte, India,
[email protected] Dr. Ganesh Aithal , Research Dean, MITE, Mangalore, India,
[email protected]
ABSTRACT
ciphers and stream ciphers are common in use today. Application of Stream ciphers is more prominent in business and military to give security for the data transfer [9][10]. Security of stream cipher system depends on the randomness properties of the key sequence, algorithm used for encryption and length and its properties of generated key. Therefore key sequence generator is very important building block for stream cipher system. A random bit generator can be used to generate binary bit sequences with desirable statistical properties which are important in cryptographic applications [11].
The stream cipher is a binary cipher system if the operation of plain text and key is carried out bit by bit. The word by word operation of key and plain text is known as word oriented stream cipher system. The encryption / decryption operation can be performed on key and plain text where both are neither word nor binary or of the form 2 n is known as non binary non word oriented stream cipher system. This can be defined over any finite field GF (p) where p is prime integer and further extended over the ringܼ ܯ, where M is a composite integer.
Pseudo Random numbers are very useful from the long period especially in the area of cryptography. The pseudo random numbers are used as key in cryptographic operations. There are several techniques for the data exchange over the Internet; there is a need to meet several security factors such as authentication, confidentiality and data integrity and non repudiation. We need to take care of the unauthorized access and protection against active and passive attacks. This can be achieved by several ways.
The effectiveness of the non binary stream cipher system is based on different parameters mainly on encryption / decryption algorithm, also on key generation and its parameters. In this work, non binary non word oriented key sequence of maximum length is generated using feedback shift register of four stages. The generated key sequence is used in RNS based additive cryptosystem (encryption / decryption) and the effectiveness of maximum length key sequence on cipher systems is discussed. Keywords- Pseudo Random number, Residue Number System, Stream Cipher, Maximum Length Key Sequence, Linear Feedback Shift Register (LFSR), Non Binary Non Word oriented Key Sequence.
1) 2) 3) 4)
1. INTRODUCTION
5)
The information exchange over the public communication channel is increasing day by day, so it is very much essential to provide the security for sensitive and confidential data. One of the primary goals of the cryptographic systems (cryptosystems) is to help communicators to exchange their information securely. This goal is achieved by cryptographic applications and protocols. Transferring a message (plain text) to an incomprehensive form of cipher text is accomplished by a process known as encryption. In contrast, converting a cipher message to its original form is accomplished by a process known as decryption.
6)
Protecting the communication channel by the eavesdroppers. Protecting the data by eavesdroppers. Protection of instrument of communication Using a complex algorithm for the encryption and decryption Generating key such a way that process of regeneration becomes complex Long key sequence generation
A function of sequence of plain text (pi) is with key sequence (ki) to produce corresponding cipher text (ci) is called encryption algorithm, and inverse process to get pi back using the same key is called decryption algorithm in stream cipher. The additive stream cipher is the operation of plaintext and key with mod M addition, where M is an integer 0 Si and ki P, expressed as {cij}={{pij} {kij}} mod M. In case of a large integer M, the time taken for the evaluation will be large to reduce the time complexity it has been proposed a system in Ganesh et.al [13] , which uses residue number system (RNS) for the stream cipher with a inherent parallel structure. In Residue Number System (RNS) the plain text byte is converted in to n tuple plain text. Each of the tuple requires an encryption / decryption process. Therefore for each tuple should have corresponding key generator to support the encryption / decryption process. The efficiency of encryption is mainly depending upon encryption algorithm and key generation. In this paper the attempt has been made to generate pseudo random number sequence with maximum possible period (maximum length sequence). This helps the algorithm to get 6KDQQRQ¶V RQH WLPH SDG DV ZHOO DV WKH EXLOW LQ SDUDOOHO structure of RNS enhances the immunity to side channel attack [12].
Cryptography systems are mainly classified into Symmetric key-systems and Asymmetric key system. The symmetric systems such as DES[1], AES[2][3] and RC4[4] that uses same key for both encryption and decryption. Public or Asymmetric key systems such as RSA[5], E1,Gamal[6][7] and Elliptic curve cryptography[8] that uses different key for encryption and decryption. It uses public key and private key pair for encryption / decryption. Key announced publicly is called public key and key that only the recipient of the message uses is private key. Symmetric cryptosystems can be divided into block ciphers and stream ciphers. In block cipher, data is divided into blocks and operations are performed block wise with key, but in a stream cipher encryption / decryption operation is bit-by-bit, byte by byte, word by word or pixel by pixel. In binary stream cipher system, the encryption method is a function of binary plaintext and binary key to get binary cipher data. Both block
General model of image encryption based on residue number system using maximum length non binary sequence is shown in fig.1.1.
22
Proceedings of IMCIC - ICSIT 2016
Figure 2.1: Maximum length Key sequence Generator over Z3 Similarly the maximum length sequence for m = 5 is given by 624. This is achieved by the following feedback shift register given in figure 2.2 with a feedback function as in equation (3). ((Xo+X3)*3)%5 + ((X1+X3)*3)%5)%5
(3)
Figure 1.1 General model of Encryption/ Decryption The rest of the paper is organized as follows. In section II we introduce the algorithm to generate maximum length key sequence generator. The result is analyzed in section III. Section IV is conclusion.
2. Maximum Length Key Sequence Generator Figure 2.2: Maximum length Key sequence Generator over Z5 In the paper Ganesh et al. [13] the work on a non binary stream cipher system based on Residue Number System (RNS) is elaborated. The key generation is based on linear feedback shift registers. These generators are not having specific structure to get maximum length sequence to have highest security like one time pad. In this work we try to get a generator using linear feedback shift resisters. The example taken for the testing encryption and decryption is an image (standard image Lena with bmp Format ). As said earlier each pixel is converted in to an equivalent to a three tuple RNS with the RNS base as m1=3, m2=5 and m3=17 . in this case it is required to find the maximum length sequence for these numbers. The example in the next section shows the generation of maximum length sequence for these with 4 shift register. A.
The maximum length sequence with the integer 17 is presented in the figure 2.3, with a feedback function given by the equation (4). This gives the maximum length of 83520 sequence as per the equation (1). ((((X2+X0) %17)*11) + ((X1+X3) %17)*11))%17
(4)
Generation of maximum length key sequence using a conventional feedback shift register
To generate maximum key sequence, conventional Linear Feedback Shift Registers (LFSRs) are used. Maximum length (Lmax) Non binary sequence is given by the equation Lmax=mn-1. (1 ) Where m is an integer, n is number of shift registers used. In our computation n is arbitrarily taken as 4. For the sake of convenience m is taken as 3, 5 and 17, as it is taken in case of [13]. According to this equation (1) maximum period for the value 3 is calculated as 80. This can be achieved by using the following feedback shift register shown in figure 2.1, with the feedback function as given in the equation (2). (X0+X1) %3
Figure 2.3: Maximum length Key sequence Generator over Z17
(2)
B. Encryption based on RNS representation The plain text sequence {pi} is thus split into n component VHTXHQFHV ^SL SL«SLQ` )RU HDFK GHFRPSRVHG VWUHDP corresponding key sequence { NLNL«NLQ ` DUH JHQHUDWHG WR process with plain text component to get cipher text set{
23
Proceedings of IMCIC - ICSIT 2016
FLFL«FLQ`7KHHQFU\SWLRQDOJRULWKPVRIDGGLWLYHFLSKHUIRU decomposed n plain text components are defined as follows. a.
Additive Encryption Process
Cipher text {cij}=[{pij} {kij}] mod mj(5) :KHUHLUHSUHVHQWVWKHQXPEHURISODLQWH[WLHL « DQGMUHSUHVHQWVWKHFRPSRQHQWVLHM ««Q b.
Decryption Algorithm
Having received component of {cij} of cipher text blocks of n components, the decryption can also be done in parallel.The plain text sequence {rij} is recovered from the received cipher text and locally generated key sequences {-kij}. Plain text {pij}={cij} {-kij}mod mj
` ^FLM`Ĭ^kij}mod mj (6) L «DQGM «««Q
Fig 3.2: Cipher Image After getting the cipher text, using decryption algorithm mentioned in the section 2, will get the plain text back again. Histogram: The histogram is the number of occurrence of the
or { pij
pixel of plain text (original image) with respect to its value. This is plotted for both plain text and cipher text (encrypted image). The Histogram of original image and corresponding
With the above encryption and decryption algorithm and the maximum length sequence described in section 2(A), in this paper an image is encrypted. The following section shows the details of the visually analyzable results of encryption and decryption.
encrypted image is shown in figure 5.3 and figure 5.4. It is clear that the histogram of the encrypted image is almost uniformly distributed, and significantly different from the histogram of the original image. This implies the encrypted image cannot be
3. RESULTS AND ANALYSIS
attacked by any statistical attack. This makes the statistical
This section deals with two results that is based on 1.
Visual analysis
2.
Histogram
attacks difficult. The pixel information is split into three parts, as per the concept of residue number system. Since these three operations are carry free operations indicating inherent parallel operations. Thus the operation of encryption and decryption are
Visual analysis: The figures 3.1 and 3 .2 shows the detail of the
made faster, by encrypting and decrypting the image pixel split
plain image and cipher image respectively. By visual
into components and operated in parallel. This process of
observation of these two figures it is evident that, there is no
parallel encryption and decryption decreases the time
residue of the image is visible in the encrypted Image. In this
complexity and also limits the side channel attack [12].
H[DPSOH D VWDQGDUG PRQRFKURPH LPDJH µ/HQD¶ LV WDNHQ (DFK pixel is of 8 bit which is converted in to an equivalent RNS of three tuple. Each tuple is encrypted based on the algorithm mentioned in section 2.
Figure 3.1: Plain image
Figure 5.3(a) Histogram plain image and (b) of the additive cipher system with three tuple CRT number with m1=3, m2=5, m3=17 and the initial values of feedback shift registers are [1, 0, 1, 2], [2, 1, 4, 3] and [2, 3,1, 4] for key generator shown in figure 2.1, 2.2 and 2.3 respectively.
4. CONCLUSION
24
Proceedings of IMCIC - ICSIT 2016
The main aim of the paper is to get a maximum length sequence
of Information Security, Institute of Software,
using a feedback shift register for a non binary non word
Academy
oriented integers. This is achieved in the section 2 with the
{zyb,feng}@is.iscas.ac.c
details of the feedback shift register. Further it has been used in
[13].
an encryption and decryption process using residue number
Implementation
system. The processes of cryptography uses a sequence which
5HSUHVHQWDWLRQ RI ,QWHJHUV ,Q 5HVLGXH 1XPEHU 6\VWHP´
is having maximum length this can be shown that it is
IEEE, pp 211 to 213.
theoretically secure [14]. Two evidences of encrypted image and its histograms, shows clearly this method can be efficiently used for cryptographic process. As mentioned earlier both statistical and side channel attacks can be decreased by employing this method of encryption.
REFERENCES: [1]. Barker, W. Introduction to the Analysis of the Data Encryption Standard (DES). Laguna Hills, CA: Aegean Park Press, 1991. >@ 'DHPHQ - DQG 5LMPHQ 9 ³5LMQGDHO 7KH DGYDQFHG (QFU\SWLRQ6WDQGDUG´'U'REE¶V-RXUQDO0DUFK [3]. ] Daemen, J., and Rijmen, V. The Design of Rijndael: The Wide Trail Strategy Explained. New York: Springer-Verlag. [4]. Robshaw, M. Block Ciphers. RSA Laboratories Technical Report
TR-601,
August
1995.
http://www.rsasecurity.com/rsalabs. >@ 5LYHVW 5 6KDPLU $ DQG $GOHPDQ / ³$ PHWKRG IRU obtaining Digital SignDWXUHV DQG 3XEOLF NH\ &U\SWRV\VWHPV´ Communications of the ACM, February 1978. >@(OJDPDO7³$3XEOLF.H\&U\SWRV\VWHPDQGD6LJQDWXUH 6FKHPH %DVHG RQ 'LVFUHWH /RJDULWKPV´ 3URFHHGLQJV &U\SWR 84, 1984. >@(OJDPDO7³$3XEOLF.H\ &U\SWRV\VWHPDQd a Signature 6FKHPH %DVHG RQ 'LVFUHWH /RJDULWKPV´ ,((( 7UDQVDFWLRQ RQ information theory, July 1985. >@)HUQDGHV $³(OOLSWLF&XUYH&U\SWRJUDSK\´ 'U'REE¶V Journal, December 1999. [9]. William Stallings, Cryptography and Network Security, Principles and Practice, 5th Edition, Pearson Education Inc, 2006. >@ 5DLQHU $5XHSSHO ´6WUHDP FLSKHUV´ 7KH 6FLHQFH RI Information Integrity, IEEE press, New York,1992. [11]. Ramesh S, K N Haribhat, R MurDOL ³2Q /LQHDU Complexity of Binary Sequences Generated Using Matrix 5HFXUUHQFH5HODWLRQ'HILQHG2YHU=´,QWHUQDWLRQDO-RXUQDORI Distributed and Parallel Systems (IJDPS), Vol.1, No.2, November 2010. >@