CN112019701B - Method for realizing image encryption by adopting nonlinear low-pass filtering - Google Patents

Method for realizing image encryption by adopting nonlinear low-pass filtering Download PDF

Info

Publication number
CN112019701B
CN112019701B CN202010936222.XA CN202010936222A CN112019701B CN 112019701 B CN112019701 B CN 112019701B CN 202010936222 A CN202010936222 A CN 202010936222A CN 112019701 B CN112019701 B CN 112019701B
Authority
CN
China
Prior art keywords
matrix
low
data
transformation
pass filtering
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.)
Expired - Fee Related
Application number
CN202010936222.XA
Other languages
Chinese (zh)
Other versions
CN112019701A (en
Inventor
雷军委
李辉
梁勇
王玲玲
闫实
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Naval Aeronautical University
Original Assignee
Naval Aeronautical University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Naval Aeronautical University filed Critical Naval Aeronautical University
Priority to CN202010936222.XA priority Critical patent/CN112019701B/en
Publication of CN112019701A publication Critical patent/CN112019701A/en
Application granted granted Critical
Publication of CN112019701B publication Critical patent/CN112019701B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/32Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
    • H04N1/32101Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title
    • H04N1/32144Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title embedded in the image data, i.e. enclosed or integrated in the image, e.g. watermark, super-imposed logo or stamp
    • H04N1/32149Methods relating to embedding, encoding, decoding, detection or retrieval operations
    • H04N1/32267Methods relating to embedding, encoding, decoding, detection or retrieval operations combined with processing of the image
    • H04N1/32272Encryption or ciphering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/44Secrecy systems
    • H04N1/448Rendering the image unintelligible, e.g. scrambling
    • H04N1/4486Rendering the image unintelligible, e.g. scrambling using digital data encryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Facsimile Transmission Control (AREA)
  • Image Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Storage Device Security (AREA)

Abstract

本发明提供一种采用非线性低通滤波实现图像加密的方法,适用于图像数据加密与解密传输。该方法主要是对图像数据进行归一化预处理后,首先进行一种可扩展的首次低通滤波变换,将变换参数作为第一密钥;然后进行二次低通滤波变换,将变换参数作为第二密钥,在进行非线性对称变换完成图像加密,并将变换参数作为第三密钥告知接收方,然后接收方采用三大密钥,依次进行相应的逆变换,完成图像数据的解密。该方法的优点在于无论是低通滤波变换还是非线性对称变换,都非常容易进行扩展,实现多次加密,提高文件的安全性。同时解密过程失真度小,而且解密方式与加密方式形式基本类似,仅参数不同,非常便于工程应用。

Figure 202010936222

The invention provides a method for realizing image encryption by adopting nonlinear low-pass filtering, which is suitable for image data encryption and decryption transmission. The method is mainly to perform normalization preprocessing on the image data, first perform a scalable first low-pass filter transformation, and use the transformation parameters as the first key; then perform a second low-pass filter transformation, using the transformation parameters as The second key is to perform non-linear symmetric transformation to complete the image encryption, and inform the receiver of the transformation parameters as the third key, and then the receiver uses the three major keys to perform corresponding inverse transformations in turn to complete the decryption of the image data. The advantage of this method is that it is very easy to expand whether it is a low-pass filter transformation or a nonlinear symmetric transformation, and realizes multiple encryptions and improves the security of the file. At the same time, the degree of distortion in the decryption process is small, and the decryption method is basically similar to the encryption method, only the parameters are different, which is very convenient for engineering applications.

Figure 202010936222

Description

Method for realizing image encryption by adopting nonlinear low-pass filtering
Technical Field
The invention relates to the field of image encryption and restoration, in particular to a method for realizing image encryption by adopting nonlinear low-pass filtering.
Background
With the development of society and networks, more and more images are spread on the internet. In some important financial and military fields, security of image dissemination has raised concerns for more and more researchers. Image encryption and decryption techniques have been rapidly developed in recent decades. Low pass filters are commonly applied with digital signal processing for filtering noisy signals. It can also be applied to encryption and decryption of image signals. At present, few researches on encryption and decryption by applying low-pass filtering are carried out, and the main reason is that the encryption is easy and the decryption is difficult. Since the decryption process inevitably carries out differential operation, signal distortion is easily caused, and therefore the restored image cannot be ensured to be completely consistent with the original image.
Based on the background reasons, the invention provides a method combining extensible low-pass filtering and nonlinear symmetrical transformation, and decryption without singularity completely and seamlessly enables an image to be free of distortion, so that multi-layer transformation encryption and decryption can be performed, high-security transmission of the image is realized, and the method has high practical application value.
It is to be noted that the information invented in the above background section is only for enhancing the understanding of the background of the present invention, and therefore, may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The invention aims to provide a method for realizing image encryption by adopting nonlinear low-pass filtering, and further solves the problems of difficult expansion and low-pass transformation distortion in the traditional image encryption and decryption algorithm to a certain extent.
Step S10, reading the file to be encrypted by a computer, storing the file as a matrix array, and then performing data conversion processing;
step S20, performing extensible first low-pass filtering transformation on the data to obtain a first low-pass filtering matrix, and taking a first low-pass filtering parameter as a first secret key;
step S30, carrying out secondary low-pass filtering transformation on the primary low-pass filtering matrix data to obtain a secondary low-pass filtering matrix, and taking secondary low-pass filtering parameters as a second key;
step S40, carrying out nonlinear symmetric transformation on the quadratic low-pass filter matrix to obtain nonlinear symmetric matrix data, and taking nonlinear symmetric transformation parameters as a third key;
step S50, image data conversion is carried out on the nonlinear symmetric matrix data and then the nonlinear symmetric matrix data is stored as an image file, the encryption process is completed, and the encrypted data file is sent out;
step S60, receiving the sending file at the receiving end and storing the file as matrix data, and carrying out data preprocessing to obtain a receiving end data matrix;
step S70, according to the third key, carrying out nonlinear symmetric inverse transformation on the receiving end data matrix to obtain nonlinear symmetric inverse transformation matrix data;
step S80, according to the second key, carrying out secondary low-pass filtering inverse transformation on the nonlinear symmetric inverse transformation matrix to obtain an inverse secondary low-pass filtering matrix;
step S90, according to the first key, the inverse quadratic low-pass filtering matrix is inversely transformed by the first low-pass filtering to obtain an inverse matrix of the first low-pass filtering;
and S100, performing data conversion aiming at the first low-pass filtering inverse matrix, storing the converted data as picture data, obtaining a decrypted file, and finishing the decryption process.
In an exemplary embodiment of the present invention, reading a file to be encrypted by using a computer, storing the file as a matrix array, and then performing data conversion processing includes: firstly, selecting a gray picture file to be encrypted, and naming the gray picture file as rain. Then stored as data matrix A1Then, the dimension is calculated and recorded as m rows and n columns. Then, for the matrix A1Carrying out data recombination to obtain a row matrix A with 1 row m × n columns2. Finally, for A2Simple normalization pretreatment is carried out to obtain a normalization matrix A of matrix element numbers in an interval (0,1)3
In an exemplary embodiment of the present invention, performing an extensible first low-pass filtering transformation on the data to obtain a first low-pass filtering matrix comprises:
Figure BDA0002672026490000031
Figure BDA0002672026490000032
Figure BDA0002672026490000033
wherein T is1,T2,T3,T4The first key is used to inform the receiving party that the first low-pass filtering transformation parameters are all positive constant value parameters, which are selected in detail in the embodiments described later. T is0The discrete time constants are chosen in detail as will be described later in the examples. A. the4The dimension of the obtained first low-pass filter matrix is 1 row m x n column. And A is4(i) I is more than or equal to 1 and less than or equal to mn. The subsequent matrix definitions are the same and are not repeated.
Figure BDA0002672026490000034
Is a matrix A3Is determined by the velocity vector of (a),
Figure BDA0002672026490000035
is a matrix A4Velocity vector of A3The input matrix is an input matrix of the first low-pass filtering transformation, namely a normalized row matrix obtained after data conversion processing is carried out on the file to be encrypted.
In an exemplary embodiment of the present invention, performing a second low-pass filtering transformation on the first low-pass filtering matrix data to obtain a second low-pass filtering matrix includes:
Figure BDA0002672026490000036
Figure BDA0002672026490000037
wherein W1,W2,W3,W4The second key is used to inform the receiver that the second low-pass filter transformation parameters are all positive constant value parameters, which are selected in detail in the embodiments described later. T is0Are discrete time constants.
Figure BDA0002672026490000038
Is a matrix A4The velocity vector whose value does not need to be recalculated, has been defined or calculated previously.
A5The dimension of the quadratic low-pass filter matrix is 1 row m x n column. And A is5(i) I is more than or equal to 1 and less than or equal to mn.
Figure BDA0002672026490000039
Is a matrix A5Velocity vector of A4The input matrix of the second low-pass filtering transformation is the first low-pass filtering matrix.
In an exemplary embodiment of the present invention, performing a non-linear symmetric transformation on the quadratic low-pass filter matrix to obtain non-linear symmetric matrix data includes:
when in use
Figure BDA0002672026490000041
When the temperature of the water is higher than the set temperature,
Figure BDA0002672026490000042
when in use
Figure BDA0002672026490000043
When the temperature of the water is higher than the set temperature,
Figure BDA0002672026490000044
wherein F1,F2,F3,F4The non-linear symmetric transformation parameter is a constant value, which is informed to the receiver as a third key. A. the5Is a quadratic low-pass filter matrix, A6The obtained nonlinear symmetric matrix is obtained.
In an exemplary embodiment of the present invention, converting the nonlinear symmetric matrix data into image data and then storing the image data as an image file includes:
imax=max(A6);imin=min(A6);
if imax≠imin
Figure BDA0002672026490000045
If imax=imin>0;A7(i)=1;
If imax=imin≤0;A7(i)=0;
Wherein A is6For said non-linear symmetric matrix data, A7For normalizing the transformation matrix, where max (A)6) Representation pair matrix A6All elements of (2) are maximized and are denoted as imax。min(A6) Representation pair matrix A6All elements of (2) are minimized and are denoted as imin
Then to A7Performing data recombination, converting the data into an m-row-n-column matrix A from a 1-row-m-n-column matrix8And stored as an image data file, which is recorded as rain1. png. And the image encryption process is finished, and the encrypted image file rain1.png is sent to the remote receiving end.
In an exemplary embodiment of the present invention, receiving a transmission file at a receiving end and storing the transmission file as matrix data, and performing data preprocessing to obtain a receiving end data matrix includes: firstly, the sent encrypted image file is received at a remote receiving end and stored as rain2. png. Secondly, after reading the image file by adopting a computer, storing the data into a matrix A with m rows and n columns9. Then the matrix A is formed9Carrying out data recombination to obtain a matrix A with 1 row m x n10. Finally, according to iminAnd imaxTo A10Inverse normalized transformation is carried out to obtain a receiving end data matrix A11The inverse normalized transformation process is as follows:
if imax≠imin;A11(i)=imin+A10(i)(imax-imin);
If imax=imin>0;A11(i)=imax
If imax=imin≤0;A11(i)=imin
In an exemplary embodiment of the present invention, performing a nonlinear symmetric inverse transform on a receiving-end data matrix to obtain nonlinear symmetric inverse transform matrix data includes:
when in use
Figure BDA0002672026490000051
When the temperature of the water is higher than the set temperature,
Figure BDA0002672026490000052
when in use
Figure BDA0002672026490000053
When the temperature of the water is higher than the set temperature,
Figure BDA0002672026490000054
wherein F1,F2,F3,F4Is said third key, A11For the receiving end data matrix, A12I.e. the resulting nonlinear symmetric inverse transform matrix data.
In an exemplary embodiment of the invention, performing an inverse quadratic low-pass filtering on the inverse nonlinear symmetric transform matrix to obtain an inverse quadratic low-pass filtering matrix comprises:
Figure BDA0002672026490000055
Figure BDA0002672026490000056
Figure BDA0002672026490000057
wherein W1,W2,W3,W4Is a second key parameter, T0With a discrete time constant, A12For the non-linear symmetric inverse transformation of the matrix data,
Figure BDA0002672026490000058
is a matrix A12Is determined by the velocity vector of (a),
Figure BDA0002672026490000059
is a matrix A13Velocity vector of A13The dimension of the obtained inverse quadratic low pass filter matrix is 1 row m x n column.
In an exemplary embodiment of the invention, performing a first inverse low-pass filtering on the inverse quadratic low-pass filtering matrix, and obtaining the first inverse low-pass filtering matrix comprises:
Figure BDA00026720264900000510
Figure BDA0002672026490000061
wherein
Figure BDA0002672026490000062
Without recalculation, the last step value, T, can be used1,T2,T3,T4Is a first key parameter, T0With a discrete time constant, A13In order to be an inverse quadratic low pass filter matrix,
Figure BDA0002672026490000063
is a matrix A14Velocity vector of A14The first inverse low-pass filter matrix is finally obtained, and the dimension of the first inverse low-pass filter matrix is 1 row m x n column.
In an exemplary embodiment of the present invention, performing data conversion on the first low-pass filtered inverse matrix, and storing the converted data as picture data, to obtain a decrypted file includes: according to the first low-pass filtering inverse matrix A14Converting into image matrix format, i.e. converting from 1 row m × n column to m rows n columns, and recording the obtained matrix as A15. Then A is mixed15Stored as an image file, noted rain2. png. Finally, the decrypted file is obtained.
Advantageous effects
The method for realizing image encryption by adopting nonlinear low-pass filtering has the advantages of three, firstly, the method adopts a novel low-pass filtering transformation mode, can realize the consistency of encryption and decryption modes, ensures that the decryption process has no distortion, and avoids the problem of image distortion caused by differential realization in decryption and reduction of the traditional low-pass filtering transformation. And secondly, a novel nonlinear symmetrical transformation mode is adopted, so that the encryption and decryption are very convenient, the free transformation of all the number domains can be realized, the decryption is more difficult, and in the decryption process, the complete restoration of the image can be realized without distortion due to seamless butt joint. And thirdly, the mode of combining the low-pass filtering and the nonlinear symmetric transformation can be expanded infinitely to form a multi-layer encryption and decryption measure, and the security of encrypted image data is improved through a plurality of layers of keys. Therefore, the method provided by the invention has high engineering application value and great innovation.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
FIG. 1 is a flow chart of a method for implementing image encryption by using nonlinear low-pass filtering according to the present invention;
fig. 2 is an original image of a section of text to be encrypted according to the method provided in the embodiment of the present invention;
FIG. 3 is an encrypted image of a method provided by an embodiment of the invention;
FIG. 4 is an image decrypted with a correct key according to a method provided by an embodiment of the present invention;
FIG. 5 shows a method of using T in accordance with an embodiment of the present invention2An image decrypted by an inaccurate key of 3;
FIG. 6 shows an embodiment of the present inventionUse of the provided method T3An image decrypted by an inaccurate key of 3;
FIG. 7 shows a method of using F in accordance with an embodiment of the present invention4-5, an inaccurate key decrypted image;
FIG. 8 shows a flowchart of a method F provided by an embodiment of the invention3An inaccurate key of 50.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the invention.
The invention provides a method for realizing image encryption by adopting nonlinear low-pass filtering, which forms multilayer encryption by combining multilayer low-pass filtering transformation and multilayer nonlinear symmetrical transformation to protect an encrypted image. And meanwhile, a multi-layer key is formed through parameters in a conversion mode, so that correct parameters are provided for image decryption. It should be noted that, in the embodiment of the present invention, only two layers of low-pass filtering and one layer of nonlinear symmetric transformation are used for description, but actually, the low-pass filtering method and the nonlinear symmetric transformation method provided by the present invention can be flexibly combined many times, as long as the computer memory allows, hundreds of layers of encryption can be implemented, and meanwhile, it can be ensured that the decryption process is basically distortion-free. Therefore, the method has very flexible and free expansibility and high safety. Particularly, the low-pass filtering form is adopted, so that the problem of differential distortion generated in decryption engineering by the traditional low-pass filtering is avoided, and the traditional low-pass filtering is difficult to carry out multilayer expansion application.
The following further explains and explains a method for realizing image encryption by using nonlinear low-pass filtering according to the present invention with reference to the drawings. Referring to fig. 1, the method for implementing image encryption by using nonlinear low-pass filtering may include the following steps:
step S10, reading the file to be encrypted by a computer, storing the file as a matrix array, and then performing data conversion processing;
specifically, a file to be encrypted is first selected, named rain. In the case of a color picture, it is first converted to a gray picture.
Secondly, reading the gray picture data, storing the gray picture data as a data matrix, and recording the data matrix as A1Then, the dimension is obtained, which is a two-dimensional matrix and is recorded as m rows and n columns.
Then, for the matrix A1Performing data reorganization to obtain a row matrix, and recording the row matrix as A2Which is a one-dimensional matrix with 1 row m x n columns.
Finally, for A2Performing simple normalization pretreatment to obtain a normalization matrix, and recording the normalization matrix as A3. The normalization process is to ensure A3The middle matrix element number is within the interval (0, 1).
Step S20, performing extensible first low-pass filtering transformation on the data to obtain a first low-pass filtering matrix, and taking a first low-pass filtering parameter as a first secret key;
specifically, first, the first low-pass filter transformation parameter T is set1,T2,T3,T4The parameter is a positive constant value parameter, which is selected in detail in the following embodiment and the above four parameters are used as the first key to inform the receiving party.
Secondly, a discrete time constant T is set0And sets the initial value of the first low-pass filter matrix. Namely is provided withThe first low-pass filter matrix obtained finally is A4The dimension is 1 row m x n column. And A is4(i) I is more than or equal to 1 and less than or equal to mn. The subsequent matrix definitions are the same and are not repeated. Setting an initial value A of a matrix4(1)=A3(1)。
Thirdly, calculate the matrix A3Velocity vector of (2) is recorded as
Figure BDA0002672026490000091
It is calculated as follows:
Figure BDA0002672026490000092
then, a matrix A is calculated4Velocity vector of (2) is recorded as
Figure BDA0002672026490000093
It is calculated as follows:
Figure BDA0002672026490000094
finally, according to the velocity vector
Figure BDA0002672026490000095
Calculating a first low-pass filter matrix A4The element values of (a) are as follows:
Figure BDA0002672026490000096
step S30, carrying out secondary low-pass filtering transformation on the primary low-pass filtering matrix data to obtain a secondary low-pass filtering matrix, and taking secondary low-pass filtering parameters as a second key;
specifically, firstly, a quadratic low-pass filter transformation parameter W is set1,W2,W3,W4The parameters are positive constant values, which are detailed in the following embodiments and are reported to the receiver as the second key.
Secondly, a discrete time constant T is set0And sets the initial value of the quadratic low-pass filter matrix. Namely, the finally obtained quadratic low-pass filter matrix is set as A5The dimension is 1 row m x n column. Setting an initial value A of a matrix5(1)=A4(1)。
Then, a matrix A is calculated5Velocity vector of (2) is recorded as
Figure BDA0002672026490000097
It is calculated as follows:
Figure BDA0002672026490000098
wherein the matrix A4Velocity vector of
Figure BDA0002672026490000099
The last step value can be used without recalculation.
Finally, according to the velocity vector
Figure BDA0002672026490000101
Calculating a quadratic low-pass filter matrix A5The element values of (a) are as follows:
Figure BDA0002672026490000102
although the above-described low-pass filtering conversion is performed only twice, it is actually possible to perform a larger number of low-pass filtering conversions more conveniently and to realize a plurality of encryptions. And the transformation has no singular point, and is very convenient for multiple times of expansion.
Step S40, carrying out nonlinear symmetric transformation on the quadratic low-pass filter matrix to obtain nonlinear symmetric matrix data, and taking nonlinear symmetric transformation parameters as a third key;
specifically, first, a nonlinear symmetric transformation parameter F is set1,F2,F3,F4It is a common value, and its detailed design is described laterThe case is implemented and informed to the recipient as the third key.
Secondly, aiming at the quadratic low-pass filtering matrix A5Then, nonlinear symmetric transformation is performed to obtain a nonlinear symmetric matrix, which is denoted as A6The transformation relationship among the elements is as follows:
when in use
Figure BDA0002672026490000103
When the temperature of the water is higher than the set temperature,
Figure BDA0002672026490000104
when in use
Figure BDA0002672026490000105
When the temperature of the water is higher than the set temperature,
Figure BDA0002672026490000106
step S50, image data conversion is carried out on the nonlinear symmetric matrix data and then the nonlinear symmetric matrix data is stored as an image file, the encryption process is completed, and the encrypted data file is sent out;
specifically, the nonlinear symmetric matrix a is first obtained6The data is normalized and transformed to obtain a normalized matrix, which is recorded as A7The transformation is as follows:
imax=max(A6);imin=min(A6);
if imax≠imin
Figure BDA0002672026490000107
If imax=imin>0;A7(i)=1;
If imax=imin≤0;A7(i)=0;
Wherein max (A)6) Representation pair matrix A6All elements of (2) are maximized and are denoted as imax。min(A6) Representation pair matrix A6All elements of (2) are minimizedIs recorded as imin
Secondly, for A7Performing data recombination, converting the data from a matrix with 1 row m × n columns into a matrix with m rows and n columns, and recording the matrix as A8
Finally, converting the obtained A8Stored as an image data file, and recorded as rain1. png. And the image encryption process is finished, and the encrypted image file rain1.png is sent to the remote receiving end.
Step S60, receiving the sending file at the receiving end and storing the file as matrix data, and carrying out data preprocessing to obtain a receiving end data matrix;
specifically, the sent encrypted image file is received at the remote receiving end and stored as rain2. png. Secondly, after reading the image file by adopting a computer, storing the data as a matrix, and recording the matrix as A9. The matrix is m rows and n columns.
Then the matrix A is formed9Recombining data, converting into one-dimensional row vector to obtain 1 row m × n column matrix, and recording as A10. Finally, according to iminAnd imaxTo A10Inverse normalized transformation is carried out to obtain a receiving end data matrix A11The inverse normalized transformation process is as follows:
if imax≠imin;A11(i)=imin+A10(i)(imax-imin);
If imax=imin>0;A11(i)=imax
If imax=imin≤0;A11(i)=imin
Step S70, according to the third key, carrying out nonlinear symmetric inverse transformation on the receiving end data matrix to obtain nonlinear symmetric inverse transformation matrix data;
in particular, according to said third key F1,F2,F3,F4To the receiving end data matrix A11Performing nonlinear symmetric inverse transformation to obtain nonlinear symmetric inverse transformation matrix data denoted by A12Element conversion between themThe method comprises the following steps:
when in use
Figure BDA0002672026490000111
When the temperature of the water is higher than the set temperature,
Figure BDA0002672026490000112
when in use
Figure BDA0002672026490000113
When the temperature of the water is higher than the set temperature,
Figure BDA0002672026490000114
step S80, according to the second key, carrying out secondary low-pass filtering inverse transformation on the nonlinear symmetric inverse transformation matrix to obtain an inverse secondary low-pass filtering matrix;
specifically, according to the second key parameter W1,W2,W3,W4And a discrete time constant T0And setting the initial value of the quadratic low-pass filter inverse matrix. Namely, the finally obtained inverse quadratic low pass filter matrix is set as A13The dimension is 1 row m x n column. Setting an initial value A of a matrix13(1)=A12(1)。
Thirdly, calculate the matrix A12Velocity vector of (2) is recorded as
Figure BDA0002672026490000121
It is calculated as follows:
Figure BDA0002672026490000122
then, a matrix A is calculated13Velocity vector of (2) is recorded as
Figure BDA0002672026490000123
It is calculated as follows:
Figure BDA0002672026490000124
finally, according to the velocity vector
Figure BDA0002672026490000125
Calculating an inverse quadratic low pass filter matrix A13The element values of (a) are as follows:
Figure BDA0002672026490000126
step S90, according to the first key, the inverse quadratic low-pass filtering matrix is inversely transformed by the first low-pass filtering to obtain an inverse matrix of the first low-pass filtering;
specifically, according to the first key parameter T1,T2,T3,T4And a discrete time constant T0And setting an initial value of the first low-pass filtering inverse matrix. Namely, the finally obtained first low-pass filter inverse matrix is set as A14The dimension is 1 row m x n column. Setting an initial value A of a matrix14(1)=A13(1)。
Then, a matrix A is calculated14Velocity vector of (2) is recorded as
Figure BDA0002672026490000127
It is calculated as follows:
Figure BDA0002672026490000128
wherein the velocity vector
Figure BDA0002672026490000129
The last step value can be used without recalculation.
Finally, according to the velocity vector
Figure BDA00026720264900001210
Calculating a first low-pass filter inverse matrix A14The element values of (a) are as follows:
Figure BDA00026720264900001211
and S100, performing data conversion aiming at the first low-pass filtering inverse matrix, storing the converted data as picture data, obtaining a decrypted file, and finishing the decryption process.
Specifically, according to the first low-pass filtering inverse matrix A14Converting into image matrix format, i.e. converting from 1 row m × n column to m rows n columns, and recording the obtained matrix as A15. Then A is mixed15Stored as an image file, noted rain2. png. Finally, the decrypted file is obtained. It can be seen by comparison that there is almost no difference from the original file, the distortion degree is very small, but if the decryption parameter is not correct, the image information cannot be identified.
Case implementation and computer processing result analysis
In step S10, the image file is selected as a screenshot of a segment of text. Since it is a color image, it is converted into a black-and-white image, and then it is shown in fig. 2. It contains m 159 rows and n 698 columns.
In step S20, the first low-pass filter transformation parameter T is set1=0.01,T2=1,T3=0.02,T4=1,T0=0.001;
In step S30, a quadratic low-pass filtering conversion parameter W is set1=0.03,W2=2,W3=0.05,W4=3;
In step S40, a nonlinear-symmetric transformation parameter F is set1=1,F2=100,F3=1,F4=-100;
The encrypted data is stored as an encrypted image and transmitted in step S50, as shown in fig. 3.
In steps S60 and S100, the operation may be performed as described in the embodiment.
In steps S70, S80, and S90, the picture is decrypted by using the accurate first key, second key, and third key parameters, and the effect after decryption is shown in fig. 4.
When the first key takes the decryption parameter T1=0.01,T2=3,T3=0.02,T4When 1, the decryption effect is as shown in fig. 5.
When the first key takes the decryption parameter T1=0.01,T2=3,T3=3,T4When 1, the decryption effect is as shown in fig. 6.
When the third key takes the decryption parameter F1=1,F2=100,F3=1,F4When-5, the decryption effect is as shown in fig. 7.
When the third key takes the decryption parameter F1=1,F2=100,F3=50,F4The decryption effect is shown in fig. 8 when-100.
It can be seen from the above cases that the encryption method provided by the present invention, when the picture is intercepted by the other party, the picture is black, as shown in fig. 3, the text information is completely hidden. Under the protection of three keys, the error of any one key will bring about bad decryption effect and distortion of graphics. Of course, the key parameters are somewhat less distorted, e.g., F in the third key parameter4However, some key parameters have a great influence on the decryption effect. Therefore, through three-layer encryption, the security of the picture is greatly improved. Particularly, the nonlinear low-pass filtering encryption method provided by the invention has the advantages that each key is very convenient to expand, the decryption and encryption modes are similar, the operation is convenient and simple, and the nonlinear low-pass filtering encryption method can be expanded into a multilayer encryption mode such as four layers and five layers if needed. Therefore, the invention has high engineering application value.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.

Claims (1)

1.一种采用非线性低通滤波实现图像加密的方法,其特征在于,包括以下步骤:1. a method that adopts nonlinear low-pass filtering to realize image encryption, is characterized in that, comprises the following steps: 步骤S10,采用计算机读取待加密传送文件,存为矩阵数组,然后进行数据转换处理如下:Step S10, use a computer to read the file to be encrypted for transmission, save it as a matrix array, and then perform data conversion processing as follows: 首先选取待加密灰色图片文件,命名为rain.png;然后存为数据矩阵A1,然后求取其维数,记作m行n列;然后,对矩阵A1进行数据重组,得到1行m*n列行矩阵A2;最后,对A2进行简单归一化预处理,得到矩阵元素数字在区间(0,1)的归一化矩阵A3First select the gray image file to be encrypted and name it rain.png; then save it as a data matrix A 1 , then find its dimension, denoted as m rows and n columns; then, perform data reorganization on the matrix A 1 to obtain 1 row m *n-column-row matrix A 2 ; finally, perform simple normalization preprocessing on A 2 to obtain a normalized matrix A 3 with matrix element numbers in the interval (0,1); 步骤S20,对数据进行可扩展的首次低通滤波变换,得到首次低通滤波矩阵,并将首次低通滤波参数作为第一密钥如下:Step S20, perform scalable first low-pass filtering transformation on the data to obtain the first low-pass filtering matrix, and use the first low-pass filtering parameters as the first key as follows:
Figure FDA0003189624690000011
Figure FDA0003189624690000011
Figure FDA0003189624690000012
Figure FDA0003189624690000012
Figure FDA0003189624690000013
Figure FDA0003189624690000013
其中T1,T2,T3,T4作为第一密钥告知接收方,为首次低通滤波变换参数,其选取为正的常值参数,可任意选取;T0为离散时间常数;A3为首次低通滤波变换的输入矩阵,即由待加密文件进行数据转换处理后得到的归一化的行矩阵;
Figure FDA0003189624690000014
为矩阵A3的速度向量,
Figure FDA0003189624690000015
为矩阵A4的速度向量,A4即为最终得到的首次低通滤波矩阵,其维数为1行m*n列;而A4(i)为其第i个元素,1≤i≤m*n;
Among them, T 1 , T 2 , T 3 , and T 4 are used as the first key to inform the receiver, and are the first low-pass filtering transformation parameters, which are selected as positive constant parameters and can be selected arbitrarily; T 0 is the discrete time constant; A 3 is the input matrix of the first low-pass filtering transformation, that is, the normalized row matrix obtained after the data conversion processing of the file to be encrypted;
Figure FDA0003189624690000014
is the velocity vector of matrix A 3 ,
Figure FDA0003189624690000015
is the velocity vector of matrix A 4 , A 4 is the final first low-pass filter matrix, and its dimension is 1 row m*n column; and A 4 (i) is its i-th element, 1≤i≤m *n;
步骤S30,针对所述的首次低通滤波矩阵数据进行二次低通滤波变换,得到二次低通滤波矩阵,并将二次低通滤波参数作为第二密钥,具体包含如下:Step S30, performing secondary low-pass filtering transformation on the first low-pass filtering matrix data to obtain a secondary low-pass filtering matrix, and using the secondary low-pass filtering parameters as the second key, specifically including the following:
Figure FDA0003189624690000021
Figure FDA0003189624690000021
Figure FDA0003189624690000022
Figure FDA0003189624690000022
其中W1,W2,W3,W4作为第二密钥告知接收方,为二次低通滤波变换参数,其选取为正的常值参数,可任意选取;T0为离散时间常数,
Figure FDA0003189624690000023
为矩阵A4的速度向量,其计算过程见上一步;A5为最终得到的二次低通滤波矩阵,其维数为1行m*n列;而A5(i)为其第i个元素,1≤i≤m*n;
Figure FDA0003189624690000024
为矩阵A5的速度向量,A4为二次低通滤波变换的输入矩阵,也是首次低通滤波矩阵;
Among them, W 1 , W 2 , W 3 , and W 4 are used as the second key to inform the receiver, which are the quadratic low-pass filter transformation parameters, which are selected as positive constant parameters and can be selected arbitrarily; T 0 is a discrete time constant,
Figure FDA0003189624690000023
is the velocity vector of matrix A 4 , and its calculation process is shown in the previous step; A 5 is the final quadratic low-pass filter matrix, and its dimension is 1 row, m*n column; and A 5 (i) is the i-th element, 1≤i≤m*n;
Figure FDA0003189624690000024
is the velocity vector of the matrix A5, A4 is the input matrix of the secondary low - pass filtering transformation, and is also the first low - pass filtering matrix;
步骤S40,针对所述的二次低通滤波矩阵,进行非线性对称变换,得到非线性对称矩阵数据,并将非线性对称变换参数作为第三密钥,具体包含如下:Step S40, perform nonlinear symmetric transformation on the secondary low-pass filter matrix to obtain nonlinear symmetric matrix data, and use the nonlinear symmetric transformation parameters as the third key, which specifically includes the following:
Figure FDA0003189624690000025
时,
Figure FDA0003189624690000026
when
Figure FDA0003189624690000025
hour,
Figure FDA0003189624690000026
Figure FDA0003189624690000027
时,
Figure FDA0003189624690000028
when
Figure FDA0003189624690000027
hour,
Figure FDA0003189624690000028
其中F1,F2,F3,F4非线性对称变换参数,其为常值,其作为第三密钥告知接收方;A5为二次低通滤波矩阵,A6即为所得的非线性对称矩阵;Among them, F 1 , F 2 , F 3 , and F 4 are non-linear symmetric transformation parameters, which are constant values, which are used as the third key to inform the receiver; A 5 is the quadratic low-pass filter matrix, and A 6 is the obtained non-linear Linear symmetric matrix; 步骤S50,将非线性对称矩阵数据进行图像数据转换然后存储为图像文件,完成加密过程,并将加密数据文件发送出去,具体包含如下:Step S50, convert the nonlinear symmetric matrix data to image data and store it as an image file, complete the encryption process, and send the encrypted data file, which specifically includes the following: 首先将所述的非线性对称矩阵A6数据进行归一化变换,得到归一化矩阵,记作A7,其变换如下:First, normalize the data of the nonlinear symmetric matrix A 6 to obtain a normalized matrix, denoted as A 7 , whose transformation is as follows: imax=max(A6);imin=min(A6);i max =max(A 6 ); i min =min(A 6 ); 如果imax≠imin
Figure FDA0003189624690000029
if i max ≠i min ;
Figure FDA0003189624690000029
如果imax=imin>0;A7(i)=1;if i max = i min >0; A 7 (i)=1; 如果imax=imin≤0;A7(i)=0;if i max = i min ≤ 0; A 7 (i)=0; 其中max(A6)表示对矩阵A6的所有元素求最大值,记作imax;min(A6)表示对矩阵A6的所有元素求最小值,记作imin;其次,对A7进行数据重组,将其由1行m*n列矩阵,转换为m行n列矩阵,记作A8;最后,将转换后得到的A8存为图像数据文件,记作rain1.png;至此图像加密过程完成,将加密后的图像文件rain1.png发送给远程接收端;where max(A 6 ) represents the maximum value for all elements of matrix A 6 , denoted as i max ; min(A 6 ) represents the minimum value for all elements of matrix A 6 , which is denoted as i min ; secondly, for A 7 Perform data reorganization, convert it from a 1-row m*n-column matrix into an m-row n-column matrix, denoted as A 8 ; finally, save the converted A 8 as an image data file, denoted as rain1.png; so far The image encryption process is completed, and the encrypted image file rain1.png is sent to the remote receiver; 步骤S60,在接收端接受发送文件并存储为矩阵数据,并进行数据预处理,得到接收端数据矩阵,具体包含如下:Step S60, accepting the sending file at the receiving end and storing it as matrix data, and performing data preprocessing to obtain a data matrix at the receiving end, which specifically includes the following: 首先在远程接收端接收到发送的加密后图像文件,存储为rain2.png;其次,采用计算机对图像文件进行读取后,将数据存储为矩阵,记作A9;该矩阵为m行n列;再将矩阵A9进行数据重组,转换为一维行向量,得到1行m*n列矩阵,记作A10;最后,根据imin与imax对A10进行逆归一化变换,得到接收端数据矩阵A11,其逆归一化变换过程如下:First, the encrypted image file sent by the remote receiver is received and stored as rain2.png; secondly, after the image file is read by a computer, the data is stored as a matrix, denoted as A 9 ; the matrix is m rows and n columns ; Reorganize the data of matrix A 9 and convert it into a one-dimensional row vector to obtain a matrix of 1 row m*n column, which is denoted as A 10 ; Finally, carry out inverse normalization transformation to A 10 according to i min and i max to obtain The receiving end data matrix A 11 , and its inverse normalization transformation process is as follows: 如果imax≠imin;A11(i)=imin+A10(i)(imax-imin);if i max ≠i min ; A 11 (i)=i min +A 10 (i)(i max -i min ); 如果imax=imin>0;A11(i)=imaxif i max =i min >0; A 11 (i)=i max ; 如果imax=imin≤0;A11(i)=iminif i max =i min ≤0; A 11 (i)=i min ; 步骤S70,根据所述第三密钥,对接收端数据矩阵进行非线性对称逆变换,得到非线性对称逆变换矩阵数据,具体包含如下;Step S70: Perform nonlinear symmetric inverse transformation on the receiving end data matrix according to the third key to obtain nonlinear symmetric inverse transformation matrix data, which specifically includes the following;
Figure FDA0003189624690000031
时,
Figure FDA0003189624690000032
when
Figure FDA0003189624690000031
hour,
Figure FDA0003189624690000032
Figure FDA0003189624690000033
时,
Figure FDA0003189624690000034
when
Figure FDA0003189624690000033
hour,
Figure FDA0003189624690000034
其中F1,F2,F3,F4为所述的第三密钥,A11为接收端数据矩阵,A12即为所得的非线性对称逆变换矩阵数据;Wherein F 1 , F 2 , F 3 , and F 4 are the third key, A 11 is the receiving end data matrix, and A 12 is the obtained nonlinear symmetric inverse transformation matrix data; 步骤S80,根据所述的第二密钥,对非线性对称逆变换矩阵进行二次低通滤波逆变换,得到反二次低通滤波矩阵,具体包含如下:Step S80, according to the second key, perform a quadratic low-pass filter inverse transformation on the nonlinear symmetric inverse transformation matrix to obtain an inverse quadratic low-pass filter matrix, which specifically includes the following:
Figure FDA0003189624690000041
Figure FDA0003189624690000041
Figure FDA0003189624690000042
Figure FDA0003189624690000042
Figure FDA0003189624690000043
Figure FDA0003189624690000043
其中W1,W2,W3,W4为第二密钥参数,T0与离散时间常数,A12为非线性对称逆变换矩阵数据,
Figure FDA0003189624690000044
为矩阵A12的速度向量,
Figure FDA0003189624690000045
为矩阵A13的速度向量,A13即为最终得到的反二次低通滤矩阵,其维数为1行m*n列;
Wherein W 1 , W 2 , W 3 , W 4 are the second key parameters, T 0 is the discrete time constant, A 12 is the nonlinear symmetric inverse transformation matrix data,
Figure FDA0003189624690000044
is the velocity vector of matrix A 12 ,
Figure FDA0003189624690000045
is the velocity vector of matrix A 13 , A 13 is the final obtained inverse quadratic low-pass filter matrix, and its dimension is 1 row m*n column;
步骤S90,根据所述的第一密钥,对反二次低通滤波矩阵进行首次低通滤波逆变换,得到首次低通滤波逆矩阵;Step S90, according to the first key, perform the first low-pass filtering inverse transformation on the inverse quadratic low-pass filtering matrix to obtain the first low-pass filtering inverse matrix;
Figure FDA0003189624690000046
Figure FDA0003189624690000046
Figure FDA0003189624690000047
Figure FDA0003189624690000047
其中
Figure FDA0003189624690000048
无需重新进行计算,可采用上一步值,T1,T2,T3,T4为第一密钥参数,T0与离散时间常数,A13为反二次低通滤矩阵,
Figure FDA0003189624690000049
为矩阵A14的速度向量,A14即为最终所求的首次低通滤波逆矩阵,其维数为1行m*n列;
in
Figure FDA0003189624690000048
No need to re-calculate, you can use the values of the previous step, T 1 , T 2 , T 3 , T 4 are the first key parameters, T 0 is the discrete time constant, A 13 is the inverse quadratic low-pass filter matrix,
Figure FDA0003189624690000049
is the velocity vector of the matrix A 14 , and A 14 is the first low-pass filtering inverse matrix finally obtained, and its dimension is 1 row and m*n column;
步骤S100,针对所述的首次低通滤波逆矩阵,进行数据转换,存储为图片数据,得到解密后的文件,完成解密过程,具体如下:Step S100, for the first low-pass filtering inverse matrix, perform data conversion, store as picture data, obtain a decrypted file, and complete the decryption process, as follows: 首先根据所述的首次低通滤波逆矩阵A14转换为图像矩阵格式,即将其由1行m*n列转换为m行n列,得到的矩阵记作A15;然后将A15存储为图像文件,记作rain2.png,即得到最终所解密的文件。First, according to the described first low-pass filtering inverse matrix A 14 is converted into an image matrix format, that is, it is converted from 1 row, m*n column to m row and n column, and the obtained matrix is denoted as A 15 ; then A 15 is stored as an image file, denoted as rain2.png, that is, the final decrypted file is obtained.
CN202010936222.XA 2020-09-08 2020-09-08 Method for realizing image encryption by adopting nonlinear low-pass filtering Expired - Fee Related CN112019701B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010936222.XA CN112019701B (en) 2020-09-08 2020-09-08 Method for realizing image encryption by adopting nonlinear low-pass filtering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010936222.XA CN112019701B (en) 2020-09-08 2020-09-08 Method for realizing image encryption by adopting nonlinear low-pass filtering

Publications (2)

Publication Number Publication Date
CN112019701A CN112019701A (en) 2020-12-01
CN112019701B true CN112019701B (en) 2021-09-21

Family

ID=73521208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010936222.XA Expired - Fee Related CN112019701B (en) 2020-09-08 2020-09-08 Method for realizing image encryption by adopting nonlinear low-pass filtering

Country Status (1)

Country Link
CN (1) CN112019701B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915519A (en) * 2012-09-12 2013-02-06 东北林业大学 Algorithm for encrypting image on basis of chaotic mapping and series changing
CN111581658A (en) * 2020-05-13 2020-08-25 中国人民解放军海军航空大学 Method for encrypting image by adopting bilinear Fourier transform

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8505108B2 (en) * 1993-11-18 2013-08-06 Digimarc Corporation Authentication using a digital watermark
WO2004012384A2 (en) * 2002-07-27 2004-02-05 Xstream Security Solutions Ltd., Llc Apparatus and method for enctyption and decryption
CN103141101B (en) * 2010-09-30 2016-05-11 富士通株式会社 Dynamic image encryption device, dynamic image encryption method, dynamic image decryption device and dynamic image decryption method
CN104050623A (en) * 2014-06-06 2014-09-17 西安理工大学 Asymmetric double-image encryption and decryption method based on chaos and cascade DFrRT

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915519A (en) * 2012-09-12 2013-02-06 东北林业大学 Algorithm for encrypting image on basis of chaotic mapping and series changing
CN111581658A (en) * 2020-05-13 2020-08-25 中国人民解放军海军航空大学 Method for encrypting image by adopting bilinear Fourier transform

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Repeated filtering in consecutive fractional Fourier domains and its application to signal restoration.;M. Fatih Erden等;《IEEE Transactions on Signal Processing》;19991231;第1458-1462页 *
基于分数阶傅里叶变换的数字水印与图像加密研究;郑蕾;《中国优秀硕士学位论文全文数据库 信息科技辑》;20151015;全文 *

Also Published As

Publication number Publication date
CN112019701A (en) 2020-12-01

Similar Documents

Publication Publication Date Title
Qin et al. Reversible data hiding scheme based on exploiting modification direction with two steganographic images
Abd El-Latif et al. A new meaningful secret sharing scheme based on random grids, error diffusion and chaotic encryption
Yin et al. Reversible data hiding in encrypted images based on multi-level encryption and block histogram modification
Selva Mary et al. Secure grayscale image communication using significant visual cryptography scheme in real time applications
Lv et al. A novel scheme for simultaneous image compression and encryption based on wavelet packet transform and multi-chaotic systems
CN110753226A (en) High-capacity ciphertext domain image reversible data hiding method
Chai et al. A robust compressed sensing image encryption algorithm based on GAN and CNN
Mhala et al. Contrast enhancement of progressive visual secret sharing (pvss) scheme for gray-scale and color images using super-resolution
CN112016112B (en) Method for encrypting image by compounding Fourier transform and differential transform
Wang et al. A high capacity data hiding scheme based on re-adjusted GEMD
Hodeish et al. An optimized halftone visual cryptography scheme using error diffusion
Wang et al. A dynamic image encryption algorithm based on improved ant colony walking path thought
CN112019701B (en) Method for realizing image encryption by adopting nonlinear low-pass filtering
Sonar et al. A hybrid steganography technique based on RR, AQVD, and QVC
Altinbaş et al. Bit Reduction based audio steganography algorithm
Punia et al. Innovative image interpolation based reversible data hiding for secure communication
CN111581658B (en) A Method of Image Encryption Using Bilinear Fourier Transform
Chen et al. On the design of a two-decoding-option image secret sharing scheme
Hussein et al. Linear feedback shift registers-based randomization for image steganography
KR20030022484A (en) Method for an Encryption of Multimedia Data
Yan et al. Threshold visual secret sharing with comprehensive properties based on random grids
Kadhim et al. Hidden encrypted text based on secrete map equation and bioinformatics techniques
Li et al. A novel extended secret image sharing scheme based on sharing matrix
CN111246047A (en) Method for realizing image encryption and restoration by adopting differential advance
Holla et al. Progressive Hartley image secret sharing for high-quality image recovery

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210921