CN104077739A - Color image quick encryption method - Google Patents
Color image quick encryption method Download PDFInfo
- Publication number
- CN104077739A CN104077739A CN201410313967.5A CN201410313967A CN104077739A CN 104077739 A CN104077739 A CN 104077739A CN 201410313967 A CN201410313967 A CN 201410313967A CN 104077739 A CN104077739 A CN 104077739A
- Authority
- CN
- China
- Prior art keywords
- image
- formula
- encryption
- color image
- encryption method
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 21
- 230000009466 transformation Effects 0.000 claims abstract description 18
- 239000011159 matrix material Substances 0.000 claims description 4
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 238000005070 sampling Methods 0.000 claims description 3
- 230000000694 effects Effects 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 4
- 230000000739 chaotic effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Landscapes
- Facsimile Transmission Control (AREA)
- Editing Of Facsimile Originals (AREA)
- Image Processing (AREA)
Abstract
本发明公开了一种彩色图像快速加密方法,基于Arnold变换实现,具体步骤包括:加密前根据图像尺寸对图像进行分块处理;然后利用Arnold变换同时对图像像素的三个基色分量的位置和灰度进行置乱,完成彩色图像的加密;再对上述加密步骤中的变换进行逆变换,完成对加密图像的解密。本发明通过对现有技术进行改进,改善了加密效果,提高了加密效率,扩大了适用范围。The invention discloses a color image fast encryption method, which is realized based on Arnold transformation. The specific steps include: performing block processing on the image according to the image size before encryption; The degree of scrambling is carried out to complete the encryption of the color image; and then the transformation in the above encryption step is inversely transformed to complete the decryption of the encrypted image. The invention improves the encryption effect, increases the encryption efficiency and expands the scope of application by improving the prior art.
Description
技术领域 technical field
本发明涉及一种数字信号加密方法,具体涉及一种彩色图像快速加密方法。 The invention relates to a digital signal encryption method, in particular to a color image fast encryption method.
背景技术 Background technique
彩色图像作为多媒体数据的一个主要组成部分,为了保证其在传输过程中的安全性,要进行可靠的加密处理。目前许多加密算法仅限于二值图像或者灰度图像。彩色图像数据与一般的文本数据相比,数据信息量大且数据之间的相关度高,加密过程既要考虑主观的视觉效果的改变又要考虑客观的数据之间相关性的改变,加密的运算量大,耗时多;对传输的彩色图像加密要求具有实时性,因此对加密效率的研究显得尤为重要。 As a main component of multimedia data, color images must be encrypted reliably in order to ensure their security during transmission. Many current encryption algorithms are limited to binary or grayscale images. Compared with general text data, color image data has a large amount of data information and a high degree of correlation between data. The encryption process must consider not only the change of subjective visual effects but also the change of objective correlation between data. The amount of calculation is large and time-consuming; the encryption of transmitted color images requires real-time performance, so the research on encryption efficiency is particularly important.
近年来,很多文章提出了基于混沌系统或超混沌系统的图像加密算法,但是他们更多地在加密的安全性如:密钥空间、像素相关性等方面进行改进和分析,通常都忽视了加密系统的效率。事实上,由于混沌序列的产生本身就需要相当长的时间,即便在加密的时候仅需一次置乱,总的时间也比较长。 In recent years, many articles have proposed image encryption algorithms based on chaotic systems or hyperchaotic systems, but they have improved and analyzed encryption security such as: key space, pixel correlation, etc., and usually ignore encryption. system efficiency. In fact, since the generation of the chaotic sequence itself takes a long time, even if only one scrambling is required during encryption, the total time is relatively long.
Arnold变换由于加密简单,无需产生加密序列,所以是一种 常用的图像置乱加密技术,但其存在如下缺点: Arnold transform is a commonly used image scrambling encryption technology because of its simple encryption and no need to generate an encrypted sequence, but it has the following disadvantages:
(1)低维的Arnold置乱变换不能改变像素的灰度分布特征,安全性较低,加密效果不理想,且加密及解密的时间依赖加密周期,速度受到周期的限制; (1) The low-dimensional Arnold scrambling transformation cannot change the gray distribution characteristics of pixels, has low security, and the encryption effect is not ideal, and the time of encryption and decryption depends on the encryption cycle, and the speed is limited by the cycle;
(2)高维的Arnold变换时能改变像素的灰度分布特性,安全性好,但高维的Arnold置乱变换的迭代周期更长,解密效率低; (2) The high-dimensional Arnold transformation can change the gray distribution characteristics of pixels, which has good security, but the iteration cycle of the high-dimensional Arnold scrambling transformation is longer, and the decryption efficiency is low;
(3)Arnold变换对图像的形状有要求,Arnold变换运算只适用于方阵,这也大大制约了加密系统的使用范围。 (3) The Arnold transform has requirements on the shape of the image, and the Arnold transform operation is only applicable to the square matrix, which greatly restricts the scope of use of the encryption system.
发明内容 Contents of the invention
本发明的发明目的是提供一种彩色图像快速加密方法,通过对现有技术进行改进,改善了加密效果,提高了加密效率,扩大了适用范围。 The object of the present invention is to provide a color image fast encryption method, which improves the encryption effect, improves the encryption efficiency and expands the scope of application by improving the prior art.
为达到上述发明目的,本发明采用的技术方案是:一种彩色图像快速加密方法,基于Arnold变换实现,其特征在于,包括如下步骤: In order to achieve the above-mentioned purpose of the invention, the technical solution adopted in the present invention is: a kind of color image fast encryption method, realizes based on Arnold transformation, it is characterized in that, comprises the following steps:
1)根据图像尺寸对图像进行分块处理; 1) Divide the image into blocks according to the image size;
2)利用Arnold变换同时对图像像素的三个基色分量的位置和灰度进行置乱,完成彩色图像的加密; 2) Use the Arnold transform to simultaneously scramble the positions and gray levels of the three primary color components of the image pixel to complete the encryption of the color image;
3)对步骤2)中的变换进行逆变换,完成对加密图像的解密。 3) Inverse transform the transformation in step 2) to complete the decryption of the encrypted image.
上述技术方案中,所述步骤1)中,设图像的长和宽分别为wm和wn,则 ,将图像分为N块,每块图像的大小为 ,其中,,表示取的最小整数,加密时按照次序一块一块分块加密,若最后一块的长度不足wn,则用已经加密的邻近图像补足长度wn。 In the above technical solution, in step 1), if the length and width of the image are wm and wn respectively, then , divide the image into N blocks, and the size of each block is ,in, , Indicates to take When encrypting, the smallest integer is encrypted block by block in sequence. If the length of the last block is less than wn, the adjacent image that has already been encrypted is used to make up the length wn.
上述技术方案中,所述步骤2)中,设彩色图像的采样数据为一个三维的矩阵 W ,W(x,y,1)、W(x,y,2)和 W(x,y,3)表示坐标为(x,y)处像素点的三个基色分量的灰度值,W’(x,y,1)、W’(x,y,2)和 W’(x,y,3)表示改变后的灰度值,把坐标为(x,y)处像素点的三个基色分量的值改变后移动到坐标(x’,y’)处,如式(1)所示: In the above technical solution, in the step 2), the sampling data of the color image is set as a three-dimensional matrix W , W ( x , y,1 ), W ( x , y,2 ) and W ( x , y,3 ) represents the gray value of the three primary color components of the pixel at the coordinates ( x,y ), W' ( x , y,1 ), W' ( x , y,2 ) and W' ( x , y,3 ) represents the changed gray value, and the values of the three primary color components of the pixel at the coordinates ( x,y ) are changed and then moved to the coordinates ( x',y' ), as shown in formula (1):
(1) (1)
式(1)中,位置(x,y)与(x’,y’)之间的关系按照式(2)转换;灰度值W与W’ 之间的关系按照式(3)转换: In formula (1), the relationship between position ( x, y ) and ( x' , y' ) is converted according to formula (2); the relationship between gray value W and W' is converted according to formula (3):
(2) (2)
(3)。 (3).
上述技术方案中,所述步骤3)中,解密时把坐标为(x’,y’)处像素点的三个基色分量的值改变后移动到坐标处(x,y)处,如式(4)所示,解密过程是加密的一个逆过程,不依赖变换周期, In the above technical solution, in the step 3), when decrypting, the values of the three primary color components of the pixel at the coordinates ( x', y' ) are changed and then moved to the coordinates ( x, y ), as shown in the formula ( 4) shows that the decryption process is an inverse process of encryption and does not depend on the transformation period.
(4) (4)
式(4)中,(x’,y’)与(x,y)之间的位置关系按照式(5)进行逆转换;灰度值W’与W之间的关系按照式(6)进行逆转换: In formula (4), the positional relationship between ( x' , y' ) and ( x, y ) is inversely converted according to formula (5); the relationship between gray value W' and W is according to formula (6) Inverse conversion:
(5) (5)
(6)。 (6).
由于上述技术方案运用,本发明与现有技术相比具有下列优点: Due to the use of the above-mentioned technical solutions, the present invention has the following advantages compared with the prior art:
1.本发明采用分块加密的方法,使图像的形状不再局限于正方形,从而扩大了适用范围。 1. The invention adopts the block encryption method, so that the shape of the image is no longer limited to a square, thereby expanding the scope of application.
2. 本发明同时改变图像像素的位置和灰度值,提高了加密的安全性,改善了加密效果。 2. The present invention changes the position and gray value of image pixels at the same time, which improves the security of encryption and improves the encryption effect.
3. 本发明采用改进的逆变换使解密过程不依赖变换周期,从而提高了解密效率。 3. The invention adopts the improved inverse transformation to make the decryption process independent of the transformation period, thereby improving the decryption efficiency.
附图说明 Description of drawings
图1是实施例一中本发明的流程图。 Fig. 1 is the flowchart of the present invention in the first embodiment.
图2是实施例二中对一正方形图像进行加密和解密的效果图。 Fig. 2 is an effect diagram of encrypting and decrypting a square image in the second embodiment.
图3是实施例二中加密效果对比图。 Fig. 3 is a comparison diagram of encryption effects in the second embodiment.
图4是实施例二中加密前后图像的灰度分布特性示意图。 Fig. 4 is a schematic diagram of the gray distribution characteristics of the image before and after encryption in the second embodiment.
图5是实施例二中对长方形图像的加密和解密示意图。 Fig. 5 is a schematic diagram of the encryption and decryption of the rectangular image in the second embodiment.
具体实施方式 Detailed ways
下面结合附图及实施例对本发明作进一步描述: The present invention will be further described below in conjunction with accompanying drawing and embodiment:
实施例一:参见图1所示,一种彩色图像快速加密方法,基于Arnold变换实现,包括如下步骤: Embodiment one: referring to shown in Fig. 1, a kind of color image fast encryption method, realizes based on Arnold transformation, comprises the steps:
1)根据图像尺寸对图像进行分块处理处理; 1) Process the image into blocks according to the image size;
2)利用Arnold变换同时对图像像素的三个基色分量的位置和灰度进行置乱,完成彩色图像的加密; 2) Use the Arnold transform to simultaneously scramble the positions and gray levels of the three primary color components of the image pixel to complete the encryption of the color image;
3)对步骤(2)中的变换进行逆变换,完成对加密图像的解密。 3) Inverse transform the transformation in step (2) to complete the decryption of the encrypted image.
本实施例中,所述步骤1)中,设图像的长和宽分别为wm和wn,则,将图像分为N块,每块图像的大小为 ,其中,,表示取的最小整数,加密时按照次序一块一块分块加密,若最后一块的长度不足wn,则用已经加密的邻近图像补足长度wn。 In this embodiment, in the step 1), if the length and width of the image are respectively wm and wn, then , divide the image into N blocks, and the size of each block is ,in, , Indicates to take When encrypting, the smallest integer is encrypted block by block in sequence. If the length of the last block is less than wn, the adjacent image that has already been encrypted is used to make up the length wn.
所述步骤(2)中,设彩色图像的采样数据为一个三维的矩阵 W ,W(x,y,1)、W(x,y,2)和 W(x,y,3)表示坐标为(x,y)处像素点的三个基色分量的灰度值。W’(x,y,1)、W’(x,y,2)和 W’(x,y,3)表示改变后的灰度值。把坐标为(x,y)处像素点的三个基色分量的值改变后移动到坐标(x’,y’)处。如式(1)所示: In the step (2), it is assumed that the sampling data of the color image is a three-dimensional matrix W , and W ( x , y,1 ), W ( x , y,2 ) and W ( x , y,3 ) represent the coordinates as The gray value of the three primary color components of the pixel at ( x, y ). W' ( x , y,1 ), W' ( x , y,2 ) and W' ( x , y,3 ) represent the changed gray value. Change the values of the three primary color components of the pixel at the coordinate ( x,y ) and move to the coordinate ( x',y' ). As shown in formula (1):
(1) (1)
式(1)中,位置(x,y)与(x’,y’)之间的关系按照式(2)转换;灰度值W与W’ 之间的关系按照式(3)转换: In formula (1), the relationship between position ( x, y ) and ( x' , y' ) is converted according to formula (2); the relationship between gray value W and W' is converted according to formula (3):
(2) (2)
(3)。 (3).
所述步骤(3)中,解密时把坐标为(x’,y’)处像素点的三个基色分量的值改变后移动到坐标处(x,y)处,如式(4)所示,解密过程是加密的一个逆过程,不依赖变换周期, In the step (3), when decrypting, the values of the three primary color components of the pixel at the coordinates ( x', y' ) are changed and then moved to the coordinates ( x, y ), as shown in formula (4) , the decryption process is an inverse process of encryption and does not depend on the transformation cycle,
(4) (4)
式(4)中,(x’,y’)与(x,y)之间的位置关系按照式(5)进行逆转换;灰度值W’与W之间的关系按照式(6)进行逆转换: In formula (4), the positional relationship between ( x' , y' ) and ( x, y ) is inversely converted according to formula (5); the relationship between gray value W' and W is according to formula (6) Inverse conversion:
(5) (5)
(6)。 (6).
实施例二:参见图2所示,对一幅256×256的彩色图像进行加密和解密处理,其中(a)和(b)分别为加密和解密后的图像,加密和解密共需时间0.703000s,与现有技术相比,效率最高可提高八十多倍。 Embodiment 2: See Figure 2, encrypt and decrypt a 256×256 color image, where (a) and (b) are the encrypted and decrypted images respectively, and the total time required for encryption and decryption is 0.703000s , Compared with the existing technology, the efficiency can be increased by up to 80 times.
参见图3所示,对同一幅彩色图像采用不同的方法进行加密,其中,(a)为原始图像;(b)为基于二维Arnold变换后加密的图像,该变换只能改变像素的位置,不能改变像素的灰度值;(c)为基于三维Arnold变换后加密的图像,该变换只改变了像素的灰度值,部分区域留有原始图像的轮廓;(d)为本发明技术方案加密的图像,色彩分布均匀,直观效果良好。 As shown in Figure 3, different methods are used to encrypt the same color image, where (a) is the original image; (b) is the encrypted image based on the two-dimensional Arnold transformation, which can only change the position of the pixel, The gray value of the pixel cannot be changed; (c) is an encrypted image based on the three-dimensional Arnold transformation, which only changes the gray value of the pixel, leaving the outline of the original image in some areas; (d) encrypted for the technical solution of the present invention The image has uniform color distribution and good intuitive effect.
参见图4所示,表示彩色图像的红色分量的灰度分布特性,图中横轴为灰度级,变换范围为0~255,纵轴为各灰度级对应的像素个数。其中,(a)为原始图像的灰度分布;(b)为二维Arnold变换加密后图像的灰度分布;(c)为三维Arnold变换加密后图像的灰度分布;(d)为本发明技术方案加密图像的灰度分布。可以看出,(b)图的灰度分布与原始图像一样,所以二维Arnold变换加密后图像没有改变灰度分布特性。 Referring to FIG. 4 , it shows the gray distribution characteristics of the red component of the color image. The horizontal axis in the figure is the gray level, the transformation range is 0 to 255, and the vertical axis is the number of pixels corresponding to each gray level. Among them, (a) is the grayscale distribution of the original image; (b) is the grayscale distribution of the image encrypted by the two-dimensional Arnold transform; (c) is the grayscale distribution of the image encrypted by the three-dimensional Arnold transform; (d) is the grayscale distribution of the image in the present invention The technical solution encrypts the gray distribution of the image. It can be seen that the grayscale distribution of (b) is the same as the original image, so the grayscale distribution characteristics of the image do not change after the two-dimensional Arnold transform encryption.
参见图5所示,对一幅414×187的长方形彩色图像进行加密和解密处理,其中,(a)为原始图像;(b)为加密后的图像;(c)为解密后的图像,加密和解密共耗时0.766000s,可见本发明技术方案加密的图像不受形状的限制。 As shown in Figure 5, a 414×187 rectangular color image is encrypted and decrypted, where (a) is the original image; (b) is the encrypted image; (c) is the decrypted image, the encrypted It takes 0.766000s to decrypt and decrypt. It can be seen that the image encrypted by the technical scheme of the present invention is not limited by the shape.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410313967.5A CN104077739A (en) | 2014-07-03 | 2014-07-03 | Color image quick encryption method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410313967.5A CN104077739A (en) | 2014-07-03 | 2014-07-03 | Color image quick encryption method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104077739A true CN104077739A (en) | 2014-10-01 |
Family
ID=51598982
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410313967.5A Pending CN104077739A (en) | 2014-07-03 | 2014-07-03 | Color image quick encryption method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104077739A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108882029A (en) * | 2018-06-29 | 2018-11-23 | 银河威尔科技(北京)有限公司 | A kind of decryption of video method and apparatus |
CN110414448A (en) * | 2019-07-31 | 2019-11-05 | 北京三快在线科技有限公司 | Image processing method, device, electronic equipment and storage medium |
CN111030810A (en) * | 2019-11-29 | 2020-04-17 | 童勤业 | Anti-counterfeiting encryption method based on image local random transformation technology |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101662686A (en) * | 2009-09-07 | 2010-03-03 | 江南大学 | DCT domain video watermark treatment method based on texture features |
CN101894359A (en) * | 2010-07-13 | 2010-11-24 | 北京信息科技大学 | Image scrambling encryption method |
CN103442157A (en) * | 2013-09-04 | 2013-12-11 | 上海理工大学 | Image encryption method based on Arnold transformations and Henon chaotic system |
CN103761703A (en) * | 2014-01-15 | 2014-04-30 | 西安理工大学 | Single channel color image encryption method based on GT conversion and chaos |
-
2014
- 2014-07-03 CN CN201410313967.5A patent/CN104077739A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101662686A (en) * | 2009-09-07 | 2010-03-03 | 江南大学 | DCT domain video watermark treatment method based on texture features |
CN101894359A (en) * | 2010-07-13 | 2010-11-24 | 北京信息科技大学 | Image scrambling encryption method |
CN103442157A (en) * | 2013-09-04 | 2013-12-11 | 上海理工大学 | Image encryption method based on Arnold transformations and Henon chaotic system |
CN103761703A (en) * | 2014-01-15 | 2014-04-30 | 西安理工大学 | Single channel color image encryption method based on GT conversion and chaos |
Non-Patent Citations (4)
Title |
---|
孙晓龙等: "Arnold变换在非方阵图像置乱中的应用", 《太赫兹科学与电子信息学报》 * |
彭静玉: "一种高效的彩色图像加密和解密算法", 《通信技术》 * |
彭静玉: "彩色图像置乱方法研究", 《通信技术》 * |
梁小勇等: "基于Arnold变换的非正方形图像置乱新算法", 《吕梁学院学报》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108882029A (en) * | 2018-06-29 | 2018-11-23 | 银河威尔科技(北京)有限公司 | A kind of decryption of video method and apparatus |
CN108882029B (en) * | 2018-06-29 | 2020-07-31 | 银河威尔科技(北京)有限公司 | Video decryption method and device |
CN110414448A (en) * | 2019-07-31 | 2019-11-05 | 北京三快在线科技有限公司 | Image processing method, device, electronic equipment and storage medium |
CN111030810A (en) * | 2019-11-29 | 2020-04-17 | 童勤业 | Anti-counterfeiting encryption method based on image local random transformation technology |
CN111030810B (en) * | 2019-11-29 | 2022-08-05 | 童勤业 | Anti-counterfeiting encryption method based on image local random transformation technology |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105681622B (en) | A kind of color image encrypting method based on cell neural network hyperchaos and DNA sequence dna | |
CN102693523B (en) | Image two-grade encrypting method based on double-chaos system | |
CN108322622B (en) | Color digital image encryption method based on 2D-VMD and eight-dimensional hyper-chaotic system | |
CN101902576B (en) | Video-encryption camera and encryption method thereof | |
CN103455971A (en) | Image encryption method combining three-dimensional Arnold transformation with chaotic sequence | |
CN103440613A (en) | Color-image encryption method for hyperchaotic Rossler system | |
CN105447396A (en) | Fractional domain image encryption method based on Arnold transformation and compound chaos | |
CN104063833B (en) | A kind of image encryption, read method and device | |
CN106296561A (en) | Image encryption method based on hyperchaotic system and device, decryption method and device | |
CN106651735A (en) | Chaos theory-based digital image parallel encryption method | |
CN103888637A (en) | Method for chaotic encryption of multi-path image digital information | |
CN104182926B (en) | Color image encrypting method based on Hilbert conversion and chaos Liu algorithms | |
CN104320241B (en) | Video secret communication method based on integer field chaos | |
CN104881837B (en) | The image encryption method of key choice of dynamical based on hyperchaotic system | |
CN106570814B (en) | Hyperchaotic image encryption method | |
Wang et al. | A new hybrid image encryption algorithm based on Gray code transformation and snake-like diffusion | |
CN107833174A (en) | A kind of image encryption method based on Logistic chaos system algorithms | |
CN104077739A (en) | Color image quick encryption method | |
CN102456114A (en) | Two-dimensional CAD engineering drawing content variable-strength encryption method and device | |
CN106373082A (en) | Cellular automata and chaotic mapping-based digital image encryption method and decryption method thereof | |
CN103971320B (en) | A kind of image scrambling and restoration methods based on Henon mappings | |
CN110634096B (en) | Self-adaptive multi-mode information hiding method and device | |
CN105118017A (en) | Gray image encryption method based on two-dimension Henon mapping | |
CN104244011A (en) | Image compression and encryption algorithm based on chaos | |
Li et al. | An image encryption method based on tent and Lorenz chaotic systems |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20141001 |
|
RJ01 | Rejection of invention patent application after publication |