[go: up one dir, main page]

CN116309164A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN116309164A
CN116309164A CN202310280707.1A CN202310280707A CN116309164A CN 116309164 A CN116309164 A CN 116309164A CN 202310280707 A CN202310280707 A CN 202310280707A CN 116309164 A CN116309164 A CN 116309164A
Authority
CN
China
Prior art keywords
image
encrypted
chaos
chaotic
conversion
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
Application number
CN202310280707.1A
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310280707.1A priority Critical patent/CN116309164A/en
Publication of CN116309164A publication Critical patent/CN116309164A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2211/00Indexing scheme relating to details of data-processing equipment not covered by groups G06F3/00 - G06F13/00
    • G06F2211/007Encryption, En-/decode, En-/decipher, En-/decypher, Scramble, (De-)compress
    • G06F2211/008Public Key, Asymmetric Key, Asymmetric Encryption
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2201/00General purpose image data processing
    • G06T2201/005Image watermarking
    • G06T2201/0061Embedding of the watermark in each block of the image, e.g. segmented watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides an image processing method and device, relates to the technical field of information security, and can be used in the financial field or other technical fields. The method comprises the following steps: dividing an image to be encrypted to obtain image blocks, determining the iteration times of chaotic mapping according to the image size of the image to be encrypted, and generating a chaotic sequence according to chaotic mapping parameters and the iteration times; calculating a hash value of an image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaotic number of a chaotic sequence according to each fragment and the image size, determining the conversion times of cat face conversion corresponding to each image block respectively according to each chaotic number, and respectively carrying out cat face conversion on each image block according to each conversion time to obtain an encrypted image after block conversion scrambling; and obtaining an optimized image according to the encrypted image. The apparatus performs the above method. The image processing method and the device provided by the embodiment of the invention ensure the safety of the image and also improve the resolution of the image.

Description

Image processing method and device
Technical Field
The invention relates to the technical field of information security, in particular to an image processing method and device.
Background
Image recognition is widely used in various business scenes of banks, such as face authentication recognition, fingerprint recognition, personal identification card related information recognition and the like. With rapid development of network technology and multimedia technology, digital images are one of the most important information carriers, and particularly, application requirements in the fields of business, finance and the like are continuously increasing. Therefore, security research of digital images has received a great deal of attention.
In the encryption and decryption process of the image, the image is effectively hidden and encrypted, and the image is restored almost without detail loss or distortion. In order to ensure that the image is not distorted, the conventional image encryption technology generally uses a complex encryption algorithm, which not only increases the computational complexity in the decryption process and greatly reduces the decryption efficiency, but also causes distortion phenomenon.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides an image processing method and an image processing device, which can at least partially solve the problems in the prior art.
In one aspect, the present invention provides an image processing method, including:
dividing an image to be encrypted to obtain image blocks, determining the iteration times of chaotic mapping according to the image size of the image to be encrypted, and generating a chaotic sequence according to chaotic mapping parameters and the iteration times;
Calculating a hash value of the image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaos number of the chaos sequence according to each fragment and the image size, determining the conversion times of cat face conversion corresponding to each image block according to each chaos number, and respectively carrying out cat face conversion on each image block according to each conversion time to obtain an encrypted image after block conversion scrambling;
and restoring the encrypted image to obtain an original image, and restoring the original image according to a mapping relation between a low-resolution image and a high-resolution image which are learned in advance to obtain an optimized image.
Wherein the determining the chaos number of the chaos sequence according to each segment and the image size comprises:
performing data conversion on each segment to obtain decimal numbers;
and respectively performing remainder calculation on each decimal number according to the image size to obtain the chaos number of the chaos sequence.
The determining the conversion times of the cat face conversion corresponding to each image block according to each chaos number comprises the following steps:
and rounding each chaotic number to obtain integer values corresponding to each chaotic number, and determining each integer value as the conversion times of the cat face conversion corresponding to each image block.
The method for rounding the chaos numbers to obtain integer values corresponding to the chaos numbers respectively comprises the following steps:
and determining parameters of the remainder function according to the control factors, and calculating according to the remainder function after the parameters are determined to obtain integer values corresponding to the chaos numbers respectively.
Before the step of segmenting the image to be encrypted to obtain each image block, the image processing method further comprises the following steps:
performing degradation treatment on the image to be encrypted to obtain a low-resolution image;
and determining the image to be encrypted as a high-resolution image, and learning a mapping relation between the low-resolution image and the high-resolution image.
Wherein the image processing method further comprises:
performing cat face conversion on the mapping relation, wherein the conversion times are random numbers, and obtaining a mapping relation after scrambling and encryption;
obtaining scrambling parameters; the scrambling parameters comprise the number of image blocks, the control factor, the cat face transformation parameters, the random number and the chaotic mapping parameters;
and taking the scrambling parameter as a plaintext, and carrying out public key encryption on the plaintext to obtain a ciphertext.
After the step of performing public key encryption on the plaintext to obtain ciphertext, the image processing method further comprises the following steps:
Decrypting the ciphertext by using a private key to obtain the scrambling parameter;
and restoring the mapping relation between the encrypted image and the scrambled encryption by using the scrambling parameters to obtain the original image and the mapping relation.
In one aspect, the present invention provides an image processing apparatus including:
the generation unit is used for segmenting the image to be encrypted to obtain image blocks, determining the iteration times of the chaotic mapping according to the image size of the image to be encrypted, and generating a chaotic sequence according to the chaotic mapping parameters and the iteration times;
the transformation unit is used for calculating the hash value of the image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaos number of the chaos sequence according to each fragment and the image size, determining the transformation times of cat face transformation corresponding to each image block according to each chaos number, and respectively carrying out cat face transformation on each image block according to each transformation times to obtain the encrypted image after block transformation scrambling;
and the restoration unit is used for restoring the encrypted image to obtain an original image, and restoring the original image according to the mapping relation between the pre-learned low-resolution image and the high-resolution image to obtain an optimized image.
In still another aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory, and a bus, wherein,
the processor and the memory complete communication with each other through the bus;
the memory stores program instructions executable by the processor, the processor invoking the program instructions capable of performing the method of:
dividing an image to be encrypted to obtain image blocks, determining the iteration times of chaotic mapping according to the image size of the image to be encrypted, and generating a chaotic sequence according to chaotic mapping parameters and the iteration times;
calculating a hash value of the image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaos number of the chaos sequence according to each fragment and the image size, determining the conversion times of cat face conversion corresponding to each image block according to each chaos number, and respectively carrying out cat face conversion on each image block according to each conversion time to obtain an encrypted image after block conversion scrambling;
and restoring the encrypted image to obtain an original image, and restoring the original image according to a mapping relation between a low-resolution image and a high-resolution image which are learned in advance to obtain an optimized image.
Embodiments of the present invention provide a non-transitory computer readable storage medium comprising:
the non-transitory computer readable storage medium stores computer instructions that cause the computer to perform the method of:
dividing an image to be encrypted to obtain image blocks, determining the iteration times of chaotic mapping according to the image size of the image to be encrypted, and generating a chaotic sequence according to chaotic mapping parameters and the iteration times;
calculating a hash value of the image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaos number of the chaos sequence according to each fragment and the image size, determining the conversion times of cat face conversion corresponding to each image block according to each chaos number, and respectively carrying out cat face conversion on each image block according to each conversion time to obtain an encrypted image after block conversion scrambling;
and restoring the encrypted image to obtain an original image, and restoring the original image according to a mapping relation between a low-resolution image and a high-resolution image which are learned in advance to obtain an optimized image.
According to the image processing method and the device provided by the embodiment of the invention, the image to be encrypted is segmented to obtain each image block, the iteration times of the chaotic mapping are determined according to the image size of the image to be encrypted, and the chaotic sequence is generated according to the chaotic mapping parameters and the iteration times; calculating a hash value of the image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaos number of the chaos sequence according to each fragment and the image size, determining the conversion times of cat face conversion corresponding to each image block according to each chaos number, and respectively carrying out cat face conversion on each image block according to each conversion time to obtain an encrypted image after block conversion scrambling; and restoring the encrypted image to obtain an original image, and restoring the original image according to the mapping relation between the pre-learned low-resolution image and the high-resolution image to obtain an optimized image, so that the safety of the image is effectively ensured, and the resolution of the image is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. In the drawings:
fig. 1 is a flowchart of an image processing method according to an embodiment of the present invention.
Fig. 2 is a flowchart of an image processing method according to another embodiment of the present invention.
Fig. 3 is a schematic diagram illustrating a degradation process of an image to be encrypted according to an embodiment of the present invention.
Fig. 4 is a schematic diagram illustrating a flow of a deep learning algorithm according to an embodiment of the present invention.
Fig. 5 is a schematic diagram illustrating a convolutional neural network flow provided in an embodiment of the present invention.
Fig. 6 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention.
Fig. 7 is a schematic diagram of an entity structure of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in further detail with reference to the accompanying drawings. The exemplary embodiments of the present invention and their descriptions herein are for the purpose of explaining the present invention, but are not to be construed as limiting the invention. It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be arbitrarily combined with each other.
Fig. 1 is a flowchart of an image processing method according to an embodiment of the present invention, and as shown in fig. 1, the image processing method according to the embodiment of the present invention includes:
step S1: the image to be encrypted is segmented to obtain image blocks, the iteration times of the chaotic mapping are determined according to the image size of the image to be encrypted, and a chaotic sequence is generated according to the chaotic mapping parameters and the iteration times.
Step S2: calculating the hash value of the image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaos number of the chaos sequence according to each fragment and the image size, determining the conversion times of cat face conversion corresponding to each image block according to each chaos number, and respectively carrying out cat face conversion on each image block according to each conversion time to obtain the encrypted image after block conversion scrambling.
Step S3: and restoring the encrypted image to obtain an original image, and restoring the original image according to a mapping relation between a low-resolution image and a high-resolution image which are learned in advance to obtain an optimized image.
In the step S1, the device segments the image to be encrypted to obtain each image block, determines the iteration number of the chaotic map according to the image size of the image to be encrypted, and generates the chaotic sequence according to the chaotic map parameters and the iteration number. The apparatus may be a computer device, for example a server, performing the method. It should be noted that, the data acquisition and analysis according to the embodiments of the present invention are authorized by the user. The image to be encrypted may further be a gray scale image to be encrypted.
The image a to be encrypted may be represented by a matrix, the size of which is denoted as m×m (M is the image size), the elements in the matrix represent pixel gray values, and the positions of the matrix elements represent pixel positions.
If the number of rows and the number of columns of the matrix are different, the matrix can be supplemented to obtain the matrix with the same number of rows and columns.
As shown in fig. 2, the number of image blocks of each image block obtained after the segmentation is denoted by l.
If the image size is M, the number of iterations of the chaotic map is M.
The chaotic mapping can be specifically a Sine chaotic mapping, and the chaotic mapping parameters can comprise a given initial value X (0) and a system parameter alpha; correspondingly, generating the chaotic sequence according to the chaotic mapping parameter and the iteration times comprises the following steps:
m times of iteration is carried out on the Sine chaotic mapping with the given initial value X (0) and the system parameter alpha, and the size of 1 times of iteration is generated 2 Is a one-dimensional chaotic sequence, and can be expressed as
Figure BDA0004137985550000061
In the step S2, the device calculates the hash value of the image to be encrypted, equally divides the hash value to obtain segments with the same number as the image blocks, determines the chaos number of the chaos sequence according to each segment and the image size, determines the conversion times of the cat face conversion corresponding to each image block according to each chaos number, and respectively performs the cat face conversion on each image block according to each conversion time to obtain the encrypted image after the block conversion scrambling.
Further, a hash value of the image to be encrypted may be calculated using a secure hash algorithm-512 (SHA-512), the result of the calculation being a 512-bit binary number.
The determining the chaos number of the chaos sequence according to each segment and the image size comprises the following steps:
performing data conversion on each segment to obtain decimal numbers;
and respectively performing remainder calculation on each decimal number according to the image size to obtain the chaos number of the chaos sequence.
The hash value may be divided into l fragments, the remaining insufficient digits are padded with 0, and each fragment is converted into a decimal number n= (N) 1 ,N 2 ,...,N l )。
Selecting the chaos number from the chaos sequence K by taking the decimal numbers as the digits to obtain
Figure BDA0004137985550000064
N j =mod(N j ,M 2 ) And j=1, 2,..i.
The determining the transformation times of the cat face transformation corresponding to each image block according to each chaos number comprises the following steps:
and rounding each chaotic number to obtain integer values corresponding to each chaotic number, and determining each integer value as the conversion times of the cat face conversion corresponding to each image block.
The rounding of the chaos numbers is performed to obtain integer values corresponding to the chaos numbers, including:
and determining parameters of the remainder function according to the control factors, and calculating according to the remainder function after the parameters are determined to obtain integer values corresponding to the chaos numbers respectively.
For the chaos number
Figure BDA0004137985550000062
Rounding to obtain +.>
Figure BDA0004137985550000063
And j=1, 2, l, wherein beta is a control factor.
And respectively carrying out cat face transformation on each image block according to each transformation frequency to obtain an encrypted image after block transformation scrambling, wherein the method comprises the following steps:
will k 1 ,k 2 ,...,k l And respectively taking the number of transformation times of the cat face transformation on each image block, and carrying out the cat face transformation on each image block to obtain an encrypted image A' after the block transformation is scrambled, wherein the cat face transformation is Arnold transformation.
In the step S3, the device performs restoration processing on the encrypted image to obtain an original image, and restores the original image according to the mapping relationship between the low-resolution image and the high-resolution image learned in advance to obtain an optimized image. And (3) carrying out restoration processing on the encrypted image A' to obtain an original image A, recovering a high-resolution image in the image A by utilizing a mapping relation F obtained by deep learning, namely, further optimizing the image on the basis of the original image A, and taking the high-resolution image obtained by optimizing as an optimized image.
As shown in fig. 2, before the step of segmenting the image to be encrypted to obtain each image block, the image processing method further includes:
performing degradation treatment on the image to be encrypted to obtain a low-resolution image; the low resolution image is denoted B and is also of size M x M.
And determining the image to be encrypted as a high-resolution image, and learning a mapping relation between the low-resolution image and the high-resolution image, wherein the mapping relation is marked as F, and the size of the mapping relation is M multiplied by M.
The element representation in the mapping relation matrix is the mapping relation of the pixels from low resolution to high resolution, and the position of the matrix element represents the pixel position.
The image processing method further includes:
performing cat face conversion on the mapping relation, wherein the conversion times are random numbers, and obtaining a mapping relation after scrambling and encryption; the random number is marked as k 'and can be randomly generated, and the mapping relation after scrambling and encryption is marked as F'.
Obtaining scrambling parameters; the scrambling parameters comprise the number of image blocks, the control factor, the cat face transformation parameters, the random number and the chaotic mapping parameters; the cat face transformation parameters can refer to the following Arnold block transformation related description, namely a and b.
And taking the scrambling parameter as a plaintext, and carrying out public key encryption on the plaintext to obtain a ciphertext.
The scrambling parameters (l, beta, a, b, k', X (0), alpha) =P are taken as plaintext, and public key encryption is carried out on the plaintext by using an RSA encryption algorithm to obtain ciphertext R.
After the step of public key encrypting the plaintext to obtain ciphertext, the image processing method further includes:
Decrypting the ciphertext by using a private key to obtain the scrambling parameter; decrypting the ciphertext R by using the RSA private key to obtain scrambling parameters (l, beta, a, b, X (0), alpha).
And restoring the mapping relation between the encrypted image and the scrambled encryption by using the scrambling parameters to obtain the original image and the mapping relation. And (3) restoring the encrypted image A 'and the scrambled and encrypted mapping relation F' by using (l, beta, a, b, X (0), alpha) to obtain an original image A and the mapping relation F.
As shown in fig. 3, the degradation operation of the image to be encrypted is explained as follows:
the degradation of the image refers to the prior blurring operation on the real high-resolution image, and a low-resolution image of the high-resolution image is obtained. The degradation operation of the embodiment of the invention adopts the operations of fuzzy processing, downsampling processing, noise degradation and the like. The blurring process is simulated by two convolutions, downsampling is randomly chosen from nearest neighbor, bilinear and bicubic interpolation, and noise is generated by Gaussian noise at different noise levels, picture compression of different compression qualities, and the like.
The degradation process formula is expressed as follows:
Figure BDA0004137985550000081
wherein,,
Figure BDA0004137985550000082
representing a low resolution graph, I representing a high resolution graph, k representing a blur kernel, n' representing gaussian noise, ∈ s Representing downsampling by a factor s,/>
Figure BDA0004137985550000083
Representing a convolution operation.
The inverse process of degradation is formulated as follows:
Figure BDA0004137985550000084
wherein,,
Figure BDA0004137985550000085
representing a high resolution estimation map, ">
Figure BDA0004137985550000086
Representing a low resolution map, phi -1 Represents inverse transform, θ β Representing various factors that cause image blurring, such as noise, motion blurring, etc.
As shown in fig. 4, the deep learning algorithm is described as follows:
firstly, acquiring an image to be encrypted, performing degradation operation on the image to be encrypted to obtain a low-resolution image, and taking the undegraded image to be encrypted as a high-resolution image; and then the low-resolution image and the high-resolution image are sent into a convolutional neural network together for learning, before the low-resolution image and the high-resolution image are sent into the convolutional neural network, the high-resolution image block and the low-resolution image block which are in one-to-one correspondence are firstly extracted, then the one-to-one image block is sent into the convolutional neural network for learning a transformation matrix from the low-resolution image to the high-resolution image, and the transformation matrix is continuously and iteratively optimized under the constraint of a mean square error loss function, so that the mapping relation F is finally obtained.
The mean square error loss function is as follows:
Figure BDA0004137985550000087
wherein,,
Figure BDA0004137985550000088
is the judgment result of the convolutional neural network, y i Is the true result, n is the number of samples.
As shown in fig. 5, the convolutional neural network is described as follows:
The convolutional neural network comprises 8 convolutional layers, before the convolutional neural network processes an image, image blocks corresponding to the input low-resolution and high-resolution images one by one are extracted, the extracted image blocks are sent into the 8 convolutional layers, features between the low-resolution and high-resolution image blocks are learned, and finally the features of the low-resolution and high-resolution image blocks are spliced to obtain features of the low-resolution and high-resolution image.
The above-mentioned fine chaotic map is additionally described as follows:
the Sine chaotic mapping is a one-dimensional chaotic mapping algorithm, and the formula is as follows:
X(t+1)=αsin[πX(t)],t=0,1,2,...,n (4)
wherein X (t) is a mapping variable; alpha is a system parameter.
The Arnold block transformation is supplemented as follows:
assuming that the gray-scale image to be encrypted is a two-dimensional matrix A with the size of N multiplied by N, the Arnold transformation formula of the two-dimensional image is as follows:
Figure BDA0004137985550000091
where x and y represent the position of a certain pixel in a gray scale image of size n×n before transformation; n is the size of the matrix; x 'and y' represent pixel positions after transformation; a and b are control parameters.
The Arnold block transformation inverse transformation formula is:
Figure BDA0004137985550000092
because of the periodicity of the Arnold transformation, the image after k scrambling is transformed again (T-k) times and restored to the original image, assuming the periodicity is T, and the periodicity T is positively correlated with the size N of the image matrix. In order to solve the problems, the invention adopts a block transformation strategy to divide the original image into l blocks, and Arnold transformation is respectively carried out for each sub-block, and the scrambling frequency of each sub-block is k 1 ,k 2 ,...,k l The sizes of the encrypted images are different, so that the risk that the encrypted images are easily restored is effectively avoided.
The Logistic chaotic map is supplemented as follows:
the Logistic mapping is a one-dimensional chaotic mapping algorithm, and the formula is as follows:
Y(t+1)=μY(t)[1-Y(t)],t=0,1,2,...,n,μ∈(0,4) (4)
wherein Y (t) is a mapping variable; μ is a system parameter. When 0 < Y (0) < 1 and 3.5699456 < mu < 4 are satisfied, the Logistic function is in a chaotic state, i.e., an unpredictable, unordered digital sequence is generated. For a given initial value of Y (0), iterating n×n times to generate Y (1), Y (2), Y (N 2 ) A set of unordered sequences.
The specific formula of the array x (i) normalization operation is as follows:
x'(i)=mod(256×x(i),256),(i=1,2,...,N 2 ) (5)
the specific formulas for the operation of the bitwise exclusive OR operation are as follows:
D(i)=bitxor(x'(i),C(i)),(i=1,2,...,N 2 ) (6)
wherein, the function bitxor function is: and performing bit exclusive OR operation on x' (i) and C (i), and returning the value to be D (i). Meanwhile, as can be seen from the exclusive-or characteristic, the same exclusive-or is used twice for a certain value in succession to restore to the original value. C (i) is a matrix element in the above matrix C.
The embodiment of the invention combines the deep learning technology with the image encryption and decryption technology, learns the mapping relation of the image from low resolution to high resolution through the deep learning technology, and simultaneously encrypts the image to be encrypted and the mapping relation by utilizing unordered Arnold transformation. In order to effectively avoid the risk of easy restoration of Arnold transformation after multiple transformation, the embodiment of the invention blocks the image to be encrypted, determines the transformation times of different blocks by introducing hash values and the Sine chaotic mapping and taking the hash values as the bit numbers of the chaotic sequence, increases the randomness of the transformation times of each block, and effectively avoids the risk of easy restoration of the image to be encrypted.
In order to further ensure the safety of the encrypted image, each scrambling parameter of the unordered block transformation is used as a plaintext, and public key encryption is carried out on the encrypted image by using an RSA asymmetric encryption algorithm. After the ciphertext is acquired, the encrypted ciphertext is decrypted by using an RSA private key to acquire scrambling parameters, the encrypted image and the mapping relation are restored, and the decrypted mapping relation is used for restoring the high-resolution image in the decrypted image, so that the safety of the image is effectively ensured, and the resolution of the image is improved.
According to the image processing method provided by the embodiment of the invention, an image to be encrypted is segmented to obtain each image block, the iteration number of chaotic mapping is determined according to the image size of the image to be encrypted, and a chaotic sequence is generated according to the chaotic mapping parameters and the iteration number; calculating a hash value of the image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaos number of the chaos sequence according to each fragment and the image size, determining the conversion times of cat face conversion corresponding to each image block according to each chaos number, and respectively carrying out cat face conversion on each image block according to each conversion time to obtain an encrypted image after block conversion scrambling; and restoring the encrypted image to obtain an original image, and restoring the original image according to the mapping relation between the pre-learned low-resolution image and the high-resolution image to obtain an optimized image, so that the safety of the image is effectively ensured, and the resolution of the image is improved.
Further, the determining the chaos number of the chaos sequence according to each segment and the image size includes:
performing data conversion on each segment to obtain decimal numbers; reference may be made to the above embodiments, and no further description is given.
And respectively performing remainder calculation on each decimal number according to the image size to obtain the chaos number of the chaos sequence. Reference may be made to the above embodiments, and no further description is given.
The image processing method provided by the embodiment of the invention can quickly and conveniently determine the chaos number of the chaos sequence.
Further, the determining the number of transformation times of the cat face transformation corresponding to each image block according to each chaos number includes:
and rounding each chaotic number to obtain integer values corresponding to each chaotic number, and determining each integer value as the conversion times of the cat face conversion corresponding to each image block. Reference may be made to the above embodiments, and no further description is given.
The image processing method provided by the embodiment of the invention can rapidly and conveniently determine the conversion times of the cat face conversion corresponding to each image block.
Further, the rounding the chaos numbers to obtain integer values corresponding to the chaos numbers, respectively, includes:
And determining parameters of the remainder function according to the control factors, and calculating according to the remainder function after the parameters are determined to obtain integer values corresponding to the chaos numbers respectively. Reference may be made to the above embodiments, and no further description is given.
The image processing method provided by the embodiment of the invention can further quickly and conveniently determine the chaos number of the chaos sequence.
Further, before the step of segmenting the image to be encrypted to obtain each image block, the image processing method further includes:
performing degradation treatment on the image to be encrypted to obtain a low-resolution image; reference may be made to the above embodiments, and no further description is given.
And determining the image to be encrypted as a high-resolution image, and learning a mapping relation between the low-resolution image and the high-resolution image. Reference may be made to the above embodiments, and no further description is given.
The image processing method provided by the embodiment of the invention can effectively learn the mapping relation.
Further, the image processing method further includes:
performing cat face conversion on the mapping relation, wherein the conversion times are random numbers, and obtaining a mapping relation after scrambling and encryption; reference may be made to the above embodiments, and no further description is given.
Obtaining scrambling parameters; the scrambling parameters comprise the number of image blocks, the control factor, the cat face transformation parameters, the random number and the chaotic mapping parameters; reference may be made to the above embodiments, and no further description is given.
And taking the scrambling parameter as a plaintext, and carrying out public key encryption on the plaintext to obtain a ciphertext. Reference may be made to the above embodiments, and no further description is given.
The image processing method provided by the embodiment of the invention further ensures the information security of the scrambling parameters.
Further, after the step of public key encrypting the plaintext to obtain ciphertext, the image processing method further includes:
decrypting the ciphertext by using a private key to obtain the scrambling parameter; reference may be made to the above embodiments, and no further description is given.
And restoring the mapping relation between the encrypted image and the scrambled encryption by using the scrambling parameters to obtain the original image and the mapping relation. Reference may be made to the above embodiments, and no further description is given.
The image processing method provided by the embodiment of the invention can further rapidly and conveniently acquire the original image and the mapping relation.
It should be noted that, the image processing method provided by the embodiment of the present invention may be used in the financial field, and may also be used in any technical field other than the financial field.
Fig. 6 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention, and as shown in fig. 6, the image processing apparatus according to an embodiment of the present invention includes a generating unit 601, a transforming unit 602, and a recovering unit 603, where:
the generating unit 601 is configured to segment an image to be encrypted to obtain image blocks, determine iteration times of chaotic mapping according to an image size of the image to be encrypted, and generate a chaotic sequence according to chaotic mapping parameters and the iteration times; the transformation unit 602 is configured to calculate a hash value of the image to be encrypted, equally divide the hash value to obtain segments equal to the number of image blocks, determine the chaotic number of the chaotic sequence according to each segment and the image size, determine the transformation times of cat face transformation corresponding to each image block according to each chaotic number, and respectively perform cat face transformation on each image block according to each transformation times to obtain an encrypted image after block transformation scrambling; the restoration unit 603 is configured to restore the encrypted image to obtain an original image, and restore the original image according to a mapping relationship between a low resolution image and a high resolution image learned in advance to obtain an optimized image.
Specifically, a generating unit 601 in the device is configured to segment an image to be encrypted to obtain each image block, determine the iteration number of the chaotic map according to the image size of the image to be encrypted, and generate a chaotic sequence according to the chaotic map parameter and the iteration number; the transformation unit 602 is configured to calculate a hash value of the image to be encrypted, equally divide the hash value to obtain segments equal to the number of image blocks, determine the chaotic number of the chaotic sequence according to each segment and the image size, determine the transformation times of cat face transformation corresponding to each image block according to each chaotic number, and respectively perform cat face transformation on each image block according to each transformation times to obtain an encrypted image after block transformation scrambling; the restoration unit 603 is configured to restore the encrypted image to obtain an original image, and restore the original image according to a mapping relationship between a low resolution image and a high resolution image learned in advance to obtain an optimized image.
The image processing device provided by the embodiment of the invention is used for segmenting an image to be encrypted to obtain each image block, determining the iteration times of chaotic mapping according to the image size of the image to be encrypted, and generating a chaotic sequence according to the chaotic mapping parameters and the iteration times; calculating a hash value of the image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaos number of the chaos sequence according to each fragment and the image size, determining the conversion times of cat face conversion corresponding to each image block according to each chaos number, and respectively carrying out cat face conversion on each image block according to each conversion time to obtain an encrypted image after block conversion scrambling; and restoring the encrypted image to obtain an original image, and restoring the original image according to the mapping relation between the pre-learned low-resolution image and the high-resolution image to obtain an optimized image, so that the safety of the image is effectively ensured, and the resolution of the image is improved.
Further, the transforming unit 602 is specifically configured to:
performing data conversion on each segment to obtain decimal numbers;
and respectively performing remainder calculation on each decimal number according to the image size to obtain the chaos number of the chaos sequence.
The image processing device provided by the embodiment of the invention can quickly and conveniently determine the chaos number of the chaos sequence.
Further, the transforming unit 602 is specifically configured to:
and rounding each chaotic number to obtain integer values corresponding to each chaotic number, and determining each integer value as the conversion times of the cat face conversion corresponding to each image block.
The image processing device provided by the embodiment of the invention can quickly and conveniently determine the conversion times of the cat face conversion corresponding to each image block.
Further, the transforming unit 602 is specifically further configured to:
and determining parameters of the remainder function according to the control factors, and calculating according to the remainder function after the parameters are determined to obtain integer values corresponding to the chaos numbers respectively.
The image processing device provided by the embodiment of the invention can further quickly and conveniently determine the chaos number of the chaos sequence.
Further, before the step of segmenting the image to be encrypted to obtain each image block, the image processing device is further configured to:
Performing degradation treatment on the image to be encrypted to obtain a low-resolution image;
and determining the image to be encrypted as a high-resolution image, and learning a mapping relation between the low-resolution image and the high-resolution image.
The image processing device provided by the embodiment of the invention can effectively learn the mapping relation.
Further, the image processing apparatus is further configured to:
performing cat face conversion on the mapping relation, wherein the conversion times are random numbers, and obtaining a mapping relation after scrambling and encryption;
obtaining scrambling parameters; the scrambling parameters comprise the number of image blocks, the control factor, the cat face transformation parameters, the random number and the chaotic mapping parameters;
and taking the scrambling parameter as a plaintext, and carrying out public key encryption on the plaintext to obtain a ciphertext.
The image processing device provided by the embodiment of the invention further ensures the information security of the scrambling parameters.
Further, after the step of public key encrypting the plaintext to obtain ciphertext, the image processing apparatus is further configured to:
decrypting the ciphertext by using a private key to obtain the scrambling parameter;
and restoring the mapping relation between the encrypted image and the scrambled encryption by using the scrambling parameters to obtain the original image and the mapping relation.
The image processing device provided by the embodiment of the invention can further rapidly and conveniently acquire the original image and the mapping relation.
The embodiment of the present invention provides a processing flow of an image processing apparatus, which may be specifically used to execute the above embodiments of the method, and the functions thereof are not described herein in detail, and reference may be made to the detailed description of the above embodiments of the method.
Fig. 7 is a schematic diagram of an entity structure of an electronic device according to an embodiment of the present invention, as shown in fig. 7, where the electronic device includes: a processor (processor) 701, a memory (memory) 702, and a bus 703;
wherein, the processor 701 and the memory 702 complete communication with each other through the bus 703;
the processor 701 is configured to invoke the program instructions in the memory 702 to perform the methods provided in the above method embodiments, for example, including:
dividing an image to be encrypted to obtain image blocks, determining the iteration times of chaotic mapping according to the image size of the image to be encrypted, and generating a chaotic sequence according to chaotic mapping parameters and the iteration times;
calculating a hash value of the image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaos number of the chaos sequence according to each fragment and the image size, determining the conversion times of cat face conversion corresponding to each image block according to each chaos number, and respectively carrying out cat face conversion on each image block according to each conversion time to obtain an encrypted image after block conversion scrambling;
And restoring the encrypted image to obtain an original image, and restoring the original image according to a mapping relation between a low-resolution image and a high-resolution image which are learned in advance to obtain an optimized image.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, are capable of performing the methods provided by the above-described method embodiments, for example comprising:
dividing an image to be encrypted to obtain image blocks, determining the iteration times of chaotic mapping according to the image size of the image to be encrypted, and generating a chaotic sequence according to chaotic mapping parameters and the iteration times;
calculating a hash value of the image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaos number of the chaos sequence according to each fragment and the image size, determining the conversion times of cat face conversion corresponding to each image block according to each chaos number, and respectively carrying out cat face conversion on each image block according to each conversion time to obtain an encrypted image after block conversion scrambling;
And restoring the encrypted image to obtain an original image, and restoring the original image according to a mapping relation between a low-resolution image and a high-resolution image which are learned in advance to obtain an optimized image.
The present embodiment provides a computer-readable storage medium storing a computer program that causes the computer to execute the methods provided by the above-described method embodiments, for example, including:
dividing an image to be encrypted to obtain image blocks, determining the iteration times of chaotic mapping according to the image size of the image to be encrypted, and generating a chaotic sequence according to chaotic mapping parameters and the iteration times;
calculating a hash value of the image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaos number of the chaos sequence according to each fragment and the image size, determining the conversion times of cat face conversion corresponding to each image block according to each chaos number, and respectively carrying out cat face conversion on each image block according to each conversion time to obtain an encrypted image after block conversion scrambling;
and restoring the encrypted image to obtain an original image, and restoring the original image according to a mapping relation between a low-resolution image and a high-resolution image which are learned in advance to obtain an optimized image.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the description of the present specification, reference to the terms "one embodiment," "one particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (10)

1. An image processing method, comprising:
dividing an image to be encrypted to obtain image blocks, determining the iteration times of chaotic mapping according to the image size of the image to be encrypted, and generating a chaotic sequence according to chaotic mapping parameters and the iteration times;
calculating a hash value of the image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaos number of the chaos sequence according to each fragment and the image size, determining the conversion times of cat face conversion corresponding to each image block according to each chaos number, and respectively carrying out cat face conversion on each image block according to each conversion time to obtain an encrypted image after block conversion scrambling;
And restoring the encrypted image to obtain an original image, and restoring the original image according to a mapping relation between a low-resolution image and a high-resolution image which are learned in advance to obtain an optimized image.
2. The image processing method according to claim 1, wherein the determining the chaos number of the chaos sequence according to each segment and the image size includes:
performing data conversion on each segment to obtain decimal numbers;
and respectively performing remainder calculation on each decimal number according to the image size to obtain the chaos number of the chaos sequence.
3. The image processing method according to claim 1, wherein the determining the number of transformations of the cat face corresponding to each image block according to each chaos number includes:
and rounding each chaotic number to obtain integer values corresponding to each chaotic number, and determining each integer value as the conversion times of the cat face conversion corresponding to each image block.
4. The image processing method according to claim 3, wherein the rounding of each of the chaos numbers to obtain integer values corresponding to each of the chaos numbers, respectively, comprises:
And determining parameters of the remainder function according to the control factors, and calculating according to the remainder function after the parameters are determined to obtain integer values corresponding to the chaos numbers respectively.
5. The image processing method according to claim 4, wherein before the step of segmenting the image to be encrypted to obtain image blocks, the image processing method further comprises:
performing degradation treatment on the image to be encrypted to obtain a low-resolution image;
and determining the image to be encrypted as a high-resolution image, and learning a mapping relation between the low-resolution image and the high-resolution image.
6. The image processing method according to claim 5, characterized in that the image processing method further comprises:
performing cat face conversion on the mapping relation, wherein the conversion times are random numbers, and obtaining a mapping relation after scrambling and encryption;
obtaining scrambling parameters; the scrambling parameters comprise the number of image blocks, the control factor, the cat face transformation parameters, the random number and the chaotic mapping parameters;
and taking the scrambling parameter as a plaintext, and carrying out public key encryption on the plaintext to obtain a ciphertext.
7. The image processing method according to claim 6, wherein after the step of public key encrypting the plaintext to obtain ciphertext, the image processing method further comprises:
Decrypting the ciphertext by using a private key to obtain the scrambling parameter;
and restoring the mapping relation between the encrypted image and the scrambled encryption by using the scrambling parameters to obtain the original image and the mapping relation.
8. An image processing apparatus, comprising:
the generation unit is used for segmenting the image to be encrypted to obtain image blocks, determining the iteration times of the chaotic mapping according to the image size of the image to be encrypted, and generating a chaotic sequence according to the chaotic mapping parameters and the iteration times;
the transformation unit is used for calculating the hash value of the image to be encrypted, equally dividing the hash value to obtain fragments with the same number as the image blocks, determining the chaos number of the chaos sequence according to each fragment and the image size, determining the transformation times of cat face transformation corresponding to each image block according to each chaos number, and respectively carrying out cat face transformation on each image block according to each transformation times to obtain the encrypted image after block transformation scrambling;
and the restoration unit is used for restoring the encrypted image to obtain an original image, and restoring the original image according to the mapping relation between the pre-learned low-resolution image and the high-resolution image to obtain an optimized image.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any one of claims 1 to 7 when the computer program is executed by the processor.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
CN202310280707.1A 2023-03-21 2023-03-21 Image processing method and device Pending CN116309164A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310280707.1A CN116309164A (en) 2023-03-21 2023-03-21 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310280707.1A CN116309164A (en) 2023-03-21 2023-03-21 Image processing method and device

Publications (1)

Publication Number Publication Date
CN116309164A true CN116309164A (en) 2023-06-23

Family

ID=86783133

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310280707.1A Pending CN116309164A (en) 2023-03-21 2023-03-21 Image processing method and device

Country Status (1)

Country Link
CN (1) CN116309164A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116633683A (en) * 2023-07-18 2023-08-22 中国人民解放军国防科技大学 Single-pixel imaging asymmetric encryption method based on 3D Arnod transformation

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116633683A (en) * 2023-07-18 2023-08-22 中国人民解放军国防科技大学 Single-pixel imaging asymmetric encryption method based on 3D Arnod transformation
CN116633683B (en) * 2023-07-18 2023-11-03 中国人民解放军国防科技大学 Single-pixel imaging asymmetric encryption method based on 3D Arnod transformation

Similar Documents

Publication Publication Date Title
Dhawan et al. Analysis of various data security techniques of steganography: A survey
Liu et al. Three-level quantum image encryption based on Arnold transform and logistic map
Zhou et al. Novel quantum image compression and encryption algorithm based on DQWT and 3D hyper-chaotic Henon map
Jiang et al. A novel strategy for quantum image steganography based on Moiré pattern
Nguyen et al. An adaptive multi bit-plane image steganography using block data-hiding
Broumandnia Designing digital image encryption using 2D and 3D reversible modular chaotic maps
Musanna et al. Image encryption using quantum 3-D Baker map and generalized gray code coupled with fractional Chen’s chaotic system
CN107659753B (en) Image compression encryption method
US9825761B2 (en) Systems and methods improving cryptosystems with biometrics
CN116305211A (en) Image encryption processing method and device
CN107239709B (en) Chaotic image encryption method, device and system
CN110519037A (en) The image encryption method of ultra-chaos pseudo random sequence
Ma et al. Quantum color image compression and encryption algorithm based on Fibonacci transform
CN108199828A (en) A kind of color image Encryption Algorithm and device
Naseri et al. A new quantum gray-scale image encoding scheme
Dai et al. SWT-DCT-based robust watermarking for medical image
Kumar et al. Image scrambling encryption using chaotic map and genetic algorithm: a hybrid approach for enhanced security
CN116309164A (en) Image processing method and device
CN106530197A (en) Image encryption method based on Kent mapping and generalized Gray codes
Caragata et al. Cryptanalysis of an improved fragile watermarking scheme
CN112887075B (en) Encryption method of similar full-connection network image based on plaintext correlation
Hazzazi et al. Enhancing image security via chaotic maps, Fibonacci, Tribonacci transformations, and DWT diffusion: a robust data encryption approach
Holla et al. A GPU scheme for multi-secret visual sharing with varied secret dimensions and contrast enhancement using blind super-resolution
CN116886272A (en) Image encryption method, device, electronic equipment and computer readable storage medium
CN117041440A (en) Image encryption method, device, computer readable storage medium and electronic equipment

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