• No results found

Pixels Sequences Encryption of Image Based on Random Matrixes and Element by element Matrix Operations in MATLAB

N/A
N/A
Protected

Academic year: 2020

Share "Pixels Sequences Encryption of Image Based on Random Matrixes and Element by element Matrix Operations in MATLAB"

Copied!
5
0
0

Loading.... (view fulltext now)

Full text

(1)

2016 Joint International Conference on Artificial Intelligence and Computer Engineering (AICE 2016) and International Conference on Network and Communication Security (NCS 2016)

ISBN: 978-1-60595-362-5

Pixels Sequences Encryption of Image Based on Random Matrixes and

Element-by-element Matrix Operations in MATLAB

Xi-Kun LIANG

1,a*

, Zheng-Zheng ZHU

2,b

1Hangzhou Institute of Service Engineering, Hangzhou Normal University,

Hangzhou, 310012, China

2Department of International Trade of Zhejiang Economy and Trade Polytechnic,

Hangzhou, 310018, China

a[email protected], b[email protected]

*Corresponding author

Keywords: The Element-by-Element Matrix Operations, Pixels Sequences Encryption, Random Matrixes, Key Stream, MATLAB.

Abstract. Both the random matrixes generated by MATLAB and the element-by-element matrix operations in MATLAB are proposed to construct the pixels sequences encryption algorithm of Images. The random matrixes which obey the uniform distribution or normal distribution are used to generate the key stream. By running the element-by-element matrix multiplication and division between the pixels matrix and the key matrix, the sequences of pixels are encrypted and decrypted. This algorithm shows such advantages as good security, simple calculation, and easy availability for programming. Furthermore, the feasibility and stability of the algorithm are demonstrated by experiments.

Introduction

Pixels sequences encryption, which is also known as pixels gray encryption, is to alter the gray values of the pixels while the pixels' locations are kept. Correspondingly, scrambling encryption of image refers to transform only the positions of the pixels. The third type of image encryption is called hybrid encryption. Which means both the coordinates and the gray values are altered. In general, gray encryption is better than simple scrambling encryption in terms of security. Although hybrid techniques exhibit greater security than the first two, its calculation is often the most complicate among the three.

So far, many academic achievements have been obtained in hybrid image encryption. Guan et al[1] suggested a hybrid algorithm using a chaotic sequences. Zhu et al[2] used the diffused transformation of the sequences to encrypt the given image. Tong and Cui[3] proposed a composite chaotic encryption method based on cycling shift operations and sequences encryption. Wei et al[4] put forward DNA encryption techniques on the basis of DNA encoding. Using Arnold transformation, Kanso and Ghebleh[5] established a chaotic encryption plan to encrypt color images. Using the dynamic key stream and RC4[6] algorithm, Sasidharan and Philip[7] put forward a hybrid encryption technique. Using discrete cosine transform, Ahmad et al[8] gave a multilayer and blocked scrambling scheme.

(2)

Random Matrices and Element-by-Element Matrix Operations Random Matrices

The uniform distribution matrix in the interval [0,1] and the matrix with the standard normal distribution are the common random matrices used in MATLAB. They can be generated by the internal functions defined in advance. By means of the transform y  a (b a x) , a uniform distribution random matrix can be obtained in the arbitrary interval[ , ]a b , where the random variable

xsatisfies the uniform distribution in the interval[0,1] . Similarly, the formulay 

 

x can be used to generate the random numbers with the mean and variance of and2respectively, where

xobeys the standard normal distribution.

Element-by-Element Matrix Operations

The element-by-element matrix operations are not common outside of MATLAB. The premise of element-by-element operations is that the two matrices involved in the computation should have the same dimensions. Common element-by-element operations include element-by-element multiplication, element-by-element division, and element-by-element exponentiation. They are expressed in MATLAB by the symbols .*, ./, and .^respectively.

Letting A( )aij m n ,B( )Bij m n , the definition of element-by-element multiplication and

element-by-element division can be given by the following two formulas respectively. .* ( * )ij ij m n

A Ba b , . /A B(aij/ )bij m n

Analogously, element-by-element exponentiation is denoted as follows. . ^ (( ) )k ,

ij m n

A ka kN, . ^ (A  k) (1/ ( ) )aij k m n ,kN

It is necessary to emphasize that the element-by-element addition and subtraction are not defined in MATLAB. Actually, they are the same as the common matrix addition and subtraction respectively.

Key Stream Generation and Image Sequences Encryption Key Stream Generation

The random matrix generated by the internal functions of MATLAB is used as the key to sequences encryption. Usually, the matrix satisfies the uniform distribution in the interval [ , ]a b or

obeys the standard normal distribution with the mean and variance ofand2respectively. In the practice of encryption, the dimension of the key matrix depends on the size of the unencrypted image. Since this kind of key is single-use, a good security for the corresponding encryption scheme is thus ensured.

Image Sequences Encryption Based on the Element-by-Element Matrix Operations

Supposing the gray matrix defined on the set of D[1, ] [1, ]m n is P0( )pij m n , encryption and

decryption can be implemented with the element-by-element operations between the gray matrix and the random matrices.

Setting the random matrix sequences generated by MATLAB asM M1, 2, , Mk, formula (1) gives

(3)

1 0 1

2 1 2 0 1 2

1 0 1 2

.*

.*

.*

.*

.*

.*

.*

.* .*

k k k k

P

P

M

P

P

M

P

M

M

P

P

M

P

M

M

M

   (1)

On the other hand, the decryption can be implemented by the inverse operation of formula (1). This step is demonstrated in formula (2).

0 1 1

1 2 2 0 1 2

1 0 1 2

. /

. / . / . /

. / . / . / . / . /

k k k k

P P M

P P M P M M

P P M P M M M

         (2)

When M1M2   MkM, the formulas (1) and (2) will evolve as follows.

1 0.* , 2 0.*( . ^ 2), , k 0.*( . ^ )

PP M PP MPP M k (3)

0 1.*( . ^ ( 1)), 1 0.*( . ^ ( 2)), , k 1 0.*( . ^ ( ))

PP MPP M   PP Mk (4)

Encryption and Decryption Algorithm

Given the original imageI0, suppose the image gray matrix isP0( )pij m n . On the basis of the

operations mentioned above, we designed a sequences encryption and decryption algorithm of image. It can be summarized as follows.

 Using the internal functions defined in MATLAB to generate the random matrix

M

with the size of m n .

 Running the common matrix addition between P0and

M

as the following formula.

1 0 *

P  P x M (5)

Where the variablexis an arbitrary nonzero natural number. It is considered as one of the optional keys. P1is the preliminary encrypted gray matrix.

 Implementing the following operations based on P1.

2 1.*(( ). ^ )

PP M y (6)

Where the variabley is also a nonzero natural number. It can be selected as the other key

parameter. P2is the final encrypted gray image.

 Based on the formulas (5) and (6), the decrypted image can be easily obtained. The corresponding operations are now displayed in formula (7).

1 2 0 1

. / (( ). ^ ) *

P P M y

P P x M

 

  

(4)

Experiments

The encrypted and decrypted results of the image with the size of 512*512 are shown in figure 1. The sub graphs (a), (b), (c), and (d) are the encrypted images. In which the parameters ,x yare valued

as 10or100respectively. The first and the last sub graph are the original and decrypted image respectively.

[image:4.612.135.482.150.378.2]

Figure 1. Encrypted and Decrypted Image with the Size of 512*512.

Conclusions

In image encryption, gray encryption is better than simple scrambling encryption in terms of security. On the basis of the key stream generated by the random matrixes in MATLAB, the element-by-element matrix operations are implemented to encrypt and decrypt the image sequences. This one-time pad technique effectively ensures the security of the encrypted results. Moreover, the algorithm shows such features as simple calculation and easy availability to be programmed.

References

[1]Guan Z.H., Huang F.J., Guan W.J. A chaos-based image encryption algorithm [J]. Physics Letters A, 2005, 346(1-3): 153-157.

[2]Zhu Z.L., Zhang W., Wong K.W., et al. A chaos-based symmetric image encryption scheme using a bit-level permutation [J] Information Science, 2011, 181: 1171-1186.

[3]Tong X.J., Cui M.G. Image encryption with compound chaotic sequence cipher shifting dynamically [J]. Image and Vision Computing, 2008, 26(6): 843-850.

[4]Wei X.P., Guo L., Zhang Q., et al. A novel color image encryption algorithm based on DNA sequence operation and hyper-chaotic system [J]. The Journal of Systems and Software, 2012, 85(2): 290-299.

[5]Kanso A., Ghebleh M. A novel image encryption algorithm based on a 3D chaotic map [J]. Communications in Nonlinear Science Numerical Simulation, 2012, 17: 2943-2959.

[6]Schneier B. Applied Cryptography: Protocols, Algorithm and Source Code in C [M]. 2nd ed. New York: John Wiley & Sons, Inc, 1995.

Original Image Encrypted Image (a) (x=10,y=10) Encrypted Image (b) (x=10,y=100)

(5)

[7]Sasidharan S., Philip D.S. A fast partial image encryption scheme with wavelet transform and RC4 [J]. International Journal of Advances in Engineering & Technology, 2011, 1(4): 322-331.

[8]Ahmad M., Farooq O., et al. Chaotic image encryption algorithm based on frequency domain scrambling [J]. Information Processing Letters, 2010.

[9]Zhang Zhiyong, Yang Zuying. The Course of Matlab [M]. Beijing: Beijing University of Aeronautics and Astronautics, 2015.

Figure

Figure 1. Encrypted and Decrypted Image with the Size of 512*512.

References

Related documents

When we check fasting or random blood glucose levels, we get to know the blood glucose levels at that point in time.. Blood glucose levels keep changing based on

This research is carried out primarily for bank employees and measures its Role of Organizational Climate and Its Impact on Industrial Turnover, Organizational climate and

The cattle feed plant with installed capacity of 300 MT production daily faces large problem in effective utilization of the available capacity resulting deficit

In this study, we have constructed a new sequence of positive linear operators by using Szasz- Mirakyan and Bernstein operators on space of continuous functions on the unit

Regardless of these controversies, the environmental consultants I worked with believed that the 17th Conference of the Parties to the United Nations Framework Convention on

However, if these existing mechanisms are adapted to assess the people, processes, defenses, and risk to the organization utilizing concepts such as the OODA loop, the Cyber

We compared the performance of RepairOntologyWeaken (Algorithm 1) with the one of the non weakening-based Re- pairOntologyRemove (Algorithm 2) by first making the on-

One approach (Figure 1a) is to choose an evaluation mea- sure as the gold standard for relevance, such as the label- based metric DCG [6], and build a model to optimize it such