CN113630237A - Data encryption method and device and data decryption method and device - Google Patents
Data encryption method and device and data decryption method and device Download PDFInfo
- Publication number
- CN113630237A CN113630237A CN202110845601.2A CN202110845601A CN113630237A CN 113630237 A CN113630237 A CN 113630237A CN 202110845601 A CN202110845601 A CN 202110845601A CN 113630237 A CN113630237 A CN 113630237A
- Authority
- CN
- China
- Prior art keywords
- data
- algorithm
- irreversible
- target
- equipment
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 60
- 230000002427 irreversible effect Effects 0.000 claims abstract description 80
- 230000002441 reversible effect Effects 0.000 claims description 42
- 238000004891 communication Methods 0.000 claims description 14
- 238000004590 computer program Methods 0.000 claims description 7
- 238000012545 processing Methods 0.000 claims description 6
- 230000005540 biological transmission Effects 0.000 abstract description 17
- 230000008569 process Effects 0.000 description 10
- 238000013478 data encryption standard Methods 0.000 description 6
- 230000009471 action Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000000779 smoke Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0643—Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network 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
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Power Engineering (AREA)
- Storage Device Security (AREA)
Abstract
The application provides a data encryption method and device and a data decryption method and device, wherein the data encryption method comprises the following steps: the method comprises the steps that first equipment encrypts first data to be transmitted through a first target algorithm to obtain second data, wherein the target algorithm comprises an irreversible algorithm; the second data comprises the first data and a summary generated based on the irreversible algorithm; the abstract in the irreversible algorithm is an abstract in a corresponding relation represented by a preset rainbow table, and the corresponding relation is a corresponding relation between the abstract and a ciphertext string; and the first equipment encodes the second data in a first encoding mode and transmits the encoded second data to the second equipment. Through the application, the problem that in the prior art, data security of equipment is low in the data transmission process is solved.
Description
Technical Field
The present application relates to the field of data protection, and in particular, to a method and an apparatus for encrypting data and a method and an apparatus for decrypting data.
Background
With the continuous improvement of living standard, the development of smart home is fast, which attracts many household appliances to enter and research and develop related intelligent products. But as smart products step into the line of sight of people, security risks have also raised more concerns. Currently, many smart devices are associated with sensors and perform operations based on data transmitted by the sensors. Therefore, certain safety risk can be brought, if the data of the simulated smoke and the temperature sensor are sent to the fire extinguishing safety device in the process of obtaining the transmission process of the sensor, the starting of the safety device can be caused, and the attack to the intelligent equipment is completed. For this reason, no effective solution exists at present.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for encrypting data, and a method and an apparatus for decrypting data, so as to solve the problem in the prior art that data security is low during data transmission of a device. The specific technical scheme is as follows:
in a first aspect, a method for encrypting data is provided, including: the method comprises the steps that first equipment encrypts first data to be transmitted through a first target algorithm to obtain second data, wherein the target algorithm comprises an irreversible algorithm; the second data comprises the first data and a summary generated based on the irreversible algorithm; the abstract in the irreversible algorithm is an abstract in a corresponding relation represented by a preset rainbow table, and the corresponding relation is a corresponding relation between the abstract and a ciphertext string; and the first equipment encodes the second data in a first encoding mode and transmits the encoded second data to the second equipment.
In a second aspect, a method for decrypting data is provided, including: the second device receives second data transmitted by the first device; the second data is obtained by encrypting through a first target algorithm and coding through a first coding mode; the first target algorithm comprises an irreversible algorithm; the second data comprises first data to be transmitted by the first equipment and a summary generated based on the irreversible algorithm; the second device decodes the second data based on a first decoding mode, wherein the first decoding mode corresponds to the first coding mode; and the second equipment searches a cipher text string corresponding to the abstract through a preset rainbow table, and decrypts the decoded second data through the cipher text string to obtain the first data, wherein the rainbow table is used for representing the corresponding relation between the abstract and the cipher text string.
In a third aspect, an apparatus for encrypting data is provided, which is applied to a first device, and includes: the device comprises a first encryption module, a second encryption module and a third encryption module, wherein the first encryption module is used for encrypting first data to be transmitted through a first target algorithm to obtain second data, and the target algorithm comprises an irreversible algorithm; the second data comprises the first data and a summary generated based on the irreversible algorithm; the abstract in the irreversible algorithm is an abstract in a corresponding relation represented by a preset rainbow table, and the corresponding relation is a corresponding relation between the abstract and a ciphertext string; and the processing module is used for coding the second data in the first coding mode and transmitting the coded second data to the second equipment.
In a fourth aspect, an apparatus for decrypting data is provided, which is applied to a second device, and includes: the receiving module is used for receiving second data transmitted by the first equipment; the second data is obtained by encrypting through a first target algorithm and coding through a first coding mode; the first target algorithm comprises an irreversible algorithm; the second data comprises first data to be transmitted by the first equipment and a summary generated based on the irreversible algorithm; a decoding module, configured to decode the second data based on a first decoding manner, where the first decoding manner corresponds to the first encoding manner; and the decryption module is used for searching a ciphertext string corresponding to the abstract through a preset rainbow table and decrypting the decoded second data through the ciphertext string to obtain the first data, wherein the rainbow table is used for representing the corresponding relation between the abstract and the ciphertext string.
In a fifth aspect, there is also provided a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the method of the first aspect described above, or cause the computer to perform the method of the second aspect described above.
In a sixth aspect, there is also provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of the first aspect described above, or cause the computer to perform the method of the second aspect described above.
Through the application, the first data to be transmitted of the first equipment can be encrypted through the irreversible algorithm, the second data are encoded and transmitted through the first encoding mode, the abstract obtained through encryption of the irreversible algorithm can be found in the preset rainbow table, the irreversible algorithm is decrypted through the rainbow table, namely, encryption protection is performed through the irreversible algorithm in the transmission process, under the condition that the rainbow table is not available, other equipment cannot illegally decrypt the data in the transmission process, the data to be transmitted are safer, and the problem that the data security of the equipment is lower in the data transmission process in the prior art is solved.
Drawings
Fig. 1 is a flowchart of an encryption method of data according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of decrypting data according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an apparatus for encrypting data according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data decryption apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
An embodiment of the present application provides a data encryption method, as shown in fig. 1, the method includes the steps of:
102, encrypting first data to be transmitted by first equipment through a first target algorithm to obtain second data, wherein the target algorithm comprises an irreversible algorithm; the second data comprises the first data and a summary generated based on an irreversible algorithm; the abstract in the irreversible algorithm is an abstract in a corresponding relation represented by a preset rainbow table, and the corresponding relation is a corresponding relation between the abstract and the ciphertext string.
And 104, the first device encodes the second data in the first encoding mode and transmits the encoded second data to the second device.
Through the above steps 102 and 104, the first data to be transmitted by the first device can be encrypted through the irreversible algorithm, the second data is encoded and transmitted through the first encoding mode, the summary obtained through encryption through the irreversible algorithm can be found in the preset rainbow table, so that the irreversible algorithm is decrypted through the rainbow table, namely, encryption protection is performed through the irreversible algorithm in the transmission process, and under the condition that the rainbow table is not available, other devices cannot illegally decrypt the data in the transmission process, so that the data to be transmitted is safer, and the problem that the data security of the devices in the data transmission process is lower in the prior art is solved.
It should be noted that the first device in the embodiment of the present application may be a sensor, such as a temperature sensor, a pressure sensor, or the like. The irreversible Algorithm in the embodiment of the present application may be a Message Digest Algorithm (MD 5), a Secure Hash Algorithm (SHA), or the like. The first encoding manner in the embodiment of the present application may be BASE64 (binary data is represented based on 64 printable characters). In addition, encoding data by BASE64 may also improve the security of the data to be transmitted.
In an optional implementation manner of the embodiment of the present application, in order to further improve the security of data in the transmission process, a plurality of irreversible algorithms may be used to encrypt data to be transmitted, for example, after the MD5 transmits the first data, the encrypted data may be encrypted again by SHA, and after two layers of encryption, the security is higher and the decryption difficulty is higher. It should be noted that different rainbow tables may be preset for different irreversible algorithms, that is, if MD5 and SHA are used simultaneously for encryption, rainbow tables corresponding to MD5 and SHA are preset respectively. Of course, this is merely an example, and may also be encryption of three layers or four layers of irreversible algorithms, and specific several layers may be encrypted according to actual situations, which is not limited in this application.
In an optional implementation manner in this embodiment of the present application, when the target algorithm in this embodiment of the present application may further include an irreversible algorithm, based on this, the manner in which the first device related in step 102 in this embodiment of the present application encrypts the first data to be sent by using the first target algorithm to obtain the second data may further include:
step 11, encrypting first data to be sent by the first equipment through a reversible algorithm to obtain third data;
and step 12, the first device encrypts the third data through an irreversible algorithm to obtain second data.
Therefore, in the embodiment of the application, the data to be transmitted can be encrypted by the reversible algorithm, and then encrypted by the non-algorithm, so that the security of the data to be transmitted is further improved. In the embodiment of the present application, the reversible algorithm may be Advanced Encryption Standard (AES), Data Encryption Standard (DES), and the like, and in the present application, Encryption using one or more layers of reversible algorithms may also be used, for example, Encryption using reversible algorithms on two sides is performed on Data to be transmitted, the Data to be transmitted is encrypted by AES first, then the Data to be transmitted is encrypted by DES, and then the Data to be transmitted is encrypted by irreversible algorithm. The security of data transmission can be further improved through multi-layer encryption.
In an optional implementation manner in this embodiment of the present application, when the target algorithm in this embodiment of the present application may further include an irreversible algorithm, based on this, the manner in which the first device related in step 102 in this embodiment of the present application encrypts the first data to be sent by using the first target algorithm to obtain the second data may further include:
step 21, encrypting first data to be sent by the first equipment through an irreversible algorithm to obtain fourth data;
and step 22, the first device encrypts the fourth data through a reversible algorithm to obtain second data.
It can be seen that it is also possible in the present application to encrypt the first data by the irreversible algorithm first and then encrypt it by the reversible algorithm, and vice versa. For both the encryption of the reversible algorithm and the encryption of the irreversible algorithm, one or more layers may be used for the encryption.
It should be noted that the reversible algorithm includes two types, asymmetric and symmetric, for symmetric reversible algorithm, the decrypted key may be sent to the second device in advance, and if asymmetric reversible algorithm, the decrypted key and the encrypted data may be transmitted to the second device together. That is to say, in the embodiment of the present application, on the basis of the irreversible algorithm, the data to be transmitted may also be encrypted by the reversible algorithm, so as to further improve the security of the data to be transmitted.
In the embodiment of the present application, based on the encryption method in fig. 1, there is also provided a method for decrypting data, as shown in fig. 2, the method includes the steps of:
and step 206, the second device searches the ciphertext string corresponding to the abstract through a preset rainbow table, and decrypts the decoded second data through the ciphertext string to obtain the first data, wherein the rainbow table is used for representing the corresponding relationship between the abstract and the ciphertext string.
Through the above steps 202 to 206, the received second data may be decoded by the first decryption method, and then the encrypted second data may be decrypted by the rainbow table, so as to obtain the first data, because the first data is decrypted and transmitted by the irreversible algorithm, the security of the data in the transmission process is improved, that is, the data received by the second device is data that has not been illegally tampered with, and then the original first data may be decrypted by the rainbow table, that is, in the embodiment of the present application, the encryption is performed by the irreversible algorithm, and the security that can be ensured by the rainbow table decryption is improved.
In an optional implementation manner of the embodiment of the present application, in the case that the first target algorithm in the embodiment of the present application further includes a reversible algorithm, and the encryption of the reversible algorithm is before the encryption of the irreversible algorithm, based on this, the manner, which is referred to in step 206 of the embodiment of the present application, of decrypting the decoded second data through the ciphertext string to obtain the first data further may include:
step 31, the second device decrypts the decoded second data through the ciphertext string to obtain fifth data;
According to the encryption process of the data, in the embodiment of the application, the data to be transmitted can be encrypted by the reversible algorithm, and then encrypted by the non-algorithm, so that the security of the data to be transmitted is further improved. In the embodiment of the present application, the reversible algorithm may be Advanced Encryption Standard (AES), Data Encryption Standard (DES), and the like, and in the present application, Encryption using one or more layers of reversible algorithms may also be used, for example, Encryption using reversible algorithms on two sides is performed on Data to be transmitted, the Data to be transmitted is encrypted by AES first, then the Data to be transmitted is encrypted by DES, and then the Data to be transmitted is encrypted by irreversible algorithm. The security of data transmission can be further improved through multi-layer encryption.
Based on this, in the embodiment of the present application, the decoded second data is decrypted based on the rainbow table to obtain the fifth data, and then the fifth data is decrypted based on the key. It should be noted that, in the encryption process, reversible algorithm encryption is adopted first, and then irreversible algorithm encryption is adopted, and then the decryption process is to decrypt the irreversible algorithm first and then decrypt the reversible algorithm.
In an optional implementation manner of the embodiment of the present application, in a case that the first target algorithm in the embodiment of the present application further includes a reversible algorithm, and the encryption of the reversible algorithm is after the encryption of the irreversible algorithm, the manner, which is referred to in step 206 of the embodiment of the present application, of decrypting the decoded second data through the ciphertext string to obtain the first data may further include:
step 41, the second device decrypts the second data through the second target key to obtain sixth data; wherein the second target key is a key of a reversible algorithm;
and 42, the second device decrypts the decoded sixth data through the ciphertext string to obtain the first data.
It can be seen that, in the embodiment of the present application, if the data to be transmitted is encrypted by the irreversible algorithm first and then the data to be transmitted is encrypted by the reversible algorithm, in the decryption process, the data encrypted by the reversible algorithm is decrypted by the key first and then the data encrypted by the irreversible algorithm is decrypted by the rainbow table.
Therefore, in the embodiment of the application, data transmitted by a first device (such as a sensor) can be protected by using a plurality of encryption methods, so that the data cannot be interfaced even if stolen or exchanged, and the data is more difficult to forge so as to attack other devices.
With reference to fig. 1, in an embodiment of the present application, there is further provided an apparatus for encrypting data, where the apparatus is applied to a first device, and as shown in fig. 3, the apparatus includes:
the first encryption module 32 is configured to encrypt the first data to be transmitted by using a first target algorithm to obtain second data, where the target algorithm includes an irreversible algorithm; the second data comprises the first data and a summary generated based on an irreversible algorithm; the abstract in the irreversible algorithm is an abstract in a corresponding relation represented by a preset rainbow table, and the corresponding relation is a corresponding relation between the abstract and the ciphertext string.
And the processing module 34 is configured to encode the second data in the first encoding manner, and transmit the encoded second data to the second device.
Through the device of this application embodiment, can wait to transmit first data to first equipment and encrypt through irreversible algorithm, and encode and transmit second data through first coding mode, and the digest that obtains through irreversible algorithm encryption can be found in predetermined rainbow table, thereby decrypt irreversible algorithm through the rainbow table, carry out encryption protection through irreversible algorithm in the transmission course promptly, under the view that does not have the rainbow table, other equipment can't carry out illegal decryption to the data in the transmission course, thereby make the data of waiting to transmit safer, the lower problem of equipment data security in the transmission data process among the prior art has been solved.
Optionally, in a case that the target algorithm further includes an irreversible algorithm, the processing module 34 of the embodiment of the present application further includes: the second encryption module is used for encrypting the first data to be sent through a reversible algorithm to obtain third data; and the third encryption module is used for encrypting the third data through an irreversible algorithm to obtain second data.
Optionally, in a case that the target algorithm further includes an irreversible algorithm, the processing module 34 in the embodiment of the present application further includes: the fourth encryption module is used for encrypting the first data to be sent through an irreversible algorithm to obtain fourth data; and the fifth encrypting module is used for encrypting the fourth data through a reversible algorithm to obtain the second data.
With reference to fig. 2, an embodiment of the present application further provides an apparatus for decrypting data, where the apparatus is applied to a second device, and as shown in fig. 4, the apparatus may include:
a receiving module 42, configured to receive second data transmitted by the first device; the second data is obtained by encrypting through a first target algorithm and coding through a first coding mode; the first target algorithm comprises an irreversible algorithm; the second data comprises first data to be transmitted by the first equipment and a summary generated based on an irreversible algorithm;
a decoding module 44, configured to decode the second data based on a first decoding manner, where the first decoding manner corresponds to the first encoding manner;
and a decryption module 46, configured to look up a ciphertext string corresponding to the digest through a preset rainbow table, and decrypt the decoded second data through the ciphertext string to obtain first data, where the rainbow table is used to represent a corresponding relationship between the digest and the ciphertext string.
Through the device of this application embodiment, can decode the second data that receives through first decryption mode, and then can decrypt the second data of encryption through the rainbow table, thereby obtain this first data, because first data is that the decryption is carried out through irreversible algorithm and is transmitted, the security of data in the transmission course has been promoted, the data that second equipment received promptly are the data that have not been tampered with illegally, and then can decrypt original first data through the rainbow table, also encrypt through irreversible algorithm in this application embodiment, and the security that can guarantee through the decryption of rainbow table.
Optionally, in a case that the first target algorithm further includes a reversible algorithm, and the encryption of the reversible algorithm is before the encryption of the irreversible algorithm, the decrypting 46 in the embodiment of the present application further may include: the first decryption unit is used for decrypting the decoded second data through the ciphertext string to obtain fifth data; the second decryption unit is used for decrypting the fifth data through the first target key to obtain first data; wherein the first target key is a key of a reversible algorithm.
Optionally, in a case that the first target algorithm further includes a reversible algorithm, and the encryption of the reversible algorithm is after the encryption of the irreversible algorithm, the decryption module 46 in the embodiment of the present application further includes: the third decryption unit is used for decrypting the second data through the second target key to obtain sixth data; wherein the second target key is a key of a reversible algorithm; and the fourth decryption unit is used for decrypting the decoded sixth data through the ciphertext string to obtain the first data.
The embodiment of the present application further provides an apparatus, as shown in fig. 5, including a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502, and the memory 503 complete mutual communication through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501, when executing the program stored in the memory 503, implements the method steps of fig. 1 and 2, and functions in the same way as the method steps of fig. 1 and 2.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment provided by the present application, a computer-readable storage medium is further provided, which stores instructions that, when executed on a computer, cause the computer to perform the encryption method of data and the decryption method of data in the above-described embodiments.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method for encrypting data and the method for decrypting data in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims (10)
1. A method for encrypting data, comprising:
the method comprises the steps that first equipment encrypts first data to be transmitted through a first target algorithm to obtain second data, wherein the target algorithm comprises an irreversible algorithm; the second data comprises the first data and a summary generated based on the irreversible algorithm; the abstract in the irreversible algorithm is an abstract in a corresponding relation represented by a preset rainbow table, and the corresponding relation is a corresponding relation between the abstract and a ciphertext string;
and the first equipment encodes the second data in a first encoding mode and transmits the encoded second data to the second equipment.
2. The method of claim 1, wherein in a case that the target algorithm further includes an irreversible algorithm, the encrypting, by the first device, the first data to be transmitted through the first target algorithm to obtain the second data comprises:
the first equipment encrypts first data to be sent through the reversible algorithm to obtain third data;
and the first equipment encrypts the third data through the irreversible algorithm to obtain the second data.
3. The method of claim 1, wherein in a case that the target algorithm further includes an irreversible algorithm, the encrypting, by the first device, the first data to be transmitted through the first target algorithm to obtain the second data comprises:
the first equipment encrypts first data to be sent through the irreversible algorithm to obtain fourth data;
and the first equipment encrypts the fourth data through the reversible algorithm to obtain the second data.
4. A method for decrypting data, comprising:
the second device receives second data transmitted by the first device; the second data is obtained by encrypting through a first target algorithm and coding through a first coding mode; the first target algorithm comprises an irreversible algorithm; the second data comprises first data to be transmitted by the first equipment and a summary generated based on the irreversible algorithm;
the second device decodes the second data based on a first decoding mode, wherein the first decoding mode corresponds to the first coding mode;
and the second equipment searches a cipher text string corresponding to the abstract through a preset rainbow table, and decrypts the decoded second data through the cipher text string to obtain the first data, wherein the rainbow table is used for representing the corresponding relation between the abstract and the cipher text string.
5. The method of claim 4, wherein, in the case that the first target algorithm further comprises a reversible algorithm and the encryption of the reversible algorithm precedes the encryption of the irreversible algorithm, decrypting the decoded second data with the ciphertext string to obtain the first data comprises:
the second device decrypts the decoded second data through the ciphertext string to obtain fifth data;
the second device decrypts the fifth data through a first target key to obtain the first data; wherein the first target key is a key of the reversible algorithm.
6. The method of claim 4, wherein in the case that the first target algorithm further comprises a reversible algorithm and the encryption of the reversible algorithm is after the encryption of the irreversible algorithm, decrypting the decoded second data with the ciphertext string to obtain the first data comprises:
the second device decrypts the second data through a second target key to obtain sixth data; wherein the second target key is a key of the reversible algorithm;
and the second equipment decrypts the decoded sixth data through the ciphertext string to obtain the first data.
7. An apparatus for encrypting data, applied to a first device, comprising:
the device comprises a first encryption module, a second encryption module and a third encryption module, wherein the first encryption module is used for encrypting first data to be transmitted through a first target algorithm to obtain second data, and the target algorithm comprises an irreversible algorithm; the second data comprises the first data and a summary generated based on the irreversible algorithm; the abstract in the irreversible algorithm is an abstract in a corresponding relation represented by a preset rainbow table, and the corresponding relation is a corresponding relation between the abstract and a ciphertext string;
and the processing module is used for coding the second data in the first coding mode and transmitting the coded second data to the second equipment.
8. An apparatus for decrypting data, applied to a second device, comprising:
the receiving module is used for receiving second data transmitted by the first equipment; the second data is obtained by encrypting through a first target algorithm and coding through a first coding mode; the first target algorithm comprises an irreversible algorithm; the second data comprises first data to be transmitted by the first equipment and a summary generated based on the irreversible algorithm;
a decoding module, configured to decode the second data based on a first decoding manner, where the first decoding manner corresponds to the first encoding manner;
and the decryption module is used for searching a ciphertext string corresponding to the abstract through a preset rainbow table and decrypting the decoded second data through the ciphertext string to obtain the first data, wherein the rainbow table is used for representing the corresponding relation between the abstract and the ciphertext string.
9. The device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1 to 3 or the method steps of any one of claims 4 to 6 when executing a program stored in a memory.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method steps of any one of claims 1 to 3, or carries out the method steps of any one of claims 4 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110845601.2A CN113630237A (en) | 2021-07-26 | 2021-07-26 | Data encryption method and device and data decryption method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110845601.2A CN113630237A (en) | 2021-07-26 | 2021-07-26 | Data encryption method and device and data decryption method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113630237A true CN113630237A (en) | 2021-11-09 |
Family
ID=78380910
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110845601.2A Pending CN113630237A (en) | 2021-07-26 | 2021-07-26 | Data encryption method and device and data decryption method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113630237A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102739397A (en) * | 2011-03-31 | 2012-10-17 | 汉王科技股份有限公司 | Method and device for encrypting and checking electronic worksheet |
CN103714300A (en) * | 2014-01-06 | 2014-04-09 | 武汉虹旭信息技术有限责任公司 | Encryption and analysis system based on distributed GPU and rainbow table and method of encryption and analysis system |
CN109325360A (en) * | 2018-09-06 | 2019-02-12 | 北京三快在线科技有限公司 | Approaches to IM and device |
CN112637836A (en) * | 2020-12-18 | 2021-04-09 | 珠海格力电器股份有限公司 | Data processing method and device, electronic equipment and storage medium |
CN112702318A (en) * | 2020-12-09 | 2021-04-23 | 江苏通付盾信息安全技术有限公司 | Communication encryption method, decryption method, client and server |
-
2021
- 2021-07-26 CN CN202110845601.2A patent/CN113630237A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102739397A (en) * | 2011-03-31 | 2012-10-17 | 汉王科技股份有限公司 | Method and device for encrypting and checking electronic worksheet |
CN103714300A (en) * | 2014-01-06 | 2014-04-09 | 武汉虹旭信息技术有限责任公司 | Encryption and analysis system based on distributed GPU and rainbow table and method of encryption and analysis system |
CN109325360A (en) * | 2018-09-06 | 2019-02-12 | 北京三快在线科技有限公司 | Approaches to IM and device |
CN112702318A (en) * | 2020-12-09 | 2021-04-23 | 江苏通付盾信息安全技术有限公司 | Communication encryption method, decryption method, client and server |
CN112637836A (en) * | 2020-12-18 | 2021-04-09 | 珠海格力电器股份有限公司 | Data processing method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10680804B2 (en) | Distributed key caching for encrypted keys | |
CN101719205B (en) | Digital copyright management method and system | |
CN113364760A (en) | Data encryption processing method and device, computer equipment and storage medium | |
CN104205123A (en) | Systems and methods for secure third-party data storage | |
CN112511514A (en) | HTTP encrypted transmission method and device, computer equipment and storage medium | |
CN107666386B (en) | Data secure transmission method and device | |
CN100426718C (en) | A secure transmission method for media content | |
CN110912877B (en) | Data transmitting and receiving method and device based on IEC61850 model in transformer substation | |
JP2019514314A (en) | Method, system and medium for using dynamic public key infrastructure to send and receive encrypted messages | |
CN103237010B (en) | The server end of digital content is cryptographically provided | |
CN103561091A (en) | Document outgoing control system and method | |
CN115529130B (en) | Data processing method, terminal, server, system, device, medium and product | |
CN104038336A (en) | Data encryption method based on 3DES | |
CN1257629C (en) | Method and appts. for secure transmission of data | |
CN110708291A (en) | Data authorization access method, device, medium and electronic equipment in distributed network | |
KR102028151B1 (en) | Encryption method and system using authorization key of device | |
CN113630412B (en) | Resource downloading method, resource downloading device, electronic equipment and storage medium | |
CN105279447A (en) | Method and device for data encryption, and method and device for data decryption | |
CN106790135B (en) | Data encryption method and system based on cloud and communication equipment | |
CN108337233B (en) | Method for encrypting content information, electronic equipment and storage medium | |
CN113630237A (en) | Data encryption method and device and data decryption method and device | |
CN113746642B (en) | Method and system for communication between computers | |
KR102053993B1 (en) | Method for Authenticating by using Certificate | |
CN112291189B (en) | Method, device, equipment and storage medium for sending and checking ciphertext | |
CN112565156B (en) | Information registration method, device and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |