CN114553549A - Data encryption method and system - Google Patents

Data encryption method and system Download PDF

Info

Publication number
CN114553549A
CN114553549A CN202210172847.2A CN202210172847A CN114553549A CN 114553549 A CN114553549 A CN 114553549A CN 202210172847 A CN202210172847 A CN 202210172847A CN 114553549 A CN114553549 A CN 114553549A
Authority
CN
China
Prior art keywords
image
encrypted
character
obtaining
encryption
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.)
Granted
Application number
CN202210172847.2A
Other languages
Chinese (zh)
Other versions
CN114553549B (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.)
Jiangsu Vocational College of Business
Original Assignee
Jiangsu Vocational College of Business
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 Jiangsu Vocational College of Business filed Critical Jiangsu Vocational College of Business
Priority to CN202210172847.2A priority Critical patent/CN114553549B/en
Publication of CN114553549A publication Critical patent/CN114553549A/en
Application granted granted Critical
Publication of CN114553549B publication Critical patent/CN114553549B/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
    • H04L63/0435Network 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 wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • 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
    • H04L63/0442Network 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 wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/44Secrecy systems
    • H04N1/4446Hiding of documents or document information

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Multimedia (AREA)
  • Facsimile Transmission Control (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a data encryption method and a data encryption system. And obtaining the plaintext of the character string. A character key is obtained. Based on the character key, the character string is encrypted in the clear text through a symmetric encryption algorithm to obtain an encrypted ciphertext. A set of images is obtained. And obtaining encryption information through an encryption algorithm based on the image set and the character key. And sending the encrypted ciphertext and the encrypted information to a receiver through a network, and decrypting based on the encrypted information to obtain decrypted information. The three-layer encryption mode provides multiple protections for the secret key, so that the encryption method is safer. The image is used for encryption, the image transmission mode can not be easily intercepted during transmission, and the data security is greatly improved.

Description

Data encryption method and system
Technical Field
The invention relates to the technical field of computers, in particular to a data encryption method and system.
Background
At present, data is generally encrypted by adopting a character string transmission mode. However, if the string transmission is symmetric encryption, the encryption method is easily obtained from the receiver side, and data is obtained. If the string transmission uses asymmetric encryption, the string transmission can be intercepted and cracked. A more secure data encryption method is required.
Disclosure of Invention
The present invention provides a data encryption method and system, which are used to solve the above problems in the prior art.
In a first aspect, an embodiment of the present invention provides a data encryption method, including:
obtaining a character string plaintext; the string plaintext represents a string for communication;
obtaining a character key; the character key is a password set during encryption;
based on the character key, encrypting the character string in the clear text through a symmetric encryption algorithm to obtain an encrypted ciphertext; the encrypted ciphertext is a character obtained by encrypting a character string plaintext;
obtaining an image set; the image set represents a plurality of character images stored in a database; the character image represents an image containing a plurality of characters; the name of the character image is a character existing in the character image;
obtaining encryption information through an encryption algorithm based on the image set and the character key;
and sending the encrypted ciphertext and the encrypted information to a receiver through a network, and decrypting based on the encrypted information to obtain decrypted information.
Optionally, the obtaining of the encryption information by an encryption algorithm based on the image set and the character key includes:
obtaining an image password; the image password is a randomly generated character string; the image password comprises a cutting position, an exchange position and a transformation method label; the clipping position represents a position clipped according to a numerical scale; the exchange position represents exchanging the cutting position in the image; the transformation method label represents an image transformation method;
based on the character key, obtaining a character key image through a search algorithm; the character key image is an image containing character key characters;
based on the character key image and the character key, obtaining an image position character string through an image recognition model; the image position character string is a character string formed by a plurality of image positions; the image recognition model is a trained model;
based on the image password, converting the character key image to obtain an encrypted image;
encrypting the image password by an asymmetric encryption method to obtain an encrypted image password;
encrypting the image position character string by an asymmetric encryption method to obtain an encrypted image position;
obtaining encryption information; the encryption information includes an encrypted image, an encrypted image password, and an encrypted image position.
Optionally, the transforming the character key image based on the image password to obtain an encrypted image includes:
dividing the image into a plurality of parts based on the cutting position in the image password, and multiplying the position by the size of the image to obtain the position of the cut image;
performing image exchange based on the exchange positions in the cut image and the image password to obtain an exchange image;
and transforming the exchanged image based on the transformation method label in the image password to obtain a transformed image.
Optionally, the sending the encrypted ciphertext and the encrypted information to the receiver through the network, and decrypting based on the encrypted information to obtain decrypted information includes:
obtaining an original image based on the encrypted image in the encrypted information and the encrypted image password in the encrypted information;
obtaining a character key based on the encrypted position and the original image;
and obtaining decryption information through a symmetric decryption algorithm based on the character key and the encrypted ciphertext.
Optionally, the obtaining an original image based on the encrypted image in the encryption information and the encrypted image password in the encryption information includes:
obtaining a decrypted image password through an asymmetric decryption algorithm based on the encrypted image password;
based on the encrypted image position, obtaining a decrypted image position through an asymmetric decryption algorithm;
and obtaining the original image based on the decrypted image password and the encrypted image.
Optionally, obtaining an original image based on the decrypted image password and the encrypted image includes:
based on the transformation method label in the decrypted image password, restoring the image through a corresponding transformation restoration algorithm to obtain a transformation restored image;
obtaining a cutting reduction image position based on the cutting position in the decrypted image; the position of the cutting reduction image represents the position of the image for exchanging;
and reading the numbers from the end of the array of the exchange positions based on the exchange positions in the decrypted image, and exchanging the images at the subscript positions of the array to obtain the original image.
Optionally, obtaining a character key based on the encrypted position and the original image includes:
decrypting the encrypted position through an asymmetric decryption algorithm to obtain a decrypted position; the decryption position method is a rule capable of converting the encryption position into an image position set before encryption; the decryption position method is a decryption method given by a sender;
obtaining an image frame to be detected based on the decryption position;
obtaining a plurality of images to be detected based on the image frame to be detected and the original image;
and inputting a plurality of images to be detected into the image recognition algorithm model for a plurality of times to obtain the character key.
In a second aspect, an embodiment of the present invention provides a data encryption system, including:
a text acquisition structure: obtaining a character string plaintext; the character string plaintext represents a character string for transfer; obtaining a character key; the character key is a password set during encryption;
the encryption ciphertext encryption structure comprises: based on the character key, encrypting the character string in the clear text through a symmetric encryption algorithm to obtain an encrypted ciphertext; the encrypted ciphertext is a character obtained by encrypting a character string plaintext;
an image acquisition structure: obtaining an image set; obtaining an image set; the image set represents a plurality of character images stored in a database; the character image represents an image containing a plurality of characters; the name of the character image is a character existing in the character image;
character key encryption structure: obtaining encryption information through an encryption algorithm based on the image set and the character key;
and (3) decryption structure: and sending the encrypted ciphertext and the encrypted information to a receiver through a network, and decrypting based on the encrypted information to obtain decrypted information.
Optionally, the obtaining of the encryption information by an encryption algorithm based on the image set and the character key includes:
obtaining an image password; the image password is a randomly generated character string; the image password comprises a cutting position, an exchange position and a transformation method label; the clipping position represents a position clipped according to a numerical scale; the exchange position represents exchanging the cutting position in the image; the transformation method label represents an image transformation method;
based on the character key, obtaining a character key image through a search algorithm; the character key image is an image containing character key characters;
based on the character key image and the character key, obtaining an image position character string through an image recognition model; the image position character string is a character string formed by a plurality of image positions; the image recognition model is a trained model;
based on the image password, converting the character key image to obtain an encrypted image;
encrypting the image password by an asymmetric encryption method to obtain an encrypted image password;
encrypting the image position character string by an asymmetric encryption method to obtain an encrypted image position;
obtaining encryption information; the encryption information includes an encrypted image, an encrypted image password, and an encrypted image position.
Optionally, the transforming the character key image based on the image password to obtain an encrypted image includes:
dividing the image into a plurality of parts based on the cutting position in the image password, and multiplying the position by the size of the image to obtain the position of the cut image;
performing image exchange based on the exchange positions in the cut image and the image password to obtain an exchange image;
based on the conversion method label in the image password, the exchange image is converted to obtain a conversion image
Compared with the prior art, the embodiment of the invention achieves the following beneficial effects:
the embodiment of the invention also provides a data encryption method and a system, wherein the method comprises the following steps: and obtaining the plaintext of the character string. The string plaintext represents a string for delivery. A character key is obtained. The character key is a password set during encryption. Based on the character key, the character string is encrypted in the clear text through a symmetric encryption algorithm to obtain an encrypted ciphertext. The encrypted ciphertext is a character obtained by encrypting a character string plaintext. A set of images is obtained. The image set represents a plurality of character images stored in a database. The character image represents an image containing a plurality of characters. The name of the character image is a character existing in the character image. And obtaining encryption information through an encryption algorithm based on the image set and the character key. And sending the encrypted ciphertext and the encrypted information to a receiver through a network, and decrypting based on the encrypted information to obtain decrypted information.
The password is encrypted by using a mode of transmitting pictures, so that the password is transmitted by the image, the image is cut randomly, and the password is transmitted by depending on the image position and the cut image instead of being transmitted by only depending on a character string, thereby increasing the security of the password. Because the trained image recognition model can be used for encrypting more images and carrying out position detection through the trained image recognition model during decryption, the image recognition model can ensure that the encryption and decryption processes are safer. The character key is encrypted firstly, the image mode is used for encryption, and the random position and the cutting mode are encrypted. The three-layer encryption mode provides multiple protections for the secret key, so that the encryption method is safer.
Drawings
Fig. 1 is a flowchart of a data encryption system according to an embodiment of the present invention.
Fig. 2 is a schematic process diagram of a data encryption system according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of an encryption structure in a data encryption system process according to an embodiment of the present invention.
FIG. 4 is a schematic diagram of a decryption structure in a data encryption system process according to an embodiment of the present invention
Fig. 5 is a schematic block structure diagram of an electronic device according to an embodiment of the present invention.
The labels in the figure are: a bus 500; a receiver 501; a processor 502; a transmitter 503; a memory 504; a bus interface 505.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings.
Example 1
As shown in fig. 1, an embodiment of the present invention provides a data encryption method, where the method includes:
s101: and obtaining the plaintext of the character string. The string plaintext represents a string for delivery.
S102: a character key is obtained. The character key is a password set during encryption.
S103: based on the character key, the character string is encrypted in the clear text through a symmetric encryption algorithm to obtain an encrypted ciphertext. The encrypted ciphertext is a character obtained by encrypting a character string plaintext.
In this embodiment, the symmetric encryption algorithm is a GPG algorithm.
S104: obtaining an image set; the image set represents a plurality of character images stored in a database; the character image represents an image containing a plurality of characters; the name of the character image is a character existing in the character image.
S105: obtaining encryption information through an encryption algorithm based on the image set and the character key;
s106: and sending the encrypted ciphertext and the encrypted information to a receiver through a network, decrypting based on the encrypted information, sending the encrypted ciphertext and the encrypted information to the receiver through the network, and decrypting based on the encrypted information to obtain decrypted information.
Wherein the encryption and decryption process is shown in fig. 2.
Optionally, the obtaining of the encryption information by an encryption algorithm based on the image set and the character key includes:
obtaining an image password; the image password is a randomly generated character string; the image password comprises a cutting position, an exchange position and a transformation method label; the clipping position represents a position clipped according to a numerical scale; the exchange position represents exchanging the cutting position in the image; the transformation method label indicates an image transformation method.
Based on the character key, obtaining a character key image through a search algorithm; the character key image is an image containing character key characters.
The searching method in this embodiment adopts a sequential searching manner, and searches for a plurality of times until an image containing all character key characters is found.
And obtaining an image position character string through image identification based on the character key image and the character key. The image position character string is a character string composed of a plurality of image positions. The image recognition model is a trained model.
The image position character string represents characters which are obtained by arranging the characters in the character key in sequence according to the positions of the characters in the image. The positions between the image position character strings are separated according to specific coincidence, and in the embodiment, the characters are separated. The image position indicates a frame position of the character key in the image. The arrangement of the single image position is a central point abscissa, a central point ordinate, a frame width and a frame height.
The training method of the image recognition model comprises the following steps: obtaining a training set; the training set comprises a plurality of images and a plurality of corresponding labeled data; the annotation data comprises annotation categories and annotation positions. The annotation category represents a category of characters in the image; the annotation location represents the location of the character in the image. The image representation database includes all images that can be used to provide character keys. And putting the training set into a first convolution, and performing feature extraction to obtain a feature map. Inputting the feature map into a full connection layer, and classifying to obtain feature vectors; the elements of the feature vector are labels. The number of elements in the feature vector is the sum of the category number and the position number. The number of positions includes a center point position and a width and a height. It is equivalent to detect each position in the feature map to see if the position meets the intersection ratio threshold. The cross-over ratio threshold in this example is 0.9. And obtaining a loss value through a loss function based on the feature vector and the labeled data. Wherein the categories are discriminated using a cross entropy loss function. And judging the width and height of the center point position kernel by using a mean square error loss function. And acquiring the current training iteration number of the image recognition model and the preset maximum iteration number of the image recognition model training. In this embodiment, the maximum number of iterations is 8000. And stopping training when the loss value is less than or equal to a threshold value or the training iteration number reaches the maximum iteration number, so as to obtain a trained image recognition model.
And based on the image password, converting the character key image to obtain an encrypted image.
And encrypting the image password by an asymmetric encryption method to obtain an encrypted image password.
And encrypting the image position character string by an asymmetric encryption method to obtain an encrypted image position.
In this embodiment, the asymmetric encryption method for encrypting the image password and the image position character string is an openssl algorithm.
Obtaining encryption information; the encryption information includes an encrypted image, an encrypted image password, and an encrypted image position.
The encryption structure is shown in fig. 3.
By the method, the image is obtained, and the character key is transmitted by using the method for transmitting the image position, so that the image is not easy to detect, and the security of data encryption is further improved. And obtaining the character positions in the image by adopting a specific convolution mode, transmitting the character positions as information, and not directly transmitting characters or characters corresponding to the character keys obtained by an algorithm. Because the picture is obtained randomly, the position of the picture is random, and the random position can encrypt the data more safely.
Optionally, the transforming the character key image based on the image password to obtain an encrypted image includes:
based on the clipping position in the image password, the image is divided into a plurality of parts, and the position is multiplied by the image size to obtain the clipping image position.
In this embodiment, a partial image password [ [5,4,0,0,0] ]. The clipping position is [5,4] to divide the image width into 5 parts including 0 th wide part, 1 st wide part, 2 nd wide part, 3 rd wide part and 4 th wide part, respectively. The image height is divided into 4 parts including the 0 th, 1 st, 2 nd and 3 rd high parts, respectively. And multiplying the clipping position by the image size, and adding the result and the bottom position to obtain the clipping image position. The 0 th high part position is (0,44), the 1 st wide part position (44,89), the 2 nd wide part position (89,134), the 3 rd wide part position (134, 179), the 4 th wide part position (179,224), the 0 th high part position is (0,56), the 1 st high part position (56,112), the 2 nd high part position (112,168), the 4 th wide part position (168, 224) are obtained.
And carrying out image exchange based on the exchange positions in the cut image and the image password to obtain an exchange image.
In this embodiment, the partial image password is [ [5,4,0,0,0], [1,2,4,3,1], [0,1,3,4,1] ]. The image width exchange position is [1,2,4,3,0] indicating that the divided 0 th wide portion is exchanged with the 1 st wide portion, the 1 st wide portion is exchanged with the 2 nd wide portion, the 2 nd wide portion is exchanged with the 4 th wide portion, the 3 rd wide portion is exchanged with the 3 rd wide portion, and the 4 th wide portion is exchanged with the 0 th wide portion. The image height exchange positions are [0,1,3,4,1] indicating that the 0 th high portion and the 0 th high portion are exchanged, the 1 st high portion and the 1 st high portion are exchanged, the 2 nd high portion and the 3 rd high portion are exchanged, the 3 rd high portion and the 4 th high portion are exchanged, and the 4 th high portion and the 1 st high portion are exchanged.
And transforming the exchanged image based on the transformation method label in the image password to obtain a transformed image.
The transformation method of the embodiment comprises an image flipping algorithm, image rotation and translation transformation. And matching the image password with the transformation label to obtain corresponding transformation methods, and operating the image by using the transformation methods to obtain a transformed image.
By the method, only one randomly selected image is subjected to transformation operation for quick transmission, and the image is transmitted. The transformed image cannot be recognized by naked eyes and by a computer, and the corresponding information in the picture can be obtained only by recovering the transformed image by a specific method.
Optionally, the sending the encrypted ciphertext and the encrypted information to the receiver through the network, and decrypting based on the encrypted information to obtain decrypted information includes:
and obtaining the original image based on the encrypted image in the encrypted information and the encrypted image password in the encrypted information.
Based on the encrypted position and the original image, a character key is obtained.
And obtaining decryption information through a symmetric decryption algorithm based on the character key and the encrypted ciphertext.
In this embodiment, the symmetric encryption algorithm is a GPG algorithm.
Wherein the decryption structure is shown in fig. 4.
By the method, the specific decryption algorithm is used for verifying the decryption identification model, and the image is decrypted and identified to obtain the character key. The security is greatly increased, so that only the decryption algorithm provided by the sender decrypts the identification model to be able to decrypt the image. Pictures are not easily decrypted by other intercepts.
Optionally, the obtaining an original image based on the encrypted image in the encrypted information and the encrypted image password in the encrypted information includes:
obtaining a decrypted image password through an asymmetric decryption algorithm based on the encrypted image password;
based on the encrypted image position, obtaining a decrypted image position through an asymmetric decryption algorithm;
and obtaining the original image based on the decrypted image password and the encrypted image.
The asymmetric decryption method for decrypting the encrypted image password and the encrypted image position is an openssl algorithm.
By the method, the encrypted image password and the image position are decrypted, the image is restored by decrypting the image password and the image position, and the position of the character in the restored image is obtained, so that the character key is obtained. The information for restoring the image is decrypted for multiple times, so that the safety is improved.
Optionally, obtaining an original image based on the decrypted image password and the encrypted image includes:
based on the transformation method label in the decrypted image password, restoring the image through a corresponding transformation restoration algorithm to obtain a transformation restored image;
obtaining a cutting reduction image position based on the cutting position in the decrypted image; the position of the cutting reduction image represents the position of the image for exchanging;
and reading the numbers from the end of the array of the exchange positions based on the exchange positions in the decrypted image, and exchanging the images at the subscript positions of the array to obtain the original image.
By the method, the image is restored by the image restoring method provided by the sender, and the image is restored by the method of randomly generating the cutting information and the exchange information by the sender, decrypting and restoring the image in the reverse order of the exchange position. Since the provided clipping information and the exchange information are random, the security is further increased.
Optionally, obtaining a character key based on the encrypted position and the original image includes:
decrypting the encrypted position through an asymmetric decryption algorithm to obtain a decrypted position; the decryption position method is a rule capable of converting the encryption position into an image position set before encryption; the decryption location method is a decryption method given by the sender.
The asymmetric decryption method for decrypting the encrypted position to obtain the decrypted position is an openssl algorithm.
Obtaining an image frame to be detected based on the decryption position;
obtaining a plurality of images to be detected based on the image frame to be detected and the original image;
and inputting a plurality of images to be detected into the image recognition algorithm model for a plurality of times to obtain the character key.
The image recognition model is a trained image recognition model capable of recognizing characters.
By the method, an asymmetric decryption algorithm provided by a sender and a trained image recognition algorithm are used, the image recognition algorithm can recognize the cut and exchanged image, and the encrypted position is decrypted and recognized in the image. The security of encryption is increased because the trained image recognition algorithm can recognize the special image used for encryption.
By the method, the character string plaintext is symmetrically encrypted firstly, so that a large amount of data is quickly encrypted to obtain the encrypted ciphertext. When symmetric encryption is performed, a character key is set. The character key needs to be input during decryption to carry out symmetric decryption. The character key is encrypted firstly, and is encrypted in an image mode, so that the image transmission mode can not be intercepted easily during transmission, and the data security is greatly improved. And obtaining the position of the encrypted character key in the image. Meanwhile, the image is encrypted, and a cutting mode is randomly provided during encryption, so that the meaning is not easily understood during interception, and the interception is not easily restored. And encrypts the random position and the clipping mode. The three-layer encryption mode provides multiple protections for the secret key, so that the encryption method is safer.
Example 2
Based on the above data encryption method, an embodiment of the present invention further provides a data encryption system, where the system includes:
a text acquisition structure: obtaining a character string plaintext; the character string plaintext represents a character string for transfer; obtaining a character key; the character key is a password set during encryption;
encryption ciphertext encryption structure: based on the character key, encrypting the character string in the clear text through a symmetric encryption algorithm to obtain an encrypted ciphertext; the encrypted ciphertext is a character obtained by encrypting a character string plaintext;
an image acquisition structure: obtaining an image set; obtaining an image set; the image set represents a plurality of character images stored in a database; the character image represents an image containing a plurality of characters; the name of the character image is a character existing in the character image.
Character key encryption structure: obtaining encryption information through an encryption algorithm based on the image set and the character key;
and (3) decryption structure: sending the encrypted ciphertext and the encrypted information to a receiver through a network, and decrypting based on the encrypted information to obtain decrypted information
Optionally, the obtaining of the encryption information by an encryption algorithm based on the image set and the character key includes:
obtaining an image password; the image password is a randomly generated character string; the image password comprises a cutting position, an exchange position and a transformation method label; the clipping position represents a position clipped according to a numerical scale; the exchange position represents exchanging the cutting position in the image; the transformation method label represents an image transformation method;
based on the character key, obtaining a character key image through a search algorithm; the character key image is an image containing character key characters;
based on the character key image and the character key, obtaining an image position character string through an image recognition model; the image position character string is a character string formed by a plurality of image positions; the image recognition model is a trained model;
based on the image password, converting the character key image to obtain an encrypted image;
encrypting the image password by an asymmetric encryption method to obtain an encrypted image password;
encrypting the image position character string by an asymmetric encryption method to obtain an encrypted image position;
obtaining encryption information; the encryption information includes an encrypted image, an encrypted image password, and an encrypted image position.
Optionally, the transforming the character key image based on the image password to obtain an encrypted image includes:
dividing the image into a plurality of parts based on the cutting position in the image password, and multiplying the position by the size of the image to obtain the position of the cut image;
performing image exchange based on the exchange positions in the cut image and the image password to obtain an exchange image;
and transforming the exchanged image based on the transformation method label in the image password to obtain a transformed image.
The specific manner in which the respective modules perform operations has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
An embodiment of the present invention further provides an electronic device, as shown in fig. 5, including a memory 504, a processor 502, and a computer program stored on the memory 504 and executable on the processor 502, where the processor 502 implements the steps of any one of the data encryption methods described above when executing the program.
Where in fig. 5 a bus architecture (represented by bus 500) is shown, bus 500 may include any number of interconnected buses and bridges, and bus 500 links together various circuits including one or more processors, represented by processor 502, and memory, represented by memory 504. The bus 500 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 505 provides an interface between the bus 500 and the receiver 501 and transmitter 503. The receiver 501 and the transmitter 503 may be the same element, i.e. a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 502 is responsible for managing the bus 500 and general processing, and the memory 504 may be used for storing data used by the processor 502 in performing operations.
Embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of any one of the aforementioned data encryption methods and the aforementioned related data.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in an apparatus according to an embodiment of the invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (10)

1. A method for data encryption, comprising:
obtaining a character string plaintext; the character string plaintext represents a character string for transfer;
obtaining a character key; the character key is a password set during encryption;
based on the character key, encrypting the character string in the clear text through a symmetric encryption algorithm to obtain an encrypted ciphertext; the encrypted ciphertext is a character obtained by encrypting a character string plaintext;
obtaining an image set; the image set represents a plurality of character images stored in a database; the character image represents an image containing a plurality of characters; the name of the character image is a character existing in the character image;
obtaining encryption information through an encryption algorithm based on the image set and the character key;
and sending the encrypted ciphertext and the encrypted information to a receiver through a network, and decrypting based on the encrypted information to obtain decrypted information.
2. The data encryption method according to claim 1, wherein the obtaining of the encryption information by the encryption algorithm based on the image set and the character key comprises:
obtaining an image password; the image password is a randomly generated character string; the image password comprises a cutting position, an exchange position and a transformation method label; the clipping position represents a position clipped according to a numerical scale; the exchange position represents exchanging the cutting position in the image; the transformation method label represents an image transformation method;
based on the character key, obtaining a character key image through a search algorithm; the character key image is an image containing character key characters;
based on the character key image and the character key, obtaining an image position character string through an image recognition model; the image position character string is a character string formed by a plurality of image positions; the image recognition model is a trained model;
based on the image password, converting the character key image to obtain an encrypted image;
encrypting the image password by an asymmetric encryption method to obtain an encrypted image password;
encrypting the image position character string by an asymmetric encryption method to obtain an encrypted image position;
obtaining encryption information; the encryption information includes an encrypted image, an encrypted image password, and an encrypted image position.
3. The data encryption method according to claim 2, wherein transforming the character key image based on the image cipher to obtain the encrypted image comprises:
dividing the image into a plurality of parts based on the cutting position in the image password, and multiplying the position by the size of the image to obtain the position of the cut image;
performing image exchange based on the exchange positions in the cut image and the image password to obtain an exchange image;
and transforming the exchanged image based on the transformation method label in the image password to obtain a transformed image.
4. The data encryption method of claim 1, wherein the sending the encrypted ciphertext and the encrypted information to a recipient via a network, and performing decryption based on the encrypted information to obtain decrypted information comprises:
obtaining an original image based on the encrypted image in the encryption information and the encrypted image password in the encryption information;
obtaining a character key based on the encrypted position and the original image;
and obtaining decryption information through a symmetric decryption algorithm based on the character key and the encrypted ciphertext.
5. The data encryption method according to claim 4, wherein obtaining the original image based on the encrypted image in the encrypted information and the encrypted image password in the encrypted information comprises:
obtaining a decrypted image password through an asymmetric decryption algorithm based on the encrypted image password;
based on the encrypted image position, obtaining a decrypted image position through an asymmetric decryption algorithm;
and obtaining the original image based on the decrypted image password and the encrypted image.
6. The data encryption method according to claim 5, wherein obtaining the original image based on the decrypted image password and the encrypted image comprises:
based on the transformation method label in the decrypted image password, restoring the image through a corresponding transformation restoration algorithm to obtain a transformation restored image;
obtaining a cutting reduction image position based on the cutting position in the decrypted image; the position of the cutting reduction image represents the position of the image for exchanging;
and reading the numbers from the end of the array of the exchange positions based on the exchange positions in the decrypted image, and exchanging the images at the subscript positions of the array to obtain the original image.
7. The data encryption method according to claim 4, wherein the deriving a character key based on the encryption position and the original image comprises:
decrypting the encrypted position through an asymmetric decryption algorithm to obtain a decrypted position; the decryption position method is a rule capable of converting the encryption position into an image position set before encryption; the decryption position method is a decryption method given by a sender;
obtaining an image frame to be detected based on the decryption position;
obtaining a plurality of images to be detected based on the image frame to be detected and the original image;
and inputting a plurality of images to be detected into the image recognition algorithm model for a plurality of times to obtain the character key.
8. A data encryption system, comprising:
a text acquisition structure: obtaining a character string plaintext; the character string plaintext represents a character string for transfer; obtaining a character key; the character key is a password set during encryption;
encryption ciphertext encryption structure: based on the character key, encrypting the character string in the clear text through a symmetric encryption algorithm to obtain an encrypted ciphertext; the encrypted ciphertext is a character obtained by encrypting a character string plaintext;
an image acquisition structure: obtaining an image set; obtaining an image set; the image set represents a plurality of character images stored in a database; the character image represents an image containing a plurality of characters; the name of the character image is a character existing in the character image;
character key encryption structure: obtaining encryption information through an encryption algorithm based on the image set and the character key;
and (3) decryption structure: and sending the encrypted ciphertext and the encrypted information to a receiver through a network, and decrypting based on the encrypted information to obtain decrypted information.
9. The data encryption system according to claim 8, wherein the obtaining of the encryption information by the encryption algorithm based on the image set and the character key comprises:
obtaining an image password; the image password is a randomly generated character string; the image password comprises a cutting position, an exchange position and a transformation method label; the clipping position represents a position clipped according to a numerical scale; the exchange position represents exchanging the cutting position in the image; the transformation method label represents an image transformation method;
based on the character key, obtaining a character key image through a search algorithm; the character key image is an image containing character key characters;
based on the character key image and the character key, obtaining an image position character string through an image recognition model; the image position character string is a character string formed by a plurality of image positions; the image recognition model is a trained model;
based on the image password, converting the character key image to obtain an encrypted image;
encrypting the image password by an asymmetric encryption method to obtain an encrypted image password;
encrypting the image position character string by an asymmetric encryption method to obtain an encrypted image position;
obtaining encryption information; the encryption information includes an encrypted image, an encrypted image password, and an encrypted image position.
10. The data encryption system according to claim 9, wherein said transforming the character key image based on the image cipher to obtain the encrypted image comprises:
dividing the image into a plurality of parts based on the cutting position in the image password, and multiplying the position by the size of the image to obtain the position of the cut image;
performing image exchange based on the exchange positions in the cut image and the image password to obtain an exchange image;
and transforming the exchanged image based on the transformation method label in the image password to obtain a transformed image.
CN202210172847.2A 2022-02-24 2022-02-24 Data encryption method and system Active CN114553549B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210172847.2A CN114553549B (en) 2022-02-24 2022-02-24 Data encryption method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210172847.2A CN114553549B (en) 2022-02-24 2022-02-24 Data encryption method and system

Publications (2)

Publication Number Publication Date
CN114553549A true CN114553549A (en) 2022-05-27
CN114553549B CN114553549B (en) 2024-01-02

Family

ID=81678028

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210172847.2A Active CN114553549B (en) 2022-02-24 2022-02-24 Data encryption method and system

Country Status (1)

Country Link
CN (1) CN114553549B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002292A (en) * 2022-06-02 2022-09-02 宜宾市辰安智能制造有限公司 Mobile phone information communication method, system and mobile phone

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140105382A1 (en) * 2010-11-29 2014-04-17 Beijing Z & W Technology Consullting Co., Ltd. Data Encryption and Decryption Method and Apparatus
CN104868996A (en) * 2014-02-25 2015-08-26 中兴通讯股份有限公司 Data encryption and decryption method, device thereof, and terminal
CN107784237A (en) * 2017-11-10 2018-03-09 朱信 Text-character library dual stochastic transposition encryption
CN108337233A (en) * 2017-12-26 2018-07-27 广东辰宜信息科技有限公司 It is a kind of to the encrypted method of content information, electronic equipment and storage medium
CN108833099A (en) * 2018-07-27 2018-11-16 深圳市新名泽科技有限公司 Key generation method, device, key recovery method and device
US20200186330A1 (en) * 2018-12-06 2020-06-11 Nuvoton Technology Corporation Encryption and decryption system, encryption device, decryption device and encryption and decryption method
CN113992810A (en) * 2021-10-21 2022-01-28 浙江工商大学 Agile image encryption method based on deep learning

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140105382A1 (en) * 2010-11-29 2014-04-17 Beijing Z & W Technology Consullting Co., Ltd. Data Encryption and Decryption Method and Apparatus
CN104868996A (en) * 2014-02-25 2015-08-26 中兴通讯股份有限公司 Data encryption and decryption method, device thereof, and terminal
CN107784237A (en) * 2017-11-10 2018-03-09 朱信 Text-character library dual stochastic transposition encryption
CN108337233A (en) * 2017-12-26 2018-07-27 广东辰宜信息科技有限公司 It is a kind of to the encrypted method of content information, electronic equipment and storage medium
CN108833099A (en) * 2018-07-27 2018-11-16 深圳市新名泽科技有限公司 Key generation method, device, key recovery method and device
US20200186330A1 (en) * 2018-12-06 2020-06-11 Nuvoton Technology Corporation Encryption and decryption system, encryption device, decryption device and encryption and decryption method
CN113992810A (en) * 2021-10-21 2022-01-28 浙江工商大学 Agile image encryption method based on deep learning

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
XINXIN TONG: "BFSN: A Novel Method of Encrypted Traffic Classification Based on Bidirectional Flow Sequence Network", 《2020 3RD INTERNATIONAL CONFERENCE ON HOT INFORMATION-CENTRIC NETWORKING (HOTICN)》 *
亓传伟;: "如何利用图片加密文本文件", 电脑编程技巧与维护, no. 09 *
赵立龙;方志良;顾泽苍;: "一种新的基于魔方变换的数字图像置乱加密算法", 光电子.激光, no. 01 *
陈绍钧;: "一种基于混沌理论的字符串加密算法", 计算机应用与软件, no. 06 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002292A (en) * 2022-06-02 2022-09-02 宜宾市辰安智能制造有限公司 Mobile phone information communication method, system and mobile phone

Also Published As

Publication number Publication date
CN114553549B (en) 2024-01-02

Similar Documents

Publication Publication Date Title
CN107733656A (en) A kind of cipher authentication method and device
CN111835511A (en) Data security transmission method and device, computer equipment and storage medium
US10943020B2 (en) Data communication system with hierarchical bus encryption system
US20130315394A1 (en) Data encryption method, data verification method and electronic apparatus
CN109274644B (en) Data processing method, terminal and watermark server
CN106685905A (en) Systems and methods of encrypted transmission of web pages
CN105976005A (en) Two-dimensional code encrypting method, two-dimensional code generating device and two-dimensional code scanning device
CN106603496A (en) Data transmission protection method, intelligent card, server, and communication system
CN109977684A (en) A kind of data transmission method, device and terminal device
CN102782692A (en) System, apparatus and method for encryption and decryption of data transmitted over a network
CN107426172A (en) The matching method for pushing and device of a kind of identity information
CN112491529B (en) Data file encryption and integrity verification method and system used in untrusted server environment
CN105553980A (en) Safety fingerprint identification system and method based on cloud computing
CN114553549B (en) Data encryption method and system
CN109412791B (en) Key information processing method, device, electronic equipment and computer-readable medium
CN111556072A (en) Improved index encryption algorithm and system
CN112380404B (en) Data filtering method, device and system
CN105678185B (en) A kind of data security protection method and intelligent terminal management system
CN108900472A (en) The transmission method and device of information
CN105610811B (en) Authentication method and its relevant equipment and system
CN113901502A (en) Data processing method and device, electronic equipment and storage medium
Mohamed et al. Protecting wireless data transmission in mobile application systems using digital watermarking technique
CN110503430A (en) Transaction processing method, safety element and smart card
CN115396222B (en) Device instruction execution method, system, electronic device and readable storage medium
CN113434845B (en) Business handling method and device, electronic equipment and computer readable storage medium

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