CN112214776B - Encryption and decryption method and device based on convolutional neural network - Google Patents

Encryption and decryption method and device based on convolutional neural network Download PDF

Info

Publication number
CN112214776B
CN112214776B CN202011079560.2A CN202011079560A CN112214776B CN 112214776 B CN112214776 B CN 112214776B CN 202011079560 A CN202011079560 A CN 202011079560A CN 112214776 B CN112214776 B CN 112214776B
Authority
CN
China
Prior art keywords
data
preset
plaintext
neural network
convolutional neural
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
CN202011079560.2A
Other languages
Chinese (zh)
Other versions
CN112214776A (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.)
Shanghai Shuangshen Information Technology Co ltd
Original Assignee
Shanghai Shuangshen Information Technology 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 Shanghai Shuangshen Information Technology Co ltd filed Critical Shanghai Shuangshen Information Technology Co ltd
Priority to CN202011079560.2A priority Critical patent/CN112214776B/en
Publication of CN112214776A publication Critical patent/CN112214776A/en
Application granted granted Critical
Publication of CN112214776B publication Critical patent/CN112214776B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioethics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Storage Device Security (AREA)

Abstract

The application provides an encryption and decryption method based on a convolutional neural network and a related device, and relates to the technical field of information security. The encryption method comprises the following steps: processing the plaintext data based on a convolutional neural network to obtain intermediate data and result data, encrypting the intermediate data and the plaintext data based on preset data and the result data respectively to obtain first data and second data, and outputting ciphertext data; the decryption method comprises the following steps: the first data are decrypted based on the preset data to obtain intermediate data, the intermediate data are processed based on the convolutional neural network to obtain result data, and the second data are decrypted based on the result data to obtain plaintext data. According to the technical scheme, the ciphertext data decoding difficulty can be effectively increased, and the safety of data information is improved.

Description

Encryption and decryption method and device based on convolutional neural network
Technical Field
The present application relates to the field of information security technologies, and in particular, to an encryption and decryption method and apparatus based on a convolutional neural network.
Background
With the development of the times, people pay more and more attention to the security of data information, and how to improve the encryption method of the data information becomes the key point of research in the field.
The existing encryption and decryption technologies usually perform direct encryption processing on plaintext data based on a preset key to obtain ciphertext data of the plaintext data, and a user can perform decryption processing on the ciphertext data based on the preset key to obtain the plaintext data. The existing encryption and decryption technologies have the defects that if a preset key is stolen, ciphertext data is very easy to be decoded by a person who steals the key, so that the safety of data information processed based on the existing encryption and decryption technologies is very low.
Disclosure of Invention
The application provides an encryption and decryption method and device based on a convolutional neural network, which can effectively improve the security of data information.
In order to achieve the above technical effects, a first aspect of the present application provides an encryption method based on a convolutional neural network, including:
inputting plaintext data into a preset convolutional neural network to obtain intermediate data and result data, wherein the intermediate data is data output by an intermediate stage in the convolutional neural network, and the result data is data finally output by the convolutional neural network;
encrypting the intermediate data based on preset data to obtain first data;
encrypting the plaintext data based on the result data to obtain second data;
and outputting ciphertext data of the plaintext data based on the first data and the second data.
Based on the first aspect of the present application, in a first possible implementation manner, the encrypting the intermediate data based on preset data to obtain first data includes:
encoding the intermediate data based on preset data to obtain first data;
the encrypting the plaintext data based on the result data to obtain second data includes:
and encoding the plaintext data based on the result data to obtain second data.
Based on the first possible implementation manner of the first aspect of the present application, in a second possible implementation manner, the preset data includes: presetting a variance and a mean value;
the encoding the intermediate data based on the preset data to obtain the first data includes:
respectively mapping each number of the intermediate data to a corresponding numerical value interval based on a preset first interval mapping relation;
determining a first probability distribution function based on the preset variance and the preset mean;
determining a probability of each number in the intermediate data based on the first probability distribution function and a numerical interval to which each number in the intermediate data is mapped;
and carrying out interval coding on the intermediate data based on the probability corresponding to each number in the intermediate data and a first preset initial interval to obtain first data.
In a third possible implementation manner, based on the first possible implementation manner of the first aspect of the present application, the output layer of the convolutional neural network includes a first output layer and a second output layer, and the result data includes first result data output by the first output layer and second result data output by the second output layer;
the encoding the plaintext data based on the result data to obtain second data includes:
respectively mapping each number of the plaintext data to a corresponding numerical value interval based on a preset second interval mapping relation;
determining at least one second probability distribution function based on said first result data and said second result data;
determining the probability corresponding to each number in the plaintext data based on the at least one second probability distribution function and the numerical value interval corresponding to each number in the plaintext data;
and carrying out interval coding on the plaintext data based on the probability corresponding to each number in the plaintext data and a second preset initial interval to obtain second data.
Based on the third possible implementation manner of the first aspect of the present application, in a fourth possible implementation manner, the length of the first result data, the length of the second result data, and the length of the plaintext data are all equal;
said determining at least one second probability distribution function based on said first result data and said second result data comprises:
corresponding each number in the plaintext data to the number in the first result data and the number in the second result data one by one;
respectively determining a second probability distribution function of corresponding numbers in the plaintext data by taking the number in the first result data as a variance and the number in the second result data as a mean;
the determining, based on the at least one second probability distribution function and the numerical value intervals corresponding to the numbers in the plaintext data, the probability corresponding to each number in the plaintext data is specifically:
and determining the probability corresponding to each number in the plaintext data respectively based on the numerical value interval corresponding to each number in the plaintext data and the second probability distribution function of the corresponding number.
A second aspect of the present application provides a decryption method based on a convolutional neural network, including:
acquiring first data and second data corresponding to the ciphertext data;
decrypting the first data based on preset data to obtain intermediate data;
taking the intermediate data as the output of an intermediate stage in a preset convolutional neural network to trigger the convolutional neural network to perform the processing after the intermediate stage on the intermediate data to obtain result data, wherein the result data is the data finally output by the convolutional neural network;
and decrypting the second data based on the result data to obtain plaintext data of the ciphertext data.
A third aspect of the present application provides an encryption apparatus based on a convolutional neural network, including:
the device comprises an input unit, a data processing unit and a data processing unit, wherein the input unit is used for inputting plaintext data into a preset convolutional neural network so as to obtain intermediate data and result data, the intermediate data is data output by an intermediate stage in the convolutional neural network, and the result data is data finally output by the convolutional neural network;
the first encryption unit is used for encrypting the intermediate data based on preset data to obtain first data;
a second encryption unit, configured to encrypt the plaintext data based on the result data to obtain second data;
and an output unit configured to output ciphertext data of the plaintext data based on the first data and the second data.
Based on the third aspect of the present application, in a first possible implementation manner, the first encryption unit is specifically configured to:
encoding the intermediate data based on preset data to obtain first data;
the second encryption unit is specifically configured to:
and encoding the plaintext data based on the result data to obtain second data.
Based on the first possible implementation manner of the third aspect of the present application, in a second possible implementation manner, the preset data includes: presetting a variance and a mean value;
the first encryption unit is specifically configured to:
respectively mapping each number of the intermediate data to a corresponding numerical value interval based on a preset first interval mapping relation;
determining a first probability distribution function based on the preset variance and the preset mean;
determining a probability of each number in the intermediate data based on the first probability distribution function and a numerical interval to which each number in the intermediate data is mapped;
and carrying out interval coding on the intermediate data based on the probability corresponding to each number in the intermediate data and a first preset initial interval to obtain first data.
A fourth aspect of the present application provides a decryption apparatus based on a convolutional neural network, including:
the acquiring unit is used for acquiring first data and second data corresponding to the ciphertext data;
the first decryption unit is used for decrypting the first data based on preset data to obtain intermediate data;
the output unit is used for taking the intermediate data as the output of an intermediate stage in a preset convolutional neural network so as to trigger the convolutional neural network to execute the processing after the intermediate stage on the intermediate data to obtain result data, wherein the result data is the data finally output by the convolutional neural network;
and the second decryption unit is used for decrypting the second data based on the result data to obtain the plaintext data of the ciphertext data.
As can be seen from the above, in the technical scheme provided by the application, during encryption, plaintext data is processed based on a convolutional neural network to obtain intermediate data and result data, and the intermediate data and the plaintext data are encrypted based on preset data and the result data respectively to obtain first data and second data so as to output ciphertext data; during decryption, the first data are decrypted based on the preset data to obtain intermediate data, the intermediate data are processed based on the convolutional neural network to obtain result data, and the second data are decrypted based on the result data to obtain plaintext data. Therefore, when the technical scheme provided by the application is used for encrypting, intermediate data and result data are obtained based on plaintext data and a convolutional neural network, the intermediate data are encrypted based on preset data, and the plaintext data are encrypted based on the result data to obtain first data and second data so as to output ciphertext data; based on the encryption method, when the ciphertext data is decrypted, the plaintext data is obtained by decrypting the ciphertext data based on the preset data, the first data, the second data and the preset convolutional neural network, and if any one or more of the preset data, the first data, the second data and the preset convolutional neural network is/are lacked, the plaintext data cannot be obtained by decrypting, so that the decryption difficulty of the ciphertext data is increased, and the safety of data information is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a schematic flowchart of an embodiment of an encryption method based on a convolutional neural network provided in the present application;
FIG. 2 is a schematic structural diagram of a convolutional neural network provided in the present application;
FIG. 3 is a flowchart illustrating an embodiment of a convolutional neural network-based decryption method provided in the present application;
fig. 4 is a schematic structural diagram of an embodiment of an encryption apparatus based on a convolutional neural network provided in the present application;
fig. 5 is a schematic structural diagram of an embodiment of a decryption apparatus based on a convolutional neural network provided in the present application;
fig. 6 is a schematic structural diagram of another embodiment of an encryption apparatus based on a convolutional neural network provided in the present application;
fig. 7 is a schematic structural diagram of another embodiment of a decryption device based on a convolutional neural network according to the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The technical solutions in the embodiments of the present application are 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.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application, but the present application may be practiced in other ways than those described herein, and it will be apparent to those of ordinary skill in the art that the present application is not limited by the specific embodiments disclosed below.
Example one
The present application provides an encryption method based on a convolutional neural network, as shown in fig. 1, including:
step 101, inputting plaintext data into a preset convolutional neural network to obtain intermediate data and result data;
wherein, the intermediate data is data output by an intermediate stage in the convolutional neural network, and the result data is data finally output by the convolutional neural network;
in this embodiment, the predetermined convolutional neural network may include more than one convolutional layers, the intermediate data may be data output by one convolutional layer of the more than one convolutional layers except the input layer and the output layer after plaintext data is input into the convolutional neural network, and the result data may be data output by one convolutional layer of the more than one convolutional layers serving as an output layer after plaintext data is input into the convolutional neural network.
Optionally, before the plaintext data is input into a preset convolutional neural network to obtain intermediate data and result data, the encryption algorithm further includes:
and (3) carrying out one-dimensional treatment on the plaintext data so as to enable the plaintext data to store data in a one-dimensional array form, wherein convolution kernels in the convolution neural network are all one-dimensional convolution kernels.
Step 102, encrypting the intermediate data based on preset data to obtain first data;
in this embodiment of the application, the intermediate data may be encrypted based on the preset data and any encryption method, and the finally obtained data is the first data.
Optionally, the encrypting the intermediate data based on the preset data to obtain the first data includes:
encoding the intermediate data based on preset data to obtain first data;
the encrypting the plaintext data based on the result data to obtain second data includes:
and coding the plaintext data based on the result data to obtain second data.
Specifically, when the intermediate data is encoded based on the preset data or the plaintext data is encoded based on the result data, the encoding method that can be used may be one or more of interval encoding, arithmetic encoding, huffman encoding, and other encoding methods.
Further, the preset data includes: presetting a variance and a mean value;
the encoding the intermediate data based on the preset data to obtain first data includes:
respectively mapping each number of the intermediate data to a corresponding numerical value interval based on a preset first interval mapping relation;
determining a first probability distribution function based on the preset variance and the preset mean;
determining a probability of each number in the intermediate data based on the first probability distribution function and a numerical interval to which each number in the intermediate data is mapped;
and carrying out interval coding on the intermediate data based on the probability corresponding to each number in the intermediate data and a first preset initial interval to obtain first data.
Specifically, before the intermediate data is encoded based on the preset data to obtain the first data, the encryption method further includes:
performing integer processing on each number of the intermediate data based on a preset integer principle;
the mapping, based on the preset first interval mapping relationship, each number of the intermediate data to a corresponding numerical interval specifically includes:
mapping each integer of the intermediate data to a numerical value interval with an interval width of one, wherein the numerical value intervals mapped by different integers have no intersection; the mapping may be performed in the following manner, for example as follows: integer-1 maps to interval (-1.5, -0.5), integer 0 maps to interval (-0.5,0.5), integer 1 maps to interval (0.5,1.5) … … integer X maps to (X-0.5, X + 0.5), where X is any integer;
the determining the probability of each number in the intermediate data based on the first probability distribution function and the numerical value interval to which each number in the intermediate data is mapped specifically includes:
and substituting the numerical value intervals mapped by the integers into the first probability distribution function respectively to obtain the probability of the numerical value intervals mapped by the integers in the intermediate data, and taking the probability of the numerical value intervals mapped by the integers in the intermediate data as the probability of the corresponding integers.
It should be noted that, after a probability is given to each number in the intermediate data, the intermediate data may be partitioned based on the probability so as to perform interval coding on the intermediate data subsequently; the integer of a number based on the predetermined integer principle may be obtained by multiplying the number by a predetermined value and then rounding off the fractional part.
103, encrypting the plaintext data based on the result data to obtain second data;
in this embodiment of the present application, the plaintext data may be encrypted based on the result data and any encryption method, and the finally obtained data is the second data.
Optionally, the encrypting the intermediate data based on the preset data to obtain the first data includes:
encoding the intermediate data based on preset data to obtain first data;
the encrypting the plaintext data based on the result data to obtain second data includes:
and encoding the plaintext data based on the result data to obtain second data.
Specifically, when the intermediate data is encoded based on the preset data or the plaintext data is encoded based on the result data, the encoding method that can be used may be one or more of interval encoding, arithmetic encoding, huffman encoding, and other encoding methods.
Further, the output layer of the convolutional neural network includes a first output layer and a second output layer, and the result data includes first result data output by the first output layer and second result data output by the second output layer;
the encoding the plaintext data based on the result data to obtain second data includes:
respectively mapping each number of the plaintext data to a corresponding numerical value interval based on a preset second interval mapping relation;
determining at least one second probability distribution function based on said first result data and said second result data;
determining the probability corresponding to each number in the plaintext data based on the at least one second probability distribution function and the numerical value interval corresponding to each number in the plaintext data;
and carrying out interval coding on the plaintext data based on the probability corresponding to each number in the plaintext data and a second preset initial interval to obtain second data.
Specifically, before encoding the plaintext data based on the result data to obtain second data, the encryption method further includes:
performing integer processing on each number of the plaintext data based on a preset integer principle;
the mapping, based on the preset second interval mapping relationship, each number of the plaintext data to a corresponding numerical interval specifically includes:
mapping each integer of the plaintext data to a numerical value interval with an interval width of one, wherein the numerical value intervals mapped by different integers have no intersection; the mapping may be performed in the following manner, for example as follows: integer-1 maps to interval (-1.5, -0.5), integer 0 maps to interval (-0.5,0.5), integer 1 maps to interval (0.5,1.5) … … integer X maps to (X-0.5, X + 0.5), where X is any integer;
the determining, based on the at least one second probability distribution function and the numerical value intervals corresponding to the numbers in the plaintext data, the probability corresponding to each number in the plaintext data is specifically:
respectively corresponding the numerical value intervals corresponding to the integers in the plaintext data to one second probability distribution function in the at least one second probability distribution function;
and substituting the numerical value intervals corresponding to the integers in the plaintext data into the corresponding second probability distribution functions respectively to obtain the probabilities of the numerical value intervals corresponding to the integers in the plaintext data, and taking the probabilities of the numerical value intervals corresponding to the integers in the plaintext data as the probabilities of the corresponding integers.
It should be noted that, after a probability is given to each number in the plaintext data, the plaintext data may be partitioned based on the probability so as to perform block coding on the plaintext data subsequently; the integer of a number based on the predetermined integer principle may be obtained by multiplying the number by a predetermined value and then rounding off the fractional part.
Further, the length of the first result data, the length of the second result data, and the length of the plaintext data are all equal;
said determining at least one second probability distribution function based on said first result data and said second result data comprises:
corresponding each number in the plaintext data to the number in the first result data and the number in the second result data one by one;
respectively determining second probability distribution functions of corresponding numbers in the plaintext data by taking the numbers in the first result data as variances and taking the numbers in the second result data as mean values;
the determining, based on the at least one second probability distribution function and the numerical value intervals corresponding to the numbers in the plaintext data, the probability corresponding to each number in the plaintext data is specifically:
and determining the probability corresponding to each number in the plaintext data respectively based on the numerical value interval corresponding to each number in the plaintext data and the second probability distribution function of the corresponding number.
And 104, outputting ciphertext data of the plaintext data based on the first data and the second data.
In this embodiment, the first data and the second data may be stored in the ciphertext data to obtain ciphertext data including the first data and the second data; or, the encryption processing may be performed based on the first data, the second data, and any encryption method, and the finally obtained data is ciphertext data.
In practical applications, as shown in fig. 2, the convolutional neural network may include: a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, a seventh convolutional layer, and an eighth convolutional layer;
the first convolutional layer is an input layer, an output of the first convolutional layer is connected with an input of the second convolutional layer, outputs of the second convolutional layer are respectively connected with inputs of the third convolutional layer, the fourth convolutional layer, the fifth convolutional layer and the sixth convolutional layer, outputs of the third convolutional layer, the fourth convolutional layer, the fifth convolutional layer and the sixth convolutional layer are respectively connected with an input of the seventh convolutional layer, outputs of the third convolutional layer, the fourth convolutional layer, the fifth convolutional layer and the sixth convolutional layer are respectively connected with an input of the eighth convolutional layer, the seventh convolutional layer and the eighth convolutional layer are output layers, the seventh convolutional layer is a first output layer, and the eighth convolutional layer is a second output layer;
based on the convolutional neural network shown in fig. 2, the encryption method may include:
inputting the plaintext data into a first convolutional layer, determining data output through sequential processing of the first convolutional layer and a second convolutional layer as the intermediate data, outputting four data through processing of a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer and a sixth convolutional layer, tiling the four data to form one data, outputting the first result data and the second result data through processing of a seventh convolutional layer and an eighth convolutional layer, respectively, then encrypting the intermediate data based on preset data to obtain the first data, encrypting the plaintext data based on the first result data and the second result data to obtain the second data, and finally outputting ciphertext data of the plaintext data based on the first data and the second data;
the first convolution layer and the second convolution layer may be convolution down-sampling layers.
Specifically, the convolutional neural network may be a convolutional neural network obtained by training based on a preset sample set, where the preset sample set may be any type of data sample set.
As can be seen from the above, in the technical scheme provided by the application, when encrypting, plaintext data is processed based on a convolutional neural network to obtain intermediate data and result data, and the intermediate data and the plaintext data are encrypted based on preset data and the result data respectively to obtain first data and second data so as to output ciphertext data. Therefore, when the technical scheme provided by the application is used for encrypting, the intermediate data and the result data are obtained based on the plaintext data and the convolutional neural network, the intermediate data are encrypted based on the preset data, the plaintext data are encrypted based on the result data, the first data and the second data are obtained, and the ciphertext data are output; based on the encryption method, when the ciphertext data is decrypted, the plaintext data is obtained by decrypting based on the preset data, the first data, the second data and the preset convolutional neural network, and if any one or more of the preset data, the first data, the second data and the preset convolutional neural network is/are lacked, the plaintext data cannot be obtained by decrypting, so that the decryption difficulty of the ciphertext data is increased, and the safety of data information is improved.
Example two
The present application further provides a decryption method based on a convolutional neural network, as shown in fig. 3, including:
step 301, acquiring first data and second data corresponding to ciphertext data;
in this embodiment, if the ciphertext data has the complete first data and the complete second data, the first data and the second data may be directly obtained from the ciphertext data; if the ciphertext data is obtained by performing encryption processing based on the first data, the second data and an encryption method, the ciphertext data is decrypted based on a decryption method corresponding to the encryption method, and the obtained data are the first data and the second data.
Step 302, decrypting the first data based on preset data to obtain intermediate data;
in this embodiment, the first data may be decrypted based on preset data and a corresponding decryption method that are used when the first data is formed by encryption, and the finally obtained data is intermediate data.
Optionally, if the first data is encoded based on the preset data, the decrypting the first data based on the preset data to obtain intermediate data specifically includes:
decoding the first data based on preset data to obtain intermediate data, wherein the decoding method adopted by the decoding is as follows: a decoding method corresponding to the encoding method forming the first data.
Further, if the first data is data formed by performing interval coding based on the preset data, the decrypting the first data based on the preset data to obtain intermediate data specifically includes:
determining a first probability distribution function based on the preset data, wherein the preset data comprises: presetting a variance and a mean value;
and performing interval decoding on the first data based on the first probability distribution function, a preset first interval mapping relation and a first preset initial interval to obtain intermediate data.
Specifically, before the first data is encrypted and formed, integers of each number of the intermediate data are processed based on a preset integer principle, and after the first data is decrypted based on the preset data to obtain intermediate data, each number of the intermediate data is restored based on a preset restoration principle, wherein the preset restoration principle is a processing principle corresponding to the preset integer principle and capable of restoring the number to the number before the integers are processed.
Step 303, taking the intermediate data as an output of an intermediate stage in a preset convolutional neural network, so as to trigger the convolutional neural network to perform processing after the intermediate stage on the intermediate data, so as to obtain result data;
wherein, the result data is the data finally output by the convolutional neural network;
in this embodiment, the intermediate data is input to the output position of the corresponding intermediate stage, that is, the position of the intermediate data during encryption, so that the convolutional neural network is triggered to perform the post-intermediate-stage processing on the intermediate data to obtain the result data.
And step 304, decrypting the second data based on the result data to obtain plaintext data of the ciphertext data.
In this embodiment of the present application, the second data may be decrypted based on a decryption method corresponding to an encryption method used when the second data is formed by encryption, and the finally obtained data is plaintext data.
Optionally, if the second data is data formed by encoding based on the result data, the decrypting the second data based on the result data to obtain plaintext data of the ciphertext data specifically includes:
decoding the second data based on the result data to obtain plaintext data of the ciphertext data, wherein a decoding method adopted by the decoding is as follows: a decoding method corresponding to the encoding method forming the second data.
Further, if the second data is data obtained by performing interval coding based on the result data, the decrypting the second data based on the result data to obtain plaintext data of the ciphertext data may specifically be:
determining at least one second probability distribution function determined when the second data is formed by encryption based on the result data;
and performing interval decoding on the second data based on the at least one second probability distribution function, a preset second interval mapping relation and a second preset initial interval to obtain plaintext data.
Specifically, if each number of the plaintext data is subjected to an integer processing based on a preset integer principle before the second data is encrypted to form the second data, the second data is decrypted based on the result data to obtain plaintext data of the ciphertext data, and each number of the intermediate data is subjected to a reduction processing based on a preset reduction principle, wherein the preset reduction principle is a processing principle which corresponds to the preset integer principle and can reduce the number to the number before the integer processing.
In practical applications, as shown in fig. 2, the convolutional neural network may include: a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, a seventh convolutional layer, and an eighth convolutional layer;
the first convolutional layer is an input layer, an output of the first convolutional layer is connected to an input of the second convolutional layer, outputs of the second convolutional layer are respectively connected to inputs of the third convolutional layer, the fourth convolutional layer, the fifth convolutional layer and the sixth convolutional layer, outputs of the third convolutional layer, the fourth convolutional layer, the fifth convolutional layer and the sixth convolutional layer are respectively connected to an input of the seventh convolutional layer, outputs of the third convolutional layer, the fourth convolutional layer, the fifth convolutional layer and the sixth convolutional layer are respectively connected to an input of the eighth convolutional layer, the seventh convolutional layer and the eighth convolutional layer are output layers, the seventh convolutional layer is a first output layer, and the eighth convolutional layer is a second output layer;
based on the convolutional neural network shown in fig. 2, the decryption method may include:
outputting intermediate data obtained by decrypting the first data as a second convolution layer, outputting four data through processing of a third convolution layer, a fourth convolution layer, a fifth convolution layer and a sixth convolution layer, tiling the four data to form one data, outputting the first result data and the second result data through processing of a seventh convolution layer and an eighth convolution layer respectively by the data tiled with the four data, and finally decrypting the second data based on the first result data and the second result data to obtain plaintext data of the ciphertext data;
the first convolution layer and the second convolution layer may be convolution down-sampling layers.
Specifically, the convolutional neural network may be a convolutional neural network obtained by training based on a preset sample set, where the preset sample set may be any type of data sample set.
As can be seen from the above, in the technical scheme provided by the application, when decrypting, the first data is decrypted based on the preset data to obtain the intermediate data, the intermediate data is processed based on the convolutional neural network to obtain the result data, and the second data is decrypted based on the result data to obtain the plaintext data. Therefore, when the technical scheme provided by the application is used for encrypting, intermediate data and result data are obtained based on plaintext data and a convolutional neural network, the intermediate data are encrypted based on preset data, and the plaintext data are encrypted based on the result data to obtain first data and second data so as to output ciphertext data; based on the encryption method, when the ciphertext data is decrypted, the plaintext data is obtained by decrypting the ciphertext data based on the preset data, the first data, the second data and the preset convolutional neural network, and if any one or more of the preset data, the first data, the second data and the preset convolutional neural network is/are lacked, the plaintext data cannot be obtained by decrypting, so that the decryption difficulty of the ciphertext data is increased, and the safety of data information is improved.
EXAMPLE III
The present application further provides an encryption apparatus based on a convolutional neural network, as shown in fig. 4, the encryption apparatus 40 includes:
an input unit 401, configured to input plaintext data into a preset convolutional neural network to obtain intermediate data and result data, where the intermediate data is data output by an intermediate stage in the convolutional neural network, and the result data is data finally output by the convolutional neural network;
a first encrypting unit 402, configured to encrypt the intermediate data based on preset data to obtain first data;
a second encrypting unit 403, configured to encrypt the plaintext data based on the result data to obtain second data;
an output unit 404, configured to output ciphertext data of the plaintext data based on the first data and the second data.
Optionally, the first encryption unit 402 is specifically configured to:
encoding the intermediate data based on preset data to obtain first data;
the second encryption unit 403 is specifically configured to:
and encoding the plaintext data based on the result data to obtain second data.
Further, the preset data includes: presetting a variance and a mean value;
the first encryption unit 402 is specifically configured to:
respectively mapping each number of the intermediate data to a corresponding numerical value interval based on a preset first interval mapping relation;
determining a first probability distribution function based on the preset variance and the preset mean;
determining a probability of each number in the intermediate data based on the first probability distribution function and a numerical interval to which each number in the intermediate data is mapped;
and carrying out interval coding on the intermediate data based on the probability corresponding to each number in the intermediate data and a first preset initial interval to obtain first data.
Further, the output layer of the convolutional neural network includes a first output layer and a second output layer, and the result data includes first result data output by the first output layer and second result data output by the second output layer;
the second encryption unit 403 is specifically configured to:
respectively mapping each number of the plaintext data to a corresponding numerical value interval based on a preset second interval mapping relation;
determining at least one second probability distribution function based on said first result data and said second result data;
determining the probability corresponding to each number in the plaintext data based on the at least one second probability distribution function and the numerical value interval corresponding to each number in the plaintext data;
and carrying out interval coding on the plaintext data based on the probability corresponding to each number in the plaintext data and a second preset initial interval to obtain second data.
Further, the length of the first result data, the length of the second result data, and the length of the plaintext data are all equal;
the second encryption unit 403 is further specifically configured to:
corresponding each number in the plaintext data to the number in the first result data and the number in the second result data one by one;
respectively determining a second probability distribution function of corresponding numbers in the plaintext data by taking the number in the first result data as a variance and the number in the second result data as a mean;
the determining, based on the at least one second probability distribution function and the numerical value intervals corresponding to the numbers in the plaintext data, the probability corresponding to each number in the plaintext data is specifically:
and determining the probability corresponding to each number in the plaintext data respectively based on the numerical value interval corresponding to each number in the plaintext data and the second probability distribution function of the corresponding number.
As can be seen from the above, in the technical scheme provided by the application, when encrypting, plaintext data is processed based on a convolutional neural network to obtain intermediate data and result data, and the intermediate data and the plaintext data are encrypted based on preset data and the result data respectively to obtain first data and second data so as to output ciphertext data. Therefore, when the technical scheme provided by the application is used for encrypting, intermediate data and result data are obtained based on plaintext data and a convolutional neural network, the intermediate data are encrypted based on preset data, and the plaintext data are encrypted based on the result data to obtain first data and second data so as to output ciphertext data; based on the encryption method, when the ciphertext data is decrypted, the plaintext data is obtained by decrypting based on the preset data, the first data, the second data and the preset convolutional neural network, and if any one or more of the preset data, the first data, the second data and the preset convolutional neural network is/are lacked, the plaintext data cannot be obtained by decrypting, so that the decryption difficulty of the ciphertext data is increased, and the safety of data information is improved.
Example four
The present application further provides a decryption apparatus based on a convolutional neural network, as shown in fig. 5, the encryption apparatus 50 includes:
an obtaining unit 501, configured to obtain first data and second data corresponding to the ciphertext data;
a first decryption unit 502, configured to decrypt the first data based on preset data to obtain intermediate data;
an output unit 503, configured to use the intermediate data as an output of an intermediate stage in a preset convolutional neural network, so as to trigger the convolutional neural network to perform processing after the intermediate stage on the intermediate data, so as to obtain result data, where the result data is data that is finally output by the convolutional neural network;
the second decryption unit 504 is configured to decrypt the second data based on the result data to obtain plaintext data of the ciphertext data.
Optionally, the first decryption unit 502 is specifically configured to:
decoding the first data based on preset data to obtain intermediate data;
the second decryption unit 504 is specifically configured to:
and decoding the second data based on the result data to obtain plaintext data of the ciphertext data.
The decoding method used for the above decoding is a decoding method corresponding to the encoding method used when the first data and the second data are formed by encryption.
Further, the first decryption unit 502 is specifically configured to:
performing interval decoding on the first data based on a first probability distribution function determined by preset data during encryption, a preset first interval mapping relation and a first preset initial interval to obtain intermediate data
Further, the first decryption unit 504 is specifically configured to:
and performing interval decoding on the second data based on at least one second probability distribution function determined by the result data during encryption, a preset second interval mapping relation and a second preset initial interval to obtain plaintext data.
As can be seen from the above, in the technical scheme provided by the application, when decrypting, the first data is decrypted based on the preset data to obtain the intermediate data, the intermediate data is processed based on the convolutional neural network to obtain the result data, and the second data is decrypted based on the result data to obtain the plaintext data. Therefore, when the technical scheme provided by the application is used for encrypting, intermediate data and result data are obtained based on plaintext data and a convolutional neural network, the intermediate data are encrypted based on preset data, and the plaintext data are encrypted based on the result data to obtain first data and second data so as to output ciphertext data; based on the encryption method, when the ciphertext data is decrypted, the plaintext data is obtained by decrypting based on the preset data, the first data, the second data and the preset convolutional neural network, and if any one or more of the preset data, the first data, the second data and the preset convolutional neural network is/are lacked, the plaintext data cannot be obtained by decrypting, so that the decryption difficulty of the ciphertext data is increased, and the safety of data information is improved.
EXAMPLE five
The present application further provides another encryption apparatus based on a convolutional neural network, as shown in fig. 6, the encryption apparatus in the embodiment of the present application includes: a memory 601, a processor 602, and a computer program stored in the memory 601 and executable on the processor 602, wherein: the memory 601 is used to store software programs and modules, the processor 602 executes various functional applications and data processing by operating the software programs and modules stored in the memory 601, and the memory 601 and the processor 602 are connected by a bus 603.
Specifically, the processor 602 implements the following steps by running the above-mentioned computer program stored in the memory 601:
inputting plaintext data into a preset convolutional neural network to obtain intermediate data and result data, wherein the intermediate data is data output by an intermediate stage in the convolutional neural network, and the result data is data finally output by the convolutional neural network;
encrypting the intermediate data based on preset data to obtain first data;
encrypting the plaintext data based on the result data to obtain second data;
and outputting ciphertext data of the plaintext data based on the first data and the second data.
Assuming that the above is the first possible implementation manner, in a second possible implementation manner based on the first possible implementation manner, the encrypting the intermediate data based on the preset data to obtain the first data includes:
encoding the intermediate data based on preset data to obtain first data;
the encrypting the plaintext data based on the result data to obtain second data includes:
and encoding the plaintext data based on the result data to obtain second data.
In a third possible implementation manner based on the second possible implementation manner, the preset data includes: presetting a variance and a mean value;
the encoding the intermediate data based on the preset data to obtain the first data includes:
respectively mapping each number of the intermediate data to a corresponding numerical value interval based on a preset first interval mapping relation;
determining a first probability distribution function based on the preset variance and the preset mean;
determining a probability of each number in the intermediate data based on the first probability distribution function and a numerical interval to which each number in the intermediate data is mapped;
and carrying out interval coding on the intermediate data based on the probability corresponding to each number in the intermediate data and a first preset initial interval to obtain first data.
In a fourth possible implementation based on the second possible implementation, the output layer of the convolutional neural network includes a first output layer and a second output layer, and the result data includes first result data output by the first output layer and second result data output by the second output layer;
the encoding the plaintext data based on the result data to obtain second data includes:
respectively mapping each number of the plaintext data to a corresponding numerical value interval based on a preset second interval mapping relation;
determining at least one second probability distribution function based on said first result data and said second result data;
determining the probability corresponding to each number in the plaintext data based on the at least one second probability distribution function and the numerical value interval corresponding to each number in the plaintext data;
and carrying out interval coding on the plaintext data based on the probability corresponding to each number in the plaintext data and a second preset initial interval to obtain second data.
In a fifth possible implementation manner based on the fourth possible implementation manner, the length of the first result data and the length of the second result data are equal to the length of the plaintext data;
said determining at least one second probability distribution function based on said first result data and said second result data comprises:
corresponding each number in the plaintext data to the number in the first result data and the number in the second result data one by one;
respectively determining a second probability distribution function of corresponding numbers in the plaintext data by taking the number in the first result data as a variance and the number in the second result data as a mean;
the determining, based on the at least one second probability distribution function and the numerical value intervals corresponding to the numbers in the plaintext data, the probability corresponding to each number in the plaintext data is specifically:
and determining the probability corresponding to each number in the plaintext data respectively based on the numerical value interval corresponding to each number in the plaintext data and the second probability distribution function of the corresponding number.
As can be seen from the above, in the technical scheme provided by the application, when encrypting, plaintext data is processed based on a convolutional neural network to obtain intermediate data and result data, and the intermediate data and the plaintext data are encrypted based on preset data and the result data respectively to obtain first data and second data so as to output ciphertext data. Therefore, when the technical scheme provided by the application is used for encrypting, intermediate data and result data are obtained based on plaintext data and a convolutional neural network, the intermediate data are encrypted based on preset data, and the plaintext data are encrypted based on the result data to obtain first data and second data so as to output ciphertext data; based on the encryption method, when the ciphertext data is decrypted, the plaintext data is obtained by decrypting the ciphertext data based on the preset data, the first data, the second data and the preset convolutional neural network, and if any one or more of the preset data, the first data, the second data and the preset convolutional neural network is/are lacked, the plaintext data cannot be obtained by decrypting, so that the decryption difficulty of the ciphertext data is increased, and the safety of data information is improved.
EXAMPLE six
The present application further provides another decryption apparatus based on a convolutional neural network, as shown in fig. 7, the decryption apparatus in the embodiment of the present application includes: a memory 701, a processor 702, and a computer program stored in the memory 701 and executable on the processor 702, wherein: the memory 701 is used to store software programs and modules, the processor 702 executes various functional applications and data processing by operating the software programs and modules stored in the memory 701, and the memory 701 and the processor 702 are connected by a bus 703.
Specifically, the processor 702 implements the following steps by running the above-mentioned computer program stored in the memory 701:
acquiring first data and second data corresponding to the ciphertext data;
decrypting the first data based on preset data to obtain intermediate data;
taking the intermediate data as the output of an intermediate stage in a preset convolutional neural network to trigger the convolutional neural network to perform the processing after the intermediate stage on the intermediate data to obtain result data, wherein the result data is the data finally output by the convolutional neural network;
and decrypting the second data based on the result data to obtain plaintext data of the ciphertext data.
Assuming that the above is the first possible implementation manner, in a second possible implementation manner based on the first possible implementation manner, the decrypting the first data based on the preset data to obtain the intermediate data includes:
decoding the first data based on preset data to obtain intermediate data;
the decrypting the second data based on the result data to obtain the plaintext data of the ciphertext data includes:
and decoding the second data based on the result data to obtain plaintext data of the ciphertext data.
In a third possible implementation manner based on the second possible implementation manner, the decoding the first data based on preset data to obtain intermediate data includes:
and performing interval decoding on the first data based on a first probability distribution function determined by preset data during encryption, a preset first interval mapping relation and a first preset initial interval to obtain intermediate data.
In a fourth possible implementation manner based on the second possible implementation manner, the decoding second data based on the result data to obtain plaintext data of the ciphertext data includes:
and performing interval decoding on the second data based on at least one second probability distribution function determined by the result data during encryption, a preset second interval mapping relation and a second preset initial interval to obtain plaintext data.
As can be seen from the above, in the technical scheme provided by the application, when decrypting, the first data is decrypted based on the preset data to obtain the intermediate data, the intermediate data is processed based on the convolutional neural network to obtain the result data, and the second data is decrypted based on the result data to obtain the plaintext data. Therefore, when the technical scheme provided by the application is used for encrypting, the intermediate data and the result data are obtained based on the plaintext data and the convolutional neural network, the intermediate data are encrypted based on the preset data, the plaintext data are encrypted based on the result data, the first data and the second data are obtained, and the ciphertext data are output; based on the encryption method, when the ciphertext data is decrypted, the plaintext data is obtained by decrypting the ciphertext data based on the preset data, the first data, the second data and the preset convolutional neural network, and if any one or more of the preset data, the first data, the second data and the preset convolutional neural network is/are lacked, the plaintext data cannot be obtained by decrypting, so that the decryption difficulty of the ciphertext data is increased, and the safety of data information is improved.
EXAMPLE seven
The present application also provides a computer readable storage medium having a computer program stored thereon, which when executed, can implement the steps provided by the above-described embodiments. In particular, the computer program includes computer program code, which may be in one of a source code form, an object code form, an executable file or some intermediate form, and is not limited herein; the computer readable storage medium can be any entity or device capable of carrying the above computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium, and is not limited herein. It should be noted that the contents contained in the computer-readable storage medium can be increased or decreased as required by legislation and patent practice in the jurisdiction.
As can be seen from the above, in the technical scheme provided by the application, during encryption, plaintext data is processed based on a convolutional neural network to obtain intermediate data and result data, and the intermediate data and the plaintext data are encrypted based on preset data and the result data respectively to obtain first data and second data so as to output ciphertext data; during decryption, the first data are decrypted based on preset data to obtain intermediate data, the intermediate data are processed based on a convolutional neural network to obtain result data, and the second data are decrypted based on the result data to obtain plaintext data. Therefore, when the technical scheme provided by the application is used for encrypting, intermediate data and result data are obtained based on plaintext data and a convolutional neural network, the intermediate data are encrypted based on preset data, and the plaintext data are encrypted based on the result data to obtain first data and second data so as to output ciphertext data; based on the encryption method, when the ciphertext data is decrypted, the plaintext data is obtained by decrypting the ciphertext data based on the preset data, the first data, the second data and the preset convolutional neural network, and if any one or more of the preset data, the first data, the second data and the preset convolutional neural network is/are lacked, the plaintext data cannot be obtained by decrypting, so that the decryption difficulty of the ciphertext data is increased, and the safety of data information is improved.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. 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 invention. Thus, the present invention 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.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
It should be noted that, the methods and the details thereof provided by the foregoing embodiments may be combined with the apparatuses and devices provided by the embodiments, which are referred to each other and are not described again.
Those of ordinary skill in the art would appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described apparatus/device embodiments are merely illustrative, and for example, the division of the above-described modules or units is only one logical functional division, and the actual implementation may be implemented by another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. An encryption method based on a convolutional neural network, comprising:
inputting plaintext data into a preset convolutional neural network to obtain intermediate data and result data, wherein the intermediate data is data output by an intermediate stage in the convolutional neural network, and the result data is data finally output by the convolutional neural network;
encrypting the intermediate data based on preset data to obtain first data;
encrypting the plaintext data based on the result data to obtain second data;
outputting ciphertext data of the plaintext data based on the first data and the second data;
wherein the convolutional neural network comprises more than one convolutional layer.
2. The encryption method according to claim 1, wherein the encrypting the intermediate data based on the preset data to obtain the first data comprises:
encoding the intermediate data based on preset data to obtain first data;
the encrypting the plaintext data based on the result data to obtain second data comprises:
and coding the plaintext data based on the result data to obtain second data.
3. The encryption method according to claim 2, wherein the preset data comprises: presetting a variance and a mean value;
the encoding the intermediate data based on preset data to obtain first data comprises:
respectively mapping each number of the intermediate data to a corresponding numerical value interval based on a preset first interval mapping relation;
determining a first probability distribution function based on the preset variance and the preset mean;
determining a probability of each number in the intermediate data based on the first probability distribution function and the numerical interval to which each number in the intermediate data is mapped;
and carrying out interval coding on the intermediate data based on the probability corresponding to each number in the intermediate data and a first preset initial interval to obtain first data.
4. The encryption method according to claim 2, wherein the output layers of the convolutional neural network include a first output layer and a second output layer, and the result data includes first result data output by the first output layer and second result data output by the second output layer;
the encoding the plaintext data based on the result data to obtain second data comprises:
respectively mapping each number of the plaintext data to a corresponding numerical value interval based on a preset second interval mapping relation;
determining at least one second probability distribution function based on the first result data and the second result data;
determining the probability corresponding to each number in the plaintext data based on the at least one second probability distribution function and the numerical value interval corresponding to each number in the plaintext data;
and carrying out interval coding on the plaintext data based on the probability corresponding to each number in the plaintext data and a second preset initial interval to obtain second data.
5. The encryption method according to claim 4, wherein the length of the first result data, the length of the second result data, and the length of the plaintext data are all equal;
said determining at least one second probability distribution function based on said first result data and said second result data comprises:
respectively corresponding each number in the plaintext data to the number in the first result data and the number in the second result data in a one-to-one manner;
respectively determining second probability distribution functions of corresponding numbers in the plaintext data by taking the numbers in the first result data as variances and taking the numbers in the second result data as mean values;
the determining, based on the at least one second probability distribution function and the numerical value intervals corresponding to the numbers in the plaintext data, the probabilities corresponding to the numbers in the plaintext data are specifically:
and determining the probability corresponding to each number in the plaintext data respectively based on the numerical value interval corresponding to each number in the plaintext data and the second probability distribution function of the corresponding number.
6. A decryption method based on a convolutional neural network is characterized by comprising the following steps:
acquiring first data and second data corresponding to the ciphertext data;
decrypting the first data based on preset data to obtain intermediate data;
taking the intermediate data as the output of an intermediate stage in a preset convolutional neural network to trigger the convolutional neural network to perform the post-intermediate-stage processing on the intermediate data to obtain result data, wherein the result data is the data finally output by the convolutional neural network;
decrypting second data based on the result data to obtain plaintext data of the ciphertext data;
wherein the convolutional neural network comprises more than one convolutional layer.
7. An encryption apparatus based on a convolutional neural network, comprising:
the device comprises an input unit, a data processing unit and a data processing unit, wherein the input unit is used for inputting plaintext data into a preset convolutional neural network so as to obtain intermediate data and result data, the intermediate data is data output by an intermediate stage in the convolutional neural network, and the result data is data finally output by the convolutional neural network;
the first encryption unit is used for encrypting the intermediate data based on preset data to obtain first data;
a second encryption unit, configured to encrypt the plaintext data based on the result data to obtain second data;
an output unit configured to output ciphertext data of the plaintext data based on the first data and the second data;
wherein the convolutional neural network comprises more than one convolutional layer.
8. The encryption device according to claim 7, wherein the first encryption unit is specifically configured to:
encoding the intermediate data based on preset data to obtain first data;
the second encryption unit is specifically configured to:
and coding the plaintext data based on the result data to obtain second data.
9. The encryption device according to claim 8, wherein the preset data includes: presetting a variance and a mean value;
the first encryption unit is specifically configured to:
respectively mapping each number of the intermediate data to a corresponding numerical value interval based on a preset first interval mapping relation;
determining a first probability distribution function based on the preset variance and the preset mean;
determining a probability of each number in the intermediate data based on the first probability distribution function and the numerical interval to which each number in the intermediate data is mapped;
and carrying out interval coding on the intermediate data based on the probability corresponding to each number in the intermediate data and a first preset initial interval to obtain first data.
10. A convolutional neural network-based decryption apparatus, comprising:
the acquiring unit is used for acquiring first data and second data corresponding to the ciphertext data;
the first decryption unit is used for decrypting the first data based on preset data to obtain intermediate data;
the output unit is used for taking the intermediate data as the output of an intermediate stage in a preset convolutional neural network so as to trigger the convolutional neural network to execute the processing after the intermediate stage on the intermediate data to obtain result data, wherein the result data is the data finally output by the convolutional neural network;
the second decryption unit is used for decrypting second data based on the result data to obtain plaintext data of the ciphertext data;
wherein the convolutional neural network comprises more than one convolutional layer.
CN202011079560.2A 2020-10-10 2020-10-10 Encryption and decryption method and device based on convolutional neural network Active CN112214776B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011079560.2A CN112214776B (en) 2020-10-10 2020-10-10 Encryption and decryption method and device based on convolutional neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011079560.2A CN112214776B (en) 2020-10-10 2020-10-10 Encryption and decryption method and device based on convolutional neural network

Publications (2)

Publication Number Publication Date
CN112214776A CN112214776A (en) 2021-01-12
CN112214776B true CN112214776B (en) 2022-10-21

Family

ID=74053075

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011079560.2A Active CN112214776B (en) 2020-10-10 2020-10-10 Encryption and decryption method and device based on convolutional neural network

Country Status (1)

Country Link
CN (1) CN112214776B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113179223B (en) * 2021-04-23 2022-08-26 中山大学 Network application identification method and system based on deep learning and serialization features

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105389770A (en) * 2015-11-09 2016-03-09 河南师范大学 Method and apparatus for embedding and extracting image watermarking based on BP and RBF neural networks
CN108920981A (en) * 2018-07-06 2018-11-30 成都大象分形智能科技有限公司 It is related to the neural network model encryption protection system and method for data iterative cryptographic
CN110378138A (en) * 2019-07-22 2019-10-25 上海鹰瞳医疗科技有限公司 Data encryption, decryption method and neural network training method and equipment
CN110674941A (en) * 2019-09-25 2020-01-10 南开大学 Data encryption transmission method and system based on neural network
CN111478885A (en) * 2020-03-16 2020-07-31 湖南遥昇通信技术有限公司 Asymmetric encryption and decryption method, equipment and storage medium
CN111488592A (en) * 2019-01-29 2020-08-04 武汉海康存储技术有限公司 Data encryption and decryption method and device and network equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11569978B2 (en) * 2019-03-18 2023-01-31 Inait Sa Encrypting and decrypting information

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105389770A (en) * 2015-11-09 2016-03-09 河南师范大学 Method and apparatus for embedding and extracting image watermarking based on BP and RBF neural networks
CN108920981A (en) * 2018-07-06 2018-11-30 成都大象分形智能科技有限公司 It is related to the neural network model encryption protection system and method for data iterative cryptographic
CN111488592A (en) * 2019-01-29 2020-08-04 武汉海康存储技术有限公司 Data encryption and decryption method and device and network equipment
CN110378138A (en) * 2019-07-22 2019-10-25 上海鹰瞳医疗科技有限公司 Data encryption, decryption method and neural network training method and equipment
CN110674941A (en) * 2019-09-25 2020-01-10 南开大学 Data encryption transmission method and system based on neural network
CN111478885A (en) * 2020-03-16 2020-07-31 湖南遥昇通信技术有限公司 Asymmetric encryption and decryption method, equipment and storage medium

Also Published As

Publication number Publication date
CN112214776A (en) 2021-01-12

Similar Documents

Publication Publication Date Title
CN109547201B (en) Encryption method of root key, computer readable storage medium and terminal equipment
EP2202912A1 (en) Method and apparatus for camouflaging of data, information and functional transformations
CN107078899B (en) Method of obfuscating data
DE102018125530A1 (en) Procedures and arrangements for implicit integrity
CN102724552B (en) Image coding method, image decoding method and device
CN110784306B (en) SM4 algorithm white box implementation method and device, electronic equipment and computer medium
CN115065555A (en) Information security processing method and system
CN111404892B (en) Data supervision method and device and server
CN112214776B (en) Encryption and decryption method and device based on convolutional neural network
CN113225297A (en) Data hybrid encryption method, device and equipment
CN112287366A (en) Data encryption method and device, computer equipment and storage medium
CN113938270A (en) Data encryption method and device capable of flexibly reducing complexity
CN113704818A (en) Key management method and device for encrypted data storage system and terminal equipment
CN114329644A (en) Method, device and storage medium for carrying out encryption simulation on logic system design
CN117708847A (en) 3C product leasing platform data processing method based on data compression and encryption
CN107592963B (en) Method and computing device for performing secure computations
CN116305211A (en) Image encryption processing method and device
CN111949996A (en) Generation method, encryption method, system, device and medium of security private key
CN116032636A (en) Internet of vehicles data encryption method and system based on neural network
CN115766244A (en) Internet of vehicles information encryption method and device, computer equipment and storage medium
CN109559269A (en) A kind of method and terminal of image encryption
CN114943205A (en) Method, system, storage medium and electronic equipment for generating identity recognition code UUID
CN110392058B (en) Service protection method, system and terminal equipment
CN113497710A (en) Data decryption method and device
CN111008236A (en) Data query method and system

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