CN114553549B - Data encryption method and system - Google Patents

Data encryption method and system Download PDF

Info

Publication number
CN114553549B
CN114553549B CN202210172847.2A CN202210172847A CN114553549B CN 114553549 B CN114553549 B CN 114553549B CN 202210172847 A CN202210172847 A CN 202210172847A CN 114553549 B CN114553549 B CN 114553549B
Authority
CN
China
Prior art keywords
image
encrypted
character
obtaining
password
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
CN202210172847.2A
Other languages
Chinese (zh)
Other versions
CN114553549A (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

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)
  • Storage Device Security (AREA)
  • Facsimile Transmission Control (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. And encrypting the character string plaintext by a symmetric encryption algorithm based on the character key to obtain an encrypted ciphertext. A set of images is obtained. Based on the image set and the character key, the encryption information is obtained through an encryption algorithm. And sending the encrypted ciphertext and the encrypted information to a receiver through a network, and decrypting based on the encrypted information to obtain decryption information. The three-layer encryption mode provides various protections for the secret key, so that the encryption method is safer. The image is encrypted, and the image transmission mode is not easy to intercept during transmission, so that 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, a character string transmission mode is generally adopted to encrypt data. However, if the character string transmission is symmetric encryption, the encryption mode is easily obtained from the receiver side, so that the data is obtained. If the string transmission uses asymmetric encryption, it can also be intercepted and broken. There is a need for a more secure method of data encryption.
Disclosure of Invention
The present invention is directed to a data encryption method and system, which are used for solving 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 text of the character string represents the character string for transmission;
obtaining a character key; the character key is a password set during encryption;
encrypting the character string plaintext by a symmetric encryption algorithm based on the character key to obtain an encrypted ciphertext; the encrypted ciphertext is a character obtained by encrypting a character string plaintext;
obtaining an image set; the image collection representing 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;
based on the image set and the character key, obtaining encryption information through an encryption algorithm;
and sending the encrypted ciphertext and the encrypted information to a receiver through a network, and decrypting based on the encrypted information to obtain decryption information.
Optionally, the obtaining the encrypted information based on the image set and the character key through an encryption algorithm includes:
obtaining an image password; the image password is a randomly generated character string; the image password comprises a cutting position, a switching position and a transformation method label; the clipping position represents a position clipped according to a digital proportion; the exchange position represents exchanging the clipping 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 searching 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;
transforming the character key image based on the image password 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 encrypted information includes an encrypted image, an encrypted image password, and an encrypted image location.
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 clipping position in the image password, and multiplying the position by the image size to obtain the clipping image position;
based on the exchange positions in the clipping image and the image password, carrying out image exchange to obtain an exchange image;
and transforming the exchange 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 via the network, 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 encryption position and the original image;
based on the character key and the encrypted ciphertext, obtaining decryption information through a symmetric decryption algorithm.
Optionally, the obtaining the original image based on the encrypted image in the encrypted information and the encrypted image password in the encrypted information includes:
based on the encrypted image password, obtaining a decrypted image password through an asymmetric decryption algorithm;
obtaining a decrypted image position through an asymmetric decryption algorithm based on the encrypted image position;
and obtaining an original image based on the decrypted image password and the encrypted image.
Optionally, the obtaining the original image based on the decrypted image password and the encrypted image includes:
based on a 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 clipping restored image position based on the clipping position in the decrypted image; the clipping restored image position represents the position of the image subjected to the exchange;
based on the exchange position in the decrypted image, reading the number from the end of the exchange position array, and exchanging the image at the subscript position of the array to obtain the original image.
Optionally, the obtaining the character key based on the encryption 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 a position set of the image 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 frames to be detected and the original images;
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:
the text acquisition structure comprises: obtaining a character string plaintext; the text of the character string represents the character string for transmission; obtaining a character key; the character key is a password set during encryption;
encryption ciphertext encryption structure: encrypting the character string plaintext by a symmetric encryption algorithm based on the character key to obtain an encrypted ciphertext; the encrypted ciphertext is a character obtained by encrypting a character string plaintext;
image acquisition structure: obtaining an image set; obtaining an image set; the image collection representing 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: based on the image set and the character key, obtaining encryption information through an encryption algorithm;
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 decryption information.
Optionally, the obtaining the encrypted information based on the image set and the character key through an encryption algorithm includes:
obtaining an image password; the image password is a randomly generated character string; the image password comprises a cutting position, a switching position and a transformation method label; the clipping position represents a position clipped according to a digital proportion; the exchange position represents exchanging the clipping 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 searching 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;
transforming the character key image based on the image password 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 encrypted information includes an encrypted image, an encrypted image password, and an encrypted image location.
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 clipping position in the image password, and multiplying the position by the image size to obtain the clipping image position;
based on the exchange positions in the clipping image and the image password, carrying out image exchange to obtain an exchange image;
based on the transformation method label in the image password, the exchange image is transformed to obtain a transformed 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 the string for delivery. A character key is obtained. The character key is a password set when encryption is performed. And encrypting the character string plaintext by a symmetric encryption algorithm based on the character key to obtain an encrypted ciphertext. The encrypted ciphertext is a character obtained by encrypting the character string plaintext. A set of images is obtained. The image collection 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 characters existing in the character image. Based on the image set and the character key, the encryption information is obtained through an encryption algorithm. And sending the encrypted ciphertext and the encrypted information to a receiver through a network, and decrypting based on the encrypted information to obtain decryption information.
The method of transferring the picture is used for encrypting the password, so that the password is transferred by the image, the image is randomly cut, and the password is transmitted together by the image position and the cut image instead of being transferred by the character string, thereby increasing the security of the password. The trained image recognition model can be used for encrypting the encrypted image and detecting the position of the encrypted image when decrypting, and the encrypted image can be encrypted and decrypted safely. The character key is encrypted first, the image is used for encryption, and the random position and the clipping mode are encrypted. The three-layer encryption mode provides various 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 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 according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of a decryption structure in a data encryption system according to an embodiment of the present invention
Fig. 5 is a schematic block diagram of an electronic device according to an embodiment of the present invention.
The marks in the figure: a bus 500; a receiver 501; a processor 502; a transmitter 503; a memory 504; bus interface 505.
Detailed Description
The present invention will be described in detail with reference to the accompanying drawings.
Example 1
As shown in fig. 1, an embodiment of the present invention provides a data encryption method, which includes:
s101: and obtaining the plaintext of the character string. The string plaintext represents the string for delivery.
S102: a character key is obtained. The character key is a password set when encryption is performed.
S103: and encrypting the character string plaintext by a symmetric encryption algorithm based on the character key to obtain an encrypted ciphertext. The encrypted ciphertext is a character obtained by encrypting the character string plaintext.
In this embodiment, the symmetric encryption algorithm is a GPG algorithm.
S104: obtaining an image set; the image collection representing 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 characters existing in the character image.
S105: based on the image set and the character key, obtaining encryption information through an encryption algorithm;
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.
The encryption and decryption process is shown in fig. 2.
Optionally, the obtaining the encrypted information based on the image set and the character key through an encryption algorithm includes:
obtaining an image password; the image password is a randomly generated character string; the image password comprises a cutting position, a switching position and a transformation method label; the clipping position represents a position clipped according to a digital proportion; the exchange position represents exchanging the clipping position in the image; the transformation method tag represents an image transformation method.
Based on the character key, obtaining a character key image through a searching algorithm; the character key image is an image containing character key characters.
The searching method in this embodiment adopts a sequential searching mode, and searches for multiple times until an image containing all the characters of the character key is found.
And obtaining an image position character string through image recognition based on the character key image and the character key. The image position character string is a character string formed by 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 sequence according to the positions of the characters in the character key in the image. The positions of the image position character strings are separated according to specific coincidence, and the separation is carried out by adopting the characters in the embodiment. The image position represents a border position of a character key in the image. The arrangement of the single image positions is the abscissa of the central point, the ordinate of the central point, the wide frame and the high frame.
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 corresponding plurality of annotation data; the annotation data comprises an annotation category and an annotation position. The annotation category represents the category of the characters in the image; the noted positions represent the positions of the characters in the image. The image representation database includes all images that can be used to provide a character key. And putting the training set into a first convolution, and extracting the characteristics to obtain a characteristic diagram. Inputting the feature map into a full connection layer for classification to obtain feature vectors; the elements of the feature vector are labels. The number of elements in the feature vector is the number of categories plus the number of positions. The number of positions includes a center point position and a width and height. Corresponding to detecting each position in the characteristic diagram, whether the position meets the cross ratio threshold value is checked. The cross ratio threshold in this embodiment is 0.9. And obtaining a loss value through a loss function based on the feature vector and the labeling data. Wherein the class is discriminated using a cross entropy loss function. And judging the core width and height of the central point position by using a mean square error loss function. Obtaining the current training iteration times of the image recognition model and the preset maximum iteration times of the image recognition model training. In this embodiment, the maximum iteration number is 8000. And stopping training when the loss value is smaller than or equal to a threshold value or the training iteration number reaches the maximum iteration number, and obtaining a trained image recognition model.
And transforming the character key image based on the image password 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 string is an opensl algorithm.
Obtaining encryption information; the encrypted information includes an encrypted image, an encrypted image password, and an encrypted image location.
Wherein 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 character positions in the image by adopting a specific convolution mode, and transmitting the character positions as information without directly transmitting characters or characters corresponding to a character key obtained through an algorithm. Because the pictures are randomly acquired, the positions of the pictures are also random, and the data can be encrypted 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, dividing the image into a plurality of parts, and multiplying the position by the image size to obtain the clipping image position.
Wherein, part of the image code [ [5,4,0,0,0] ] in this embodiment. The clipping position such as [5,4] means dividing the image width into 5 parts, including 0 th, 1 st, 2 nd, 3 rd, 4 th wide parts, respectively. The image is divided into 4 parts, including 0 high part, 1 high part, 2 high part and 3 high part. Multiplying the clipping position by the image size and adding the clipping position to the bottom position to obtain the clipping image position. The 0 th high portion position (0,44), the 1 st wide portion position (44,89), the 2 nd wide portion position (89,134), the 3 rd wide portion position (134, 179), the 4 th wide portion position (179,224), the 0 th high portion position (0,56), the 1 st high portion position (56, 112), the 2 nd high portion position (112,168), and the 4 th wide portion position (168, 224) are obtained.
And performing image exchange based on the exchange positions in the clipping image and the image password to obtain an exchange image.
The partial image passwords of the embodiment are [ [5,4,0,0,0], [1,2,4,3,1], [0,1,3,4,1] ]. The image width exchange position [1,2,4,3,0] indicates that the divided 0 th and 1 st wide portions are exchanged, the 1 st and 2 nd wide portions are exchanged, the 2 nd and 4 th wide portions are exchanged, the 3 rd and 3 rd wide portions are exchanged, and the 4 th and 0 th wide portions are exchanged. The image height exchange position [0,1,3,4,1] indicates that the 0 th and 0 th high portions of the division are exchanged, the 1 st high portion is exchanged with the 1 st high portion, the 2 nd high portion is exchanged with the 3 rd high portion, the 3 rd high portion is exchanged with the 4 th high portion, and the 4 th high portion is exchanged with the 1 st high portion.
And transforming the exchange 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 overturning algorithm, image rotation and translation transformation. And matching the image password with the transformation tag to obtain corresponding transformation methods, and operating the image by using the transformation methods to obtain a transformation image.
By the above method, for quick transmission, all of the randomly selected images are subjected to the transformation operation, and the image is transmitted. The transformed image cannot be identified by naked eyes and cannot be identified by a computer, and 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 via the network, decrypting based on the encrypted information to obtain decrypted information includes:
and obtaining an original image based on the encrypted image in the encrypted information and the encrypted image password in the encrypted information.
Based on the encryption position and the original image, a character key is obtained.
Based on the character key and the encrypted ciphertext, obtaining decryption information through a symmetric decryption algorithm.
In this embodiment, the symmetric encryption algorithm is a GPG algorithm.
Wherein the decryption structure is shown in fig. 4.
Through the method, the specific decryption algorithm is used for decrypting the 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 can decrypt the image by the decryption recognition model. The picture is not easily decrypted by other interception.
Optionally, the obtaining the original image based on the encrypted image in the encrypted information and the encrypted image password in the encrypted information includes:
based on the encrypted image password, obtaining a decrypted image password through an asymmetric decryption algorithm;
obtaining a decrypted image position through an asymmetric decryption algorithm based on the encrypted image position;
and obtaining an 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 opensl algorithm.
The method comprises the steps of firstly decrypting the encrypted image password and the image position, then restoring the image by decrypting the image password and the decrypted image position, and obtaining the position of the character in the restored image, thereby obtaining the character key. By decrypting the information that restores the image multiple times, security is increased.
Optionally, the obtaining the original image based on the decrypted image password and the encrypted image includes:
based on a 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 clipping restored image position based on the clipping position in the decrypted image; the clipping restored image position represents the position of the image subjected to the exchange;
based on the exchange position in the decrypted image, reading the number from the end of the exchange position array, and exchanging the image at the subscript position of the array to obtain the original image.
By the method, the image is restored by the image restoration method provided by the sender, the image is restored by the method of decryption and restoring the image by the reverse sequence of exchange positions through the clipping information and the exchange information randomly generated by the sender. Since the provided clipping information and the exchange information are random, security is further increased.
Optionally, the obtaining the character key based on the encryption 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 a position set of the image before encryption; the decryption location method is a decryption method given by the sender.
The asymmetric decryption method for decrypting the encryption position to obtain the decryption 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 frames to be detected and the original images;
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 and a trained image recognition algorithm provided by a sender are used, the image recognition algorithm can recognize the image after clipping and exchanging, the encryption position is decrypted, and the encryption position is recognized in the image. Since the trained image recognition algorithm can recognize a specific image for encryption, encryption security is increased.
By the method, the character string plaintext is firstly symmetrically encrypted, so that a large amount of data is quickly encrypted, and the encrypted ciphertext is obtained. In symmetric encryption, a character key is set. The character key requires input during decryption to perform symmetric decryption. The character key is firstly encrypted, the image is used for encryption, the image transmission mode is not easy to intercept during transmission, and the data security is greatly improved. The position of the character key in the image after encryption is obtained. Meanwhile, the image is encrypted, and a clipping mode is randomly provided during encryption, so that the meaning is not easy to understand and restore during interception. And the random location and clipping pattern are encrypted. The three-layer encryption mode provides various protections for the secret key, so that the encryption method is safer.
Example 2
Based on the above-mentioned data encryption method, the embodiment of the invention also provides a data encryption system, which comprises:
the text acquisition structure comprises: obtaining a character string plaintext; the text of the character string represents the character string for transmission; obtaining a character key; the character key is a password set during encryption;
encryption ciphertext encryption structure: encrypting the character string plaintext by a symmetric encryption algorithm based on the character key to obtain an encrypted ciphertext; the encrypted ciphertext is a character obtained by encrypting a character string plaintext;
image acquisition structure: obtaining an image set; obtaining an image set; the image collection representing 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 characters existing in the character image.
Character key encryption structure: based on the image set and the character key, obtaining encryption information through an encryption algorithm;
decryption structure: the encrypted ciphertext and the encrypted information are sent to a receiver through a network, and decryption is carried out based on the encrypted information to obtain decryption information
Optionally, the obtaining the encrypted information based on the image set and the character key through an encryption algorithm includes:
obtaining an image password; the image password is a randomly generated character string; the image password comprises a cutting position, a switching position and a transformation method label; the clipping position represents a position clipped according to a digital proportion; the exchange position represents exchanging the clipping 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 searching 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;
transforming the character key image based on the image password 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 encrypted information includes an encrypted image, an encrypted image password, and an encrypted image location.
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 clipping position in the image password, and multiplying the position by the image size to obtain the clipping image position;
based on the exchange positions in the clipping image and the image password, carrying out image exchange to obtain an exchange image;
and transforming the exchange image based on the transformation method label in the image password to obtain a transformed image.
The specific manner in which the various modules perform the operations in the systems of the above embodiments have been described in detail herein with respect to the embodiments of the method, and will not be described in detail herein.
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 in the memory 504 and capable of running 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), bus 500 may include any number of interconnected buses and bridges, with bus 500 linking together various circuits, including one or more processors, represented by processor 502, and memory, represented by memory 504. Bus 500 may also link together various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., as are well known in the art and, therefore, will not be described further herein. Bus interface 505 provides an interface between bus 500 and 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, while the memory 504 may be used to store data used by the processor 502 in performing operations.
The embodiments of the present invention also provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the methods of a data encryption method described above, as well as the data referred to above.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with the teachings herein. The required structure for a construction of such a system is apparent from the description above. In addition, the present invention is not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood 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 construed as reflecting the intention that: i.e., the claimed invention 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 apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. 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. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units 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 but not others included in other embodiments, 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 can be used in any combination.
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 some or all of the functions of some or all of the components in an apparatus according to embodiments of the present invention may be implemented in practice using a microprocessor or Digital Signal Processor (DSP). The present invention can also be implemented as an apparatus or device program (e.g., a computer program and a computer program product) for performing a portion or all of the methods described herein. Such a program embodying the present invention may be stored on a computer readable medium, or may have the form of one or more signals. Such signals may be downloaded from an internet website, provided on a carrier signal, or provided 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 use of the words first, second, third, etc. do not denote any order. These words may be interpreted as names.

Claims (8)

1. A data encryption method, comprising:
obtaining a character string plaintext; the text of the character string represents the character string for transmission;
obtaining a character key; the character key is a password set during encryption;
encrypting the character string plaintext by a symmetric encryption algorithm based on the character key to obtain an encrypted ciphertext; the encrypted ciphertext is a character obtained by encrypting a character string plaintext;
obtaining an image set; the image collection representing 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;
based on the image set and the character key, obtaining encryption information through an encryption algorithm;
the encrypted ciphertext and the encrypted information are sent to a receiver through a network, and decryption is carried out based on the encrypted information to obtain decryption information;
the obtaining the encryption information based on the image set and the character key through an encryption algorithm comprises the following steps:
obtaining an image password; the image password is a randomly generated character string; the image password comprises a cutting position, a switching position and a transformation method label; the clipping position represents a position clipped according to a digital proportion; the exchange position represents exchanging the clipping 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 searching 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;
transforming the character key image based on the image password 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 encrypted information includes an encrypted image, an encrypted image password, and an encrypted image location.
2. The method for encrypting data according to claim 1, wherein said transforming the character key image based on the image password to obtain the encrypted image comprises:
dividing the image into a plurality of parts based on the clipping position in the image password, and multiplying the position by the image size to obtain the clipping image position;
based on the exchange positions in the clipping image and the image password, carrying out image exchange to obtain an exchange image;
and transforming the exchange image based on the transformation method label in the image password to obtain a transformed image.
3. The method for encrypting data according to claim 1, wherein said transmitting the encrypted ciphertext and the encrypted information to the receiver via the network, decrypting based on the encrypted information, and obtaining the decrypted information, comprises:
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 encryption position and the original image;
based on the character key and the encrypted ciphertext, obtaining decryption information through a symmetric decryption algorithm.
4. A data encryption method according to claim 3, wherein the obtaining the original image based on the encrypted image in the encrypted information and the encrypted image password in the encrypted information comprises:
based on the encrypted image password, obtaining a decrypted image password through an asymmetric decryption algorithm;
obtaining a decrypted image position through an asymmetric decryption algorithm based on the encrypted image position;
and obtaining an original image based on the decrypted image password and the encrypted image.
5. The method for encrypting data according to claim 4, wherein said obtaining an original image based on the decrypted image password and the encrypted image comprises:
based on a 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 clipping restored image position based on the clipping position in the decrypted image; the clipping restored image position represents the position of the image subjected to the exchange;
based on the exchange position in the decrypted image, reading the number from the end of the exchange position array, and exchanging the image at the subscript position of the array to obtain the original image.
6. A data encryption method according to claim 3, wherein the obtaining a character key based on the encryption location 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 a position set of the image 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 frames to be detected and the original images;
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.
7. A data encryption system, comprising:
the text acquisition structure comprises: obtaining a character string plaintext; the text of the character string represents the character string for transmission; obtaining a character key; the character key is a password set during encryption;
encryption ciphertext encryption structure: encrypting the character string plaintext by a symmetric encryption algorithm based on the character key to obtain an encrypted ciphertext; the encrypted ciphertext is a character obtained by encrypting a character string plaintext;
image acquisition structure: obtaining an image set; obtaining an image set; the image collection representing 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: based on the image set and the character key, obtaining encryption information through an encryption algorithm;
decryption structure: the encrypted ciphertext and the encrypted information are sent to a receiver through a network, and decryption is carried out based on the encrypted information to obtain decryption information;
the method for obtaining the encryption information based on the image set and the character key through an encryption algorithm comprises the following steps:
obtaining an image password; the image password is a randomly generated character string; the image password comprises a cutting position, a switching position and a transformation method label; the clipping position represents a position clipped according to a digital proportion; the exchange position represents exchanging the clipping 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 searching 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;
transforming the character key image based on the image password 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 encrypted information includes an encrypted image, an encrypted image password, and an encrypted image location.
8. The data encryption system according to claim 7, wherein the transforming the character key image based on the image password to obtain the encrypted image comprises:
dividing the image into a plurality of parts based on the clipping position in the image password, and multiplying the position by the image size to obtain the clipping image position;
based on the exchange positions in the clipping image and the image password, carrying out image exchange to obtain an exchange image;
and transforming the exchange 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 CN114553549A (en) 2022-05-27
CN114553549B true 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)

Families Citing this family (1)

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

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN113992810A (en) * 2021-10-21 2022-01-28 浙江工商大学 Agile image encryption method based on deep learning

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101984574B (en) * 2010-11-29 2012-09-05 北京卓微天成科技咨询有限公司 Data encryption and decryption method and device
TWI675578B (en) * 2018-12-06 2019-10-21 新唐科技股份有限公司 Encryption and decryption system, encryption device, decryption device and encryption and decryption method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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
BFSN: A Novel Method of Encrypted Traffic Classification Based on Bidirectional Flow Sequence Network;Xinxin Tong;《2020 3rd International Conference on Hot Information-Centric Networking (HotICN)》;全文 *
一种基于混沌理论的字符串加密算法;陈绍钧;;计算机应用与软件(06);全文 *
一种新的基于魔方变换的数字图像置乱加密算法;赵立龙;方志良;顾泽苍;;光电子.激光(01);全文 *
如何利用图片加密文本文件;亓传伟;;电脑编程技巧与维护(09);全文 *

Also Published As

Publication number Publication date
CN114553549A (en) 2022-05-27

Similar Documents

Publication Publication Date Title
CN106096548B (en) Multi-intelligent-terminal shared face secret recognition method based on cloud environment
CN109803142B (en) Encrypted domain image reversible data hiding method based on neighborhood prediction
CN111507386B (en) Method and system for detecting encryption communication of storage file and network data stream
CN109977684A (en) A kind of data transmission method, device and terminal device
CN114444033A (en) Data security protection system and method based on Internet of things
CN105976005A (en) Two-dimensional code encrypting method, two-dimensional code generating device and two-dimensional code scanning device
CN112347508A (en) Block chain data sharing encryption and decryption method and system
CN106603496A (en) Data transmission protection method, intelligent card, server, and communication system
CN112256786B (en) Multi-modal data processing method and device
CN114553549B (en) Data encryption method and system
CN111245783A (en) Isolated environment data transmission device and method based on digital encryption technology
CN107665314A (en) The trusted processes method and device signed on the electronic document
CN107196973A (en) A kind of data encryption, decryption method and device
CN112380404B (en) Data filtering method, device and system
CN105678185B (en) A kind of data security protection method and intelligent terminal management system
CN108512651A (en) A kind of artificial intelligence image identification attack defense method, system and storage medium
CN112039876A (en) Data ferrying method, device, equipment and medium
CN114845302B (en) Near field encryption communication method and system based on Internet of things
CN105610811B (en) Authentication method and its relevant equipment and system
CN109064197A (en) A kind of supply chain opening registration and Verification System and method based on block chain
CN114722044A (en) Method and device for marking federal graph nodes, computer equipment and medium
CN113810558A (en) Image encryption method and system based on big data
CN113901502A (en) Data processing method and device, electronic equipment and storage medium
CN106204405A (en) A kind of high security school bus information processing system
CN115002292B (en) Mobile phone information communication method, system and mobile phone

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