CN112383523B - Image encryption method, related device and storage medium - Google Patents

Image encryption method, related device and storage medium Download PDF

Info

Publication number
CN112383523B
CN112383523B CN202011205824.4A CN202011205824A CN112383523B CN 112383523 B CN112383523 B CN 112383523B CN 202011205824 A CN202011205824 A CN 202011205824A CN 112383523 B CN112383523 B CN 112383523B
Authority
CN
China
Prior art keywords
image
encrypted
matrix
feature vector
module
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.)
Active
Application number
CN202011205824.4A
Other languages
Chinese (zh)
Other versions
CN112383523A (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.)
Guowang Xiongan Finance Technology Group Co ltd
State Grid Blockchain Technology Beijing Co ltd
State Grid Digital Technology Holdings Co ltd
Original Assignee
Guowang Xiongan Finance Technology Group Co ltd
State Grid Blockchain Technology Beijing Co ltd
State Grid E Commerce Co Ltd
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 Guowang Xiongan Finance Technology Group Co ltd, State Grid Blockchain Technology Beijing Co ltd, State Grid E Commerce Co Ltd filed Critical Guowang Xiongan Finance Technology Group Co ltd
Priority to CN202011205824.4A priority Critical patent/CN112383523B/en
Publication of CN112383523A publication Critical patent/CN112383523A/en
Application granted granted Critical
Publication of CN112383523B publication Critical patent/CN112383523B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Facsimile Transmission Control (AREA)

Abstract

The application provides an image encryption method and a related device, wherein the method comprises the following steps: inputting an image to be encrypted into a preset neural network model to obtain a characteristic vector of the image to be encrypted; the characteristic vector is a1 XN matrix; converting the image to be encrypted into a1 xM matrix to obtain a converted matrix; the value of M is the total number of pixels in the image to be encrypted; scrambling the converted matrix by adopting the characteristic vector to obtain a scrambled image; performing gamma transformation on the scrambled image to obtain an intermediate ciphertext image; and carrying out preset encryption calculation on the intermediate ciphertext image according to the feature vector to obtain an encrypted image of the image to be encrypted. The method and the device can avoid the problem that in the prior art, lawless persons have poor defense capability for plaintext selective attack due to malicious attack on the key in transmission.

Description

Image encryption method, related device and storage medium
Technical Field
The present application relates to the field of information security, and in particular, to an image encryption method and a related apparatus.
Background
With the development of the internet, more and more information is stored and transmitted in a digital form, and in the digital information, image information is widely applied to information interaction due to the outstanding advantages of being vivid, intuitive, vivid, strong in visualization and the like. In order to increase the security of the image during transmission, the image is generally encrypted, and the encrypted image is transmitted. However, in the network transmission process, unsafe factors of the image information provide a good opportunity for malicious attacks, so that the original image information is possibly attacked, and information leakage or information damage is further caused. Therefore, how to improve the attack resistance is an urgent problem to be solved.
In order to further improve the anti-attack capability in the transmission process, an encryption algorithm based on bit scrambling or chaos sequence is provided to encrypt the image, and then the encrypted image is transmitted. Although the advantages of the original algorithm are retained by the bit scrambling or the encryption algorithm based on the chaotic sequence, the pixel value can be further changed by the bit scrambling, the statistical characteristic of masking the plaintext is achieved, and meanwhile, the chaotic sequence is associated with the plaintext, so that the intermediate key is adaptively changed along with the plaintext, and the attack of selecting the plaintext (secret) can be effectively resisted.
However, after the image is encrypted by adopting the encryption method, the defense force to the chosen plaintext attack is poor in the encrypted image transmission process.
Disclosure of Invention
The application provides an image encryption method and a related device, and aims to solve the problem that the defense capability of an encrypted image against chosen plaintext attack is poor in the transmission process.
In order to achieve the above object, the present application provides the following technical solutions:
the application provides an image encryption method, which comprises the following steps:
inputting an image to be encrypted into a preset neural network model to obtain a characteristic vector of the image to be encrypted; the characteristic vector is a1 XN matrix;
converting the image to be encrypted into a1 xM matrix to obtain a converted matrix; the value of M is the total number of pixels in the image to be encrypted;
scrambling the converted matrix by adopting the characteristic vector to obtain a scrambled image;
performing gamma transformation on the scrambled image to obtain an intermediate ciphertext image;
and carrying out preset encryption calculation on the intermediate ciphertext image according to the feature vector to obtain an encrypted image of the image to be encrypted.
Optionally, scrambling the transformed matrix by using the feature vector to obtain a scrambled image, including:
respectively determining a pixel value at a position indicated by each numerical value of the feature vector from the converted matrix to obtain a pixel value corresponding to each numerical value of the feature vector in the converted matrix;
and sequencing the pixel values corresponding to the numerical values of the feature vectors according to the sequence of the numerical values in the feature vectors to obtain the scrambled image.
Optionally, the performing a preset encryption calculation on the intermediate ciphertext image according to the feature vector to obtain an encrypted image of the image to be encrypted includes:
according to the formula
Figure BDA0002757015680000021
Carrying out encryption calculation to obtain the encrypted image;
said t isiRepresenting the ith numerical value in the feature vector; mod represents a remainder operation; t isiRepresents the formula pair tiThe calculation result of (2); said C isi' represents the ith pixel value in the intermediate ciphertext image; ciRepresenting said C according to said formulai' calculation result.
Optionally, the converting the image to be encrypted into a1 × M matrix to obtain a converted matrix includes:
and traversing pixel values of each row of the image to be encrypted in sequence according to the row sequence of the image to be encrypted to obtain the converted matrix.
The present application also provides an image encryption apparatus, including:
the input module is used for inputting the image to be encrypted into a preset neural network model to obtain a characteristic vector of the image to be encrypted; the characteristic vector is a1 XN matrix;
the conversion module is used for converting the image to be encrypted into a1 xM matrix to obtain a converted matrix; the value of M is the total number of pixels in the image to be encrypted;
the scrambling module is used for scrambling the converted matrix by adopting the characteristic vector to obtain a scrambled image;
the transformation module is used for carrying out gamma transformation on the scrambled image to obtain an intermediate ciphertext image;
and the encryption calculation module is used for carrying out preset encryption calculation on the intermediate ciphertext image according to the characteristic vector to obtain an encrypted image of the image to be encrypted.
Optionally, the scrambling module is configured to scramble the converted matrix by using the feature vector to obtain a scrambled image, and includes:
the scrambling module is specifically configured to determine, from the converted matrix, pixel values at positions indicated by each numerical value of the feature vector, respectively, obtain pixel values corresponding to each numerical value of the feature vector in the converted matrix, and sort the pixel values corresponding to the numerical values of the feature vector according to a sequence of the numerical values in the feature vector, so as to obtain the scrambled image.
Optionally, the encryption calculation module is configured to perform preset encryption calculation on the intermediate ciphertext image according to the feature vector to obtain an encrypted image of the image to be encrypted, and the method includes:
the cryptographic computation module is specifically configured to follow a formula
Figure BDA0002757015680000031
Carrying out encryption calculation to obtain the encrypted image; wherein, t isiRepresenting the ith numerical value in the feature vector; mod represents a remainder operation; t isiRepresents the formula pair tiThe calculation result of (2); said C isi' represents the ith pixel value in the intermediate ciphertext image; ciRepresenting said C according to said formulai' calculation result.
Optionally, the converting module is configured to convert the image to be encrypted into a1 × M matrix to obtain a converted matrix, and includes:
the conversion module is specifically configured to sequentially traverse pixel values of each row of the image to be encrypted according to the row sequence of the image to be encrypted, so as to obtain the converted matrix.
The present application also provides a storage medium including a stored program, wherein the program executes any one of the image encryption methods described above.
The application also provides a device, which comprises at least one processor, at least one memory connected with the processor, and a bus; the processor and the memory complete mutual communication through the bus; the processor is configured to call program instructions in the memory to perform any of the image encryption methods described above.
The image encryption method and the related device input an image to be encrypted into a preset neural network model to obtain a characteristic vector of the image to be encrypted; the characteristic vector is a1 XN matrix; converting the image to be encrypted into a1 xM matrix to obtain a converted matrix; the value of M is the total number of pixels in the image to be encrypted; scrambling the converted matrix by adopting the characteristic vector to obtain a scrambled image; performing gamma transformation on the scrambled image to obtain an intermediate ciphertext image; and carrying out preset encryption calculation on the intermediate ciphertext image according to the feature vector to obtain an encrypted image of the image to be encrypted.
According to the method, the image to be encrypted is scrambled according to the characteristic vector of the image to be encrypted to obtain the scrambled image, the intermediate ciphertext image is obtained by performing gamma conversion on the scrambled image, and the encrypted image is obtained by performing preset encryption calculation on the intermediate ciphertext image. In other words, the encryption process of the image to be encrypted does not involve a key, so that the key does not need to be transmitted in the process of transmitting the encrypted image, and further, the problem that in the prior art, a lawless person has poor defense capability against plaintext selective attack by maliciously attacking the key in transmission can be avoided.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of an image encryption method disclosed in an embodiment of the present application;
fig. 2 is a schematic structural diagram of an image encryption apparatus disclosed in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an apparatus disclosed in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart of an image encryption method provided in an embodiment of the present application, and the method may include the following steps:
s101, inputting the image to be encrypted into a preset neural network model to obtain a feature vector of the image to be encrypted.
In this embodiment, the neural network model may be a VGG deep neural network model, and certainly, in practice, the neural network model may also be other neural network models besides the VGG deep neural network model, and the specific form of the neural network model is not limited in this embodiment.
Optionally, in this step, the preset neural network model may be a trained VGG deep neural network model, where the specific training mode is the prior art and is not described herein again.
In this embodiment, the input of the trained VGG deep neural network model is an image to be encrypted, and the output is a feature vector, where the output feature vector is a1 × N matrix. As an example, in the present embodiment, the feature vector may be expressed as T ═ T1,t2,t3,...,tn}。
S102, converting the image to be encrypted into a1 × M matrix to obtain a converted matrix.
In this step, the value of M is the total number of pixels in the image to be encrypted, for example, the total number of pixels in the image to be encrypted is 10000, and then the size of the converted matrix is 1 × 10000.
Optionally, in this step, the image to be encrypted may be converted into a matrix according to the row sequence of the image to be encrypted. For example, according to the row sequence of the image to be encrypted, the second row of pixels of the image to be encrypted is arranged behind the first row of pixels, the third row of pixels is arranged at the end of the second row of pixels, and so on, the image to be encrypted is converted into a1 × M matrix, and for the convenience of description, the converted matrix is referred to as a converted matrix.
It should be noted that, in this embodiment, converting an image to be encrypted into a matrix according to the row sequence of the image to be encrypted is only a specific implementation manner, and in practice, the image to be encrypted may also be converted into 1 × M according to the column sequence of the image to be encrypted, and this embodiment does not limit the specific conversion manner.
As an example, in this step, the post-conversion matrix may be represented as P ═ { P ═ P1,P2,P3,...,Pm*n-1,Pm*n}。
And S103, scrambling the converted matrix by adopting the characteristic vector to obtain a scrambled image.
In this embodiment, the feature vector is T ═ T1,t2,t3,...,tnConverting the matrix into P ═ P1,P2,P3,...,Pm*n-1,Pm*nFor example, the scrambled image may be represented as P1={P1 1,P1 2,P1 3,...,P1 m*n-1,P1 m*n}
The specific conversion mode is shown in formula (1).
Figure BDA0002757015680000061
In the formula, P1 kRepresenting the kth element in the scrambled image,
Figure BDA0002757015680000062
representing t in the transformed matrixkThe pixel value at the indicated location.
In this embodiment, scrambling the converted matrix by using the feature vector to obtain a scrambled image may include the following steps a1 to a 2:
and A1, respectively determining the pixel value of the position indicated by each numerical value of the feature vector from the converted matrix, and obtaining the corresponding pixel value of each numerical value of the feature vector in the converted matrix.
And the characteristic vector is T ═ T1,t2,t3,...,tnConverting the matrix into P ═ P1,P2,P3,...,Pm*n-1,Pm*nIn this step, for example, from P ═ P1,P2,P3,...,Pm*n-1,Pm*nIn (v), t in the feature vector is determined1,t2,t3,...,tnThe pixel values at the respectively indicated positions.
In this step, for each value in the feature vector, determining the pixel value at the position indicated by the value from the transformed matrix is performed in the same principle, and for the convenience of description, any value (e.g. t) in the feature vector is used1) For example, a process of determining a pixel value at a position indicated by the numerical value from the converted matrix will be described. Specifically, the method may include: let any value be t1And t is1Is 100, the 100 th pixel value from left to right in the converted matrix is determined to obtain t1The corresponding pixel values in the transformed matrix.
And A2, sequencing the pixel values corresponding to the numerical values of the feature vectors according to the sequence of the numerical values in the feature vectors to obtain a scrambled image.
In this step, according to t1,t2,t3,...,tnIn the order of (c), for t1,t2,t3,...,tnAnd sorting the corresponding pixel values respectively to obtain a scrambled image.
And S104, performing gamma conversion on the scrambled image to obtain an intermediate ciphertext image.
In this step, the specific implementation manner of gamma transformation is the prior art, and is not described herein again.
And S105, performing preset encryption calculation on the intermediate ciphertext image according to the feature vector to obtain an encrypted image of the image to be encrypted.
Optionally, in this embodiment, the performing of the preset encryption calculation on the intermediate ciphertext image may include: and (4) carrying out encryption calculation on the intermediate ciphertext image according to the formula (2) to obtain an encrypted image.
Figure BDA0002757015680000071
In the formula, tiRepresenting the ith numerical value in the feature vector, and mod representing the complementation operation; t isiRepresents the formula pair tiThe calculation result of (2); ci' represents the ith pixel value in the intermediate ciphertext image; ciRepresenting said C according to a formulai' calculation result.
The embodiment of the application has the following beneficial effects:
the beneficial effects are that:
in this embodiment, according to a feature vector of an image to be encrypted, an image to be encrypted is scrambled to obtain a scrambled image, an intermediate ciphertext image is obtained by performing gamma conversion on the scrambled image, and a preset encryption calculation is performed on the intermediate ciphertext image to obtain an encrypted image. In other words, the encryption process of the image to be encrypted does not involve a key, so that the key does not need to be transmitted in the process of transmitting the encrypted image, and further, the problem that in the prior art, a lawless person has poor defense capability against plaintext selective attack by maliciously attacking the key in transmission can be avoided.
The beneficial effects are that:
in this embodiment, the image to be encrypted is only required to be input into the neural network model to obtain the feature vector, then the image to be encrypted is scrambled based on the feature vector, and the scrambled image is encrypted to obtain the encrypted image of the image to be encrypted.
The method and the device have the advantages that safer, more convenient and more effective image encryption can be realized, the electronic data security is realized, and the image data privacy is protected.
Fig. 2 is an image encryption apparatus provided in an embodiment of the present application, and the image encryption apparatus may include: an input module 201, a conversion module 202, a scrambling module 203, a transformation module 204, and a cryptographic calculation module 205, wherein,
the input module 201 is configured to input an image to be encrypted into a preset neural network model to obtain a feature vector of the image to be encrypted; the characteristic vector is a1 XN matrix;
a conversion module 202, configured to convert the image to be encrypted into a1 × M matrix, so as to obtain a converted matrix; the value of M is the total number of pixels in the image to be encrypted;
a scrambling module 203, configured to scramble the converted matrix by using the feature vector to obtain a scrambled image;
a transformation module 204, configured to perform gamma transformation on the scrambled image to obtain an intermediate ciphertext image;
and the encryption calculation module 205 is configured to perform preset encryption calculation on the intermediate ciphertext image according to the feature vector, so as to obtain an encrypted image of the image to be encrypted.
Optionally, the scrambling module 203 is configured to scramble the converted matrix by using the feature vector to obtain a scrambled image, and includes:
the scrambling module 203 is specifically configured to determine, from the converted matrix, pixel values at positions indicated by each numerical value of the feature vector, respectively, obtain pixel values corresponding to each numerical value of the feature vector in the converted matrix, and sort the pixel values corresponding to the numerical values of the feature vector according to a sequence of the numerical values in the feature vector, so as to obtain the scrambled image.
Optionally, the encryption calculation module 205 is configured to perform preset encryption calculation on the intermediate ciphertext image according to the feature vector to obtain an encrypted image of the image to be encrypted, and includes:
the encryption calculation module 205 is specifically configured to calculate the encryption according to a formula
Figure BDA0002757015680000081
Carrying out encryption calculation to obtain the encrypted image; wherein, t isiRepresenting the ith numerical value in the feature vector; mod represents a remainder operation; t isiRepresents the formula pair tiThe calculation result of (2); said C isi' represents the ith pixel value in the intermediate ciphertext image; ciRepresenting said C according to said formulai' calculation result.
Optionally, the converting module 202 is configured to convert the image to be encrypted into a1 × M matrix to obtain a converted matrix, and includes:
the conversion module 202 is specifically configured to sequentially traverse pixel values of each row of the image to be encrypted according to the row sequence of the image to be encrypted, so as to obtain the converted matrix.
The image encryption device provided by the embodiment can realize safer, more convenient and more effective image encryption, realize electronic data security and protect image data privacy.
The image encryption device comprises a processor and a memory, wherein the input module 201, the conversion module 202, the scrambling module 203, the transformation module 204, the encryption calculation module 205 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. One or more than one kernel can be set, and the problem of poor defense force against chosen plaintext attack is solved by adjusting kernel parameters.
An embodiment of the present invention provides a storage medium having stored thereon a program that, when executed by a processor, implements the image encryption method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the image encryption method is executed when the program runs.
An embodiment of the present invention provides an apparatus, as shown in fig. 3, the apparatus includes at least one processor, and at least one memory and a bus connected to the processor; the processor and the memory complete mutual communication through a bus; the processor is used for calling the program instructions in the memory to execute the image encryption method. The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
inputting an image to be encrypted into a preset neural network model to obtain a characteristic vector of the image to be encrypted; the characteristic vector is a1 XN matrix;
converting the image to be encrypted into a1 xM matrix to obtain a converted matrix; the value of M is the total number of pixels in the image to be encrypted;
scrambling the converted matrix by adopting the characteristic vector to obtain a scrambled image;
performing gamma transformation on the scrambled image to obtain an intermediate ciphertext image;
and carrying out preset encryption calculation on the intermediate ciphertext image according to the feature vector to obtain an encrypted image of the image to be encrypted.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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.
In a typical configuration, a device includes one or more processors (CPUs), memory, and a bus. The device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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 above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
The functions described in the method of the embodiment of the present application, if implemented in the form of software functional units and sold or used as independent products, may be stored in a storage medium readable by a computing device. Based on such understanding, part of the contribution to the prior art of the embodiments of the present application or part of the technical solution may be embodied in the form of a software product stored in a storage medium and including several instructions for causing a computing device (which may be a personal computer, a server, a mobile computing device or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Features described in the embodiments of the present specification may be replaced with or combined with each other, each embodiment is described with a focus on differences from other embodiments, and the same or similar portions among the embodiments may be referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. An image encryption method, comprising:
inputting an image to be encrypted into a preset neural network model to obtain a characteristic vector of the image to be encrypted; the characteristic vector is a1 XN matrix;
converting the image to be encrypted into a1 xM matrix to obtain a converted matrix; the value of M is the total number of pixels in the image to be encrypted;
scrambling the converted matrix by adopting the characteristic vector to obtain a scrambled image;
performing gamma transformation on the scrambled image to obtain an intermediate ciphertext image;
performing preset encryption calculation on the intermediate ciphertext image according to the feature vector to obtain an encrypted image of the image to be encrypted;
the performing preset encryption calculation on the intermediate ciphertext image according to the feature vector to obtain an encrypted image of the image to be encrypted, includes:
according to the formula
Figure FDA0003420557870000011
Carrying out encryption calculation to obtain the encrypted image;
said t isiRepresenting the ith numerical value in the feature vector; mod represents a remainder operation; t isiRepresents the formula pair tiThe calculation result of (2); c'iRepresenting the ith pixel value in the intermediate ciphertext image; ciRepresenting said C 'according to said formula'iThe calculation result of (2).
2. The method of claim 1, wherein scrambling the transformed matrix using the feature vector to obtain a scrambled image comprises:
respectively determining a pixel value at a position indicated by each numerical value of the feature vector from the converted matrix to obtain a pixel value corresponding to each numerical value of the feature vector in the converted matrix;
and sequencing the pixel values corresponding to the numerical values of the feature vectors according to the sequence of the numerical values in the feature vectors to obtain the scrambled image.
3. The method according to claim 1, wherein the converting the image to be encrypted into a1 xm matrix to obtain a converted matrix comprises:
and traversing pixel values of each row of the image to be encrypted in sequence according to the row sequence of the image to be encrypted to obtain the converted matrix.
4. An image encryption apparatus characterized by comprising:
the input module is used for inputting the image to be encrypted into a preset neural network model to obtain a characteristic vector of the image to be encrypted; the characteristic vector is a1 XN matrix;
the conversion module is used for converting the image to be encrypted into a1 xM matrix to obtain a converted matrix; the value of M is the total number of pixels in the image to be encrypted;
the scrambling module is used for scrambling the converted matrix by adopting the characteristic vector to obtain a scrambled image;
the transformation module is used for carrying out gamma transformation on the scrambled image to obtain an intermediate ciphertext image;
the encryption calculation module is used for carrying out preset encryption calculation on the intermediate ciphertext image according to the feature vector to obtain an encrypted image of the image to be encrypted;
the encryption calculation module is configured to perform preset encryption calculation on the intermediate ciphertext image according to the feature vector to obtain an encrypted image of the image to be encrypted, and includes:
the cryptographic computation module is specifically configured to follow a formula
Figure FDA0003420557870000021
Carrying out encryption calculation to obtain the encrypted image; wherein, t isiRepresenting the ith numerical value in the feature vector; mod represents a remainder operation; t isiRepresents the formula pair tiThe calculation result of (2); c'iRepresenting the ith pixel value in the intermediate ciphertext image; ciRepresenting said C 'according to said formula'iThe calculation result of (2).
5. The apparatus of claim 4, wherein the scrambling module is configured to scramble the transformed matrix using the feature vector to obtain a scrambled image, and includes:
the scrambling module is specifically configured to determine, from the converted matrix, a pixel value at a position indicated by each numerical value of the feature vector, obtain a pixel value corresponding to each numerical value of the feature vector in the converted matrix, and sort the pixel values corresponding to the numerical values of the feature vector according to a sequence of the numerical values in the feature vector, so as to obtain the scrambled image.
6. The apparatus according to claim 4, wherein the converting module is configured to convert the image to be encrypted into a1 xm matrix, and obtain a converted matrix, and includes:
the conversion module is specifically configured to sequentially traverse pixel values of each row of the image to be encrypted according to the row sequence of the image to be encrypted, so as to obtain the converted matrix.
7. A storage medium comprising a stored program, wherein the program executes the image encryption method according to any one of claims 1 to 3.
8. An apparatus comprising at least one processor, and at least one memory, bus connected to the processor; the processor and the memory complete mutual communication through the bus; the processor is used for calling the program instructions in the memory to execute the image encryption method according to any one of claims 1-3.
CN202011205824.4A 2020-11-02 2020-11-02 Image encryption method, related device and storage medium Active CN112383523B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011205824.4A CN112383523B (en) 2020-11-02 2020-11-02 Image encryption method, related device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011205824.4A CN112383523B (en) 2020-11-02 2020-11-02 Image encryption method, related device and storage medium

Publications (2)

Publication Number Publication Date
CN112383523A CN112383523A (en) 2021-02-19
CN112383523B true CN112383523B (en) 2022-02-22

Family

ID=74577647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011205824.4A Active CN112383523B (en) 2020-11-02 2020-11-02 Image encryption method, related device and storage medium

Country Status (1)

Country Link
CN (1) CN112383523B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113132080A (en) * 2021-04-19 2021-07-16 青岛冠成软件有限公司 Image processing method and device, electronic equipment and storage medium
CN114915464A (en) * 2022-05-06 2022-08-16 长江大学 Image encryption method and image decryption method based on special matrix operation
CN117951754B (en) * 2024-03-27 2024-06-07 国网山东省电力公司济南供电公司 Electronic seal encryption and decryption method, device and medium based on deep learning

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050617A (en) * 2013-09-25 2014-09-17 上海理工大学 Method for image encryption based on Liu chaotic system
CN106485742A (en) * 2016-07-26 2017-03-08 上海海洋大学 A kind of remote sensing images based on Arnold chaotic maps encrypt search method
CN106570814A (en) * 2016-10-17 2017-04-19 广东工业大学 Novel hyper-chaotic image encryption method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8442221B2 (en) * 2005-09-30 2013-05-14 Konica Minolta Laboratory U.S.A., Inc. Method and apparatus for image encryption and embedding and related applications
US11558176B2 (en) * 2017-02-15 2023-01-17 Lg Electronics Inc. Apparatus and method for generating ciphertext data with maintained structure for analytics capability
CN108270944B (en) * 2018-01-02 2019-12-24 北京邮电大学 Digital image encryption method and device based on fractional order transformation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050617A (en) * 2013-09-25 2014-09-17 上海理工大学 Method for image encryption based on Liu chaotic system
CN106485742A (en) * 2016-07-26 2017-03-08 上海海洋大学 A kind of remote sensing images based on Arnold chaotic maps encrypt search method
CN106570814A (en) * 2016-10-17 2017-04-19 广东工业大学 Novel hyper-chaotic image encryption method

Also Published As

Publication number Publication date
CN112383523A (en) 2021-02-19

Similar Documents

Publication Publication Date Title
CN112383523B (en) Image encryption method, related device and storage medium
CN1993922B (en) Stream cipher combining system and method
CN108494546B (en) White box encryption method and device and storage medium
Mandal et al. Symmetric key image encryption using chaotic Rossler system
CN110266682B (en) Data encryption method and device, mobile terminal and decryption method
CN105447404B (en) The method and system of image secret protection in a kind of cloud storage
CN110505054B (en) Data processing method, device and equipment based on dynamic white box
CN107832635A (en) Access right control method, device, equipment and computer-readable recording medium
CN115189878A (en) Shared data sorting method based on secret sharing and electronic equipment
CN113055153A (en) Data encryption method, system and medium based on fully homomorphic encryption algorithm
US20160315761A1 (en) Operator lifting in cryptographic algorithm
CN114419719B (en) Biological characteristic processing method and device
EP3439225A1 (en) Method to secure a software code performing accesses to look-up tables
CN115085974A (en) Flow confusion method and device
CN111092721B (en) Method and device for setting access password
CN107689867A (en) A kind of cryptographic key protection method and system under open environment
CN113612799A (en) Block chain hash encryption method and device based on SM2 algorithm
Qi et al. Privacy-Preserving Image Classification Using ConvMixer with Adaptive Permutation Matrix
CN108574566A (en) A kind of whitepack encipher-decipher method, device and storage medium
Yassir et al. Hybrid Image Encryption Technique for Securing Color Images Transmitted Over Cloud Networks.
CN109918927A (en) A kind of image encryption method and device
CN114817970B (en) Data analysis method and system based on data source protection and related equipment
CN103780377B (en) A kind of method and system that data are carried out with secrecy processing
KR102404223B1 (en) Apparatus and method for encryption generating using key dependent layer, computer-readable storage medium and computer program
CN113806775B (en) Block chain message processing method and device based on convolution optimization

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 100032 room 8018, 8 / F, building 7, Guangyi street, Xicheng District, Beijing

Patentee after: State Grid Digital Technology Holdings Co.,Ltd.

Patentee after: State Grid blockchain Technology (Beijing) Co.,Ltd.

Patentee after: Guowang Xiongan Finance Technology Group Co.,Ltd.

Address before: 100053 8th floor, Xianglong business building, 311 guanganmennei street, Xicheng District, Beijing

Patentee before: STATE GRID ELECTRONIC COMMERCE Co.,Ltd.

Patentee before: State Grid blockchain Technology (Beijing) Co.,Ltd.

Patentee before: Guowang Xiongan Finance Technology Group Co.,Ltd.