Encryption method, decryption method, server, and storage medium

By generating a cryptographic fingerprint from the encryption key and obfuscating it, ciphertext data that is difficult to crack is generated, which solves the problem that encryption keys are easily cracked, improves data security, and avoids compatibility issues.

CN113839780BActive Publication Date: 2026-05-29ZTE CORP

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZTE CORP
Filing Date
2020-06-24
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, although sensitive configuration data is encrypted, the data security is low because the encryption key is easily cracked.

Method used

The encryption key is encrypted using an encryption algorithm to generate an encrypted fingerprint. Then, the encrypted fingerprint and plaintext data are processed using an obfuscation algorithm to generate ciphertext data that is difficult to crack.

Benefits of technology

It improves the security of encryption keys, enhances the security of encrypted data, and avoids security and compatibility issues during device replacement and system upgrades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113839780B_ABST
    Figure CN113839780B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of encryption method, decryption method, server and storage medium, belong to communication field.Encryption method includes: using selected encryption algorithm to encrypt encryption key, obtain encryption fingerprint;Using the encryption algorithm and the encryption key, plaintext data is encrypted, and first ciphertext data is obtained;The encryption fingerprint and the first ciphertext data are confused, and second ciphertext data is obtained.By using encryption algorithm to encrypt encryption key, it is difficult to crack encryption key, improve the security of encryption key, so that the first ciphertext data obtained by using encryption algorithm and encryption key to encrypt plaintext data is difficult to crack, improve the security of data, and after obtaining the first ciphertext data, the encryption fingerprint and the first ciphertext data are confused to obtain the second ciphertext data, improve the security of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and in particular to an encryption method, a decryption method, a server, and a storage medium. Background Technology

[0002] Currently, business data with high security requirements is generally referred to as sensitive configuration data, such as data specifically used for passwords or authentication. Because sensitive configuration data requires security, the system first encrypts it using local encryption keys and algorithms to create ciphertext, which is then stored, used for query responses, and transmitted in encrypted form.

[0003] However, even when sensitive configuration data is encrypted using encryption keys and algorithms to form ciphertext, the security of the sensitive configuration data is still relatively low because the encryption keys are relatively easy to crack. Summary of the Invention

[0004] The main objective of this application is to propose an encryption method, a decryption method, a server, and a storage medium, aiming to improve the security of encryption keys, thereby improving data security.

[0005] To achieve the above objectives, embodiments of this application provide an encryption method, comprising: encrypting an encryption key using a selected encryption algorithm to obtain an encryption fingerprint; encrypting plaintext data using the encryption algorithm and the encryption key to obtain first ciphertext data; and obfuscating the encryption fingerprint and the first ciphertext data to obtain second ciphertext data.

[0006] To achieve the above objectives, embodiments of this application also provide an encryption method, comprising: encrypting an encryption key using a selected encryption algorithm to obtain an encryption fingerprint; obfuscating the encryption fingerprint and first plaintext data to obtain second plaintext data; and encrypting the second plaintext data using the encryption algorithm and the encryption key to obtain ciphertext data.

[0007] To achieve the above objectives, embodiments of this application also provide a decryption method, comprising: separating an encrypted fingerprint and first ciphertext data from acquired second ciphertext data; wherein the second ciphertext data is obtained by the encryption method described above; decrypting the first ciphertext data, comprising: selecting a decryption algorithm and a decryption key, and encrypting the decryption key using the selected decryption algorithm to obtain a decryption fingerprint; if the decryption fingerprint matches the encrypted fingerprint separated from the second ciphertext data, decrypting the first ciphertext data using the decryption algorithm and the decryption key to obtain plaintext data; if the decryption fingerprint does not match the encrypted fingerprint, repeating the step of decrypting the first ciphertext data.

[0008] To achieve the above objectives, embodiments of this application also provide a decryption method, comprising: selecting a decryption algorithm and a decryption key, and using the selected decryption algorithm and the decryption key to decrypt the acquired ciphertext data; wherein the ciphertext data is obtained by the encryption method described above; if decryption is successful, second plaintext data is obtained; first plaintext data is separated from the second plaintext data; if decryption fails, the steps of the decryption method are repeated.

[0009] To achieve the above objectives, embodiments of this application also propose a server, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the encryption method and / or decryption method described above.

[0010] This application uses a selected encryption algorithm to encrypt the encryption key to obtain an encryption fingerprint, making the encryption key more difficult to crack, thus improving the security of the encryption key and consequently improving the security of the final ciphertext data.

[0011] This application avoids the security and compatibility issues arising from decryption. Security is ensured because, if the device is replaced, the encrypted data is transmitted through a fingerprint-like key that is difficult to obtain, thus preventing security problems during device replacement. Compatibility is ensured because, if the device system is upgraded, the accurate decryption key and algorithm can be obtained from the encrypted data, enabling decryption without simultaneously using both the old and new keys, avoiding compatibility issues. Therefore, replacing the device improves the security of the encrypted data, and upgrading the device system not only improves security but also avoids compatibility problems. Attached Figure Description

[0012] Figure 1 This is a flowchart of the encryption method in the first embodiment of this application;

[0013] Figure 2 This is a flowchart of the decryption method in the second embodiment of this application;

[0014] Figure 3 This is a flowchart of the encryption method in the third embodiment of this application;

[0015] Figure 4 This is a flowchart of the decryption method in the fourth embodiment of this application;

[0016] Figure 5This is a flowchart of the decryption method in the fifth embodiment of this application;

[0017] Figure 6 This is a schematic diagram of the server structure in the sixth embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details are presented in the various embodiments of the present invention to facilitate a better understanding of this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various variations and modifications based on the following embodiments. The division of the various embodiments below is for ease of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined with and referenced by each other without contradiction.

[0019] The first embodiment of this application relates to an encryption method applied to a terminal, such as a computer. The specific process of the encryption method in this embodiment is as follows: Figure 1 As shown, it includes:

[0020] Step 101: Encrypt the encryption key using the selected encryption algorithm to obtain the encrypted fingerprint.

[0021] Specifically, the terminal stores encryption algorithms and keys pre-input by the user, or encryption algorithms and keys generated by the encryption chip. The user can select an encryption algorithm and key from these stored sources. Alternatively, the user can temporarily input the encryption algorithm and key when encryption is needed, or the encryption algorithm and key can be temporarily generated by the encryption chip; in this case, the temporarily input or generated encryption algorithm and key are selected. The encryption algorithms include hash algorithms, such as MD5 (Message-Digest Algorithm). A root key is preset within the terminal to encrypt the encryption key. This root key is stored in the terminal's TPM (Trusted Platform Module). After selecting the encryption algorithm and key, the terminal uses the selected encryption algorithm and root key to encrypt the encryption key, obtaining an encrypted fingerprint.

[0022] Step 102: Encrypt the plaintext data using an encryption algorithm and an encryption key to obtain the first ciphertext data.

[0023] Step 103: Obfuscate the encrypted fingerprint and the first ciphertext data to obtain the second ciphertext data.

[0024] Specifically, the terminal encrypts plaintext data using an encryption algorithm and encryption key to obtain first ciphertext data. Then, it obfuscates the encrypted fingerprint and the first ciphertext data to obtain second ciphertext data. Both the encrypted fingerprint and the first ciphertext data exist as strings. The obfuscation follows specific rules, which are either the offset of the encrypted fingerprint within the first ciphertext data or the offset of the first ciphertext data within the encrypted fingerprint. For example, if the terminal concatenates the encrypted fingerprint and the first ciphertext data, the obfuscation rule is that the offset of the encrypted fingerprint within the first ciphertext data is 0, resulting in the second ciphertext data. Another example: if the terminal obfuscates the encrypted fingerprint and the first ciphertext data by inserting the first ciphertext data into the indicator encrypted fingerprint, and the obfuscation rule is that the offset of the first ciphertext data within the encrypted fingerprint is 10 characters, then the first ciphertext data is inserted between the 10th and 11th characters of the indicator encrypted fingerprint, resulting in the second ciphertext data.

[0025] In one example, the terminal obfuscates the encrypted fingerprint and the first ciphertext data based on an obfuscation algorithm. The obfuscation algorithm has corresponding obfuscation rules, and the encrypted fingerprint and the first ciphertext data are obfuscated according to the obfuscation rules in the obfuscation algorithm.

[0026] In one example, the second ciphertext data contains information indicating the obfuscation rules. Specifically, the second ciphertext data exists as a string, and the information indicating the obfuscation rules is located in the first few characters of the second ciphertext data. The obfuscation rules are either the offset of the cryptographic fingerprint within the first ciphertext data, or the offset of the first ciphertext data within the cryptographic fingerprint. By including the information indicating the obfuscation rules in the second ciphertext data, the obfuscation rules can be determined more quickly during decryption, allowing for faster decryption of the first ciphertext data and the cryptographic fingerprint, thus improving decryption speed.

[0027] In this embodiment, by using an encryption algorithm to encrypt the encryption key, the encryption key becomes more difficult to crack, thus improving the security of the encryption key. Consequently, the first ciphertext data obtained by encrypting plaintext data using the encryption algorithm and encryption key becomes more difficult to crack, improving data security. Furthermore, after obtaining the first ciphertext data, the encryption fingerprint and the first ciphertext data are obfuscated to obtain the second ciphertext data, further enhancing data security.

[0028] The second embodiment of this application relates to a decryption method corresponding to the encryption method of the first embodiment, applied to a terminal. The terminal of the second embodiment can be the same as the terminal of the first embodiment, but the system within the terminal may have changed. In this case, the terminal stores second ciphertext data. Alternatively, the terminal of the second embodiment can be a different terminal from the terminal of the first embodiment. In this case, the terminal of the second embodiment needs to receive the second ciphertext data sent by the terminal of the first embodiment. The second ciphertext data is obtained by the encryption method of the first embodiment.

[0029] The detailed flowchart of the decryption method in this embodiment is as follows: Figure 2 As shown, it includes:

[0030] Step 201: Separate the encrypted fingerprint and the first encrypted data from the acquired second ciphertext data.

[0031] In one example, separating the encrypted fingerprint and the first ciphertext data from the acquired second ciphertext includes: identifying information about obfuscation rules from the acquired second ciphertext data, and using the information about obfuscation rules to separate the encrypted fingerprint and the first ciphertext data from the second ciphertext.

[0032] Specifically, the obfuscation rule information in the second ciphertext data is located in the first few characters of the second ciphertext data, and the obfuscation rule is the offset of the encrypted fingerprint in the first ciphertext data, or the offset of the first ciphertext data in the encrypted fingerprint. Therefore, based on the obfuscation rule information, the terminal can determine how the encrypted fingerprint and the first ciphertext data are obfuscated in the second ciphertext data, thus enabling faster separation of the encrypted fingerprint and the first ciphertext data from the second ciphertext data, improving decryption speed. After obtaining the first ciphertext data, it is still necessary to decrypt it.

[0033] In one example, the second ciphertext data is obtained by obfuscating the encryption fingerprint and the first ciphertext data using an obfuscation algorithm. If the terminal remains unchanged, it still stores the obfuscation algorithm used during encryption. If the terminal changes, the user can pre-store the obfuscation algorithm used during encryption into the terminal receiving the second ciphertext data. When it is necessary to separate the second ciphertext data, the terminal can query the locally stored obfuscation algorithm and use it to perform reverse operations to separate the encryption fingerprint and the first ciphertext data from the second ciphertext data. After obtaining the first ciphertext data, it is also necessary to decrypt it.

[0034] Step 202: Select a decryption algorithm and a decryption key, and encrypt the decryption key using the selected decryption algorithm to obtain the decryption fingerprint.

[0035] Step 203: Determine whether the decrypted fingerprint matches the encrypted fingerprint separated from the second ciphertext data. If they match, proceed to step 204. If they do not match, re-enter step 202.

[0036] Step 204: Decrypt the first ciphertext data using the decryption algorithm and decryption key to obtain the plaintext data.

[0037] Specifically, the terminal pre-stores one or more decryption algorithms and one or more decryption keys, or it may contain one or more decryption algorithms and one or more decryption keys temporarily input by the user. These decryption algorithms and decryption keys include decryption algorithms corresponding to the encryption algorithms in the encryption method of the first embodiment, and decryption keys corresponding to the encryption keys. Therefore, the terminal needs to first randomly select or select decryption algorithms and decryption keys according to certain priority rules, and then use the selected decryption algorithms and root keys to encrypt the decryption keys to obtain the decryption fingerprint. The root key used to encrypt the decryption key is the same as the root key used to encrypt the encryption key in the encryption method.

[0038] If the decryption fingerprint matches the encryption fingerprint, it means the correct decryption algorithm and decryption key have been obtained. The first ciphertext data is then decrypted using the correct decryption algorithm and decryption key to obtain the plaintext data. If the decryption fingerprint and encryption fingerprint do not match, it means the correct decryption algorithm or decryption key has not been obtained, and the process returns to step 202. When selecting a decryption algorithm and decryption key again, duplicate selections must be avoided. That is, the combination of decryption algorithm and decryption key can only be selected once and will not be repeated. For example, if decryption algorithm 1 and decryption key 1 have already been selected once, they will not be selected simultaneously again. However, decryption algorithm 1 and decryption key 2, or decryption algorithm 2 and decryption key 1, or decryption algorithm 2 and decryption key 3, etc., can be selected.

[0039] In this embodiment, this method avoids security and compatibility issues arising from decryption. Security is ensured because if the device is replaced, the encrypted data is transmitted via a fingerprint-like key, making it difficult to obtain and preventing security problems during device switching. Compatibility is ensured because if the device system is upgraded, the accurate decryption key and algorithm can be obtained based on the encrypted data, enabling decryption without simultaneously using both the old and new keys, thus avoiding compatibility issues. Therefore, replacing the device improves the security of the encrypted data, and upgrading the device system not only improves security but also avoids compatibility problems.

[0040] The third embodiment of this application relates to an encryption method applied to a terminal, such as a computer. The specific process of the encryption method in this embodiment is as follows: Figure 3 As shown, it includes:

[0041] Step 301: Encrypt the encryption key using the selected encryption algorithm to obtain the encrypted fingerprint.

[0042] Step 301 is similar to step 101 in the first embodiment, and will not be described again here.

[0043] Step 302: Obfuscate the encrypted fingerprint and the first plaintext data to obtain the second plaintext data.

[0044] Step 303: Encrypt the second plaintext data using an encryption algorithm and an encryption key to obtain ciphertext data.

[0045] Specifically, the terminal obfuscates the encrypted fingerprint and the first plaintext data to obtain the second plaintext data; then, it encrypts the second plaintext data using an encryption algorithm and an encryption key to obtain the ciphertext data. Both the encrypted fingerprint and the first plaintext data exist as strings. The obfuscation follows certain rules, which are either the offset of the encrypted fingerprint within the first plaintext data or the offset of the first plaintext data within the encrypted fingerprint. For example, if the terminal concatenates the encrypted fingerprint and the first plaintext data, it concatenates the preceding encrypted fingerprint with the following first plaintext data; in this case, the obfuscation rule is that the offset of the encrypted fingerprint within the first plaintext data is 0, resulting in the second plaintext data. Another example: if the terminal obfuscates the encrypted fingerprint and the first plaintext data by inserting the first plaintext data into the encrypted fingerprint, and the obfuscation rule is that the offset of the first plaintext data within the encrypted fingerprint is 10 characters, then the first plaintext data is inserted between the 10th and 11th characters of the encrypted fingerprint, resulting in the second plaintext data.

[0046] In one example, the terminal obfuscates the encrypted fingerprint and the first plaintext data using an obfuscation algorithm to obtain the second plaintext data. The obfuscation algorithm has corresponding obfuscation rules, and the encrypted fingerprint and the first ciphertext data are obfuscated according to the obfuscation rules in the obfuscation algorithm to obtain the second plaintext data.

[0047] In one example, the second plaintext data contains information indicating the obfuscation rules. Specifically, the second plaintext data exists as a string, and the information indicating the obfuscation rules is located in the first few characters of the second plaintext data. The obfuscation rules are either the offset of the cryptographic fingerprint within the first plaintext data, or the offset of the first plaintext data within the cryptographic fingerprint. By including the information indicating the obfuscation rules in the second plaintext data, the obfuscation rules can be determined more quickly during decryption, allowing for faster decryption of the first plaintext data and the cryptographic fingerprint, thus improving decryption speed.

[0048] In this embodiment, by using an encryption algorithm to encrypt the encryption key, the encryption key becomes more difficult to crack, thus improving the security of the encryption key. This makes the ciphertext data more difficult to crack, thus improving the security of the data. Furthermore, by first obtaining the second plaintext data through obfuscation, and then encrypting the second plaintext data using an encryption algorithm and an encryption key, the security of the data is further improved.

[0049] The fourth embodiment of this application relates to a decryption method corresponding to the encryption method of the third embodiment, applied to a terminal. The terminal of the fourth embodiment can be the same as the terminal of the third embodiment, but the system within the terminal may have changed, and the terminal stores ciphertext data. Alternatively, the terminal of the fourth embodiment can be a different terminal from the terminal of the third embodiment, in which case the terminal of the fourth embodiment needs to receive ciphertext data sent by the terminal of the third embodiment. Wherein, the ciphertext data is obtained by the encryption method of the third embodiment, and this embodiment needs to decrypt the ciphertext data.

[0050] The detailed flowchart of the decryption method in this embodiment is as follows: Figure 4 As shown, it includes:

[0051] Step 401: Select a decryption algorithm and a decryption key, and use the selected decryption algorithm and decryption key to decrypt the acquired ciphertext data.

[0052] Step 402: Determine if decryption was successful. If decryption was successful, proceed to step 403 first, then to step 404; if decryption failed, proceed to step 401.

[0053] Step 403, obtain the second plaintext data.

[0054] Specifically, the terminal pre-stores one or more decryption algorithms and one or more decryption keys, or it may temporarily input one or more decryption algorithms and one or more decryption keys by the user. Therefore, the terminal first randomly selects or selects a decryption algorithm and decryption key according to a certain priority rule, and attempts to decrypt the acquired ciphertext data using the selected decryption algorithm and decryption key. If decryption is successful, the second plaintext data is obtained; if decryption fails, the second plaintext data cannot be obtained, and the process returns to step 401. When selecting a decryption algorithm and decryption key again, duplicate selections must be avoided. That is, the combination of decryption algorithm and decryption key can only be selected once and will not be selected repeatedly. For example, if decryption algorithm 1 and decryption key 1 have already been selected once, then decryption algorithm 1 and decryption key 1 will not be selected simultaneously again; however, decryption algorithm 1 and decryption key 2, or decryption algorithm 2 and decryption key 1, or decryption algorithm 2 and decryption key 3, etc., can be selected.

[0055] Step 404: Separate the first plaintext data from the second plaintext data.

[0056] In one example, separating first plaintext data from second plaintext data includes: identifying information about obfuscation rules from the second plaintext data, and using the information about obfuscation rules to separate the first plaintext data from the second plaintext data.

[0057] Specifically, the obfuscation rule information in the second plaintext data is located in the first few characters of the second plaintext data, and the obfuscation rule is the offset of the encrypted fingerprint in the first plaintext data, or the offset of the first plaintext data in the encrypted fingerprint. Therefore, based on this information, the terminal can determine how the encrypted fingerprint and the first plaintext data are obfuscated in the second plaintext data, thus enabling it to quickly separate the first plaintext data from the second plaintext data and improving the decryption speed.

[0058] In one example, the second plaintext data is obtained by obfuscating the encrypted fingerprint and the first plaintext data using an obfuscation algorithm. If the terminal remains unchanged, it still stores the obfuscation algorithm used during encryption. If the terminal changes, the user can pre-store the obfuscation algorithm used during encryption into the terminal receiving the ciphertext data. When it is necessary to separate the second plaintext data, the terminal queries the locally stored obfuscation algorithm and uses the obfuscation algorithm to perform reverse operations to separate the first plaintext data from the second plaintext data.

[0059] In this embodiment, this method avoids security and compatibility issues arising from decryption. Security is ensured because if the device is replaced, the encrypted data is transmitted via a fingerprint-like key, making it difficult to obtain and preventing security problems during device switching. Compatibility is ensured because if the device system is upgraded, the accurate decryption key and algorithm can be obtained based on the encrypted data, enabling decryption without simultaneously using both the old and new keys, thus avoiding compatibility issues. Therefore, replacing the device improves the security of the encrypted data, and upgrading the device system not only improves security but also avoids compatibility problems.

[0060] The fifth embodiment of this application relates to a decryption method corresponding to the encryption method of the third embodiment, and is applied to a terminal. The fifth embodiment is largely the same as the fourth embodiment, with the main difference being that the first plaintext data is further determined to be correct.

[0061] The detailed flowchart of the decryption method in this embodiment is as follows: Figure 5 As shown, it includes:

[0062] Step 501: Select a decryption algorithm and a decryption key, and use the selected decryption algorithm and decryption key to decrypt the acquired ciphertext data.

[0063] Step 502: Determine if decryption was successful. If decryption was successful, proceed to step 503 first, then to step 504; if decryption failed, proceed to step 501.

[0064] Step 503, obtain the second plaintext data.

[0065] Steps 501-503 are similar to steps 401-403 in the fourth embodiment, and will not be described again here.

[0066] Step 504: Separate the encrypted fingerprint and the first plaintext data from the second plaintext data.

[0067] In one example, separating the encrypted fingerprint and the first plaintext data from the second plaintext data includes: identifying information about obfuscation rules from the second plaintext data, and using the information about obfuscation rules to separate the encrypted fingerprint and the first plaintext data from the second plaintext data.

[0068] Specifically, the obfuscation rule information in the second plaintext data is located in the first few characters of the second plaintext data, and the obfuscation rule is the offset of the encrypted fingerprint in the first plaintext data, or the offset of the first plaintext data in the encrypted fingerprint. Therefore, based on this information, the terminal can determine how the encrypted fingerprint and the first plaintext data are obfuscated in the second plaintext data, thus enabling it to quickly separate the encrypted fingerprint and the first plaintext data from the second plaintext data, improving the decryption speed.

[0069] In one example, the second plaintext data is obtained by obfuscating the encrypted fingerprint and the first plaintext data using an obfuscation algorithm. If the terminal remains unchanged, it still stores the obfuscation algorithm used during encryption. If the terminal changes, the user can pre-store the obfuscation algorithm used during encryption into the terminal receiving the ciphertext data. When it is necessary to separate the second plaintext data, the terminal queries the locally stored obfuscation algorithm and uses the obfuscation algorithm to perform reverse operations to separate the encrypted fingerprint and the first plaintext data from the second plaintext data.

[0070] Step 505: Encrypt the decryption key using a decryption algorithm to obtain the decryption fingerprint.

[0071] Step 506: Determine whether the decrypted fingerprint matches the encrypted fingerprint separated from the second plaintext data. If they match, proceed to step 507. If they do not match, re-enter step 501.

[0072] Step 507: The first plaintext data is confirmed to be correct.

[0073] Specifically, in some cases, even if the encrypted data is successfully decrypted using the selected decryption algorithm and decryption key, the decryption algorithm may not be the same as the encryption algorithm in the encryption method of the third embodiment, and / or the decryption key may not be the same as the encryption key in the encryption method of the third embodiment. This results in the obtained second plaintext data not being what the terminal needs, that is, the obtained second plaintext data is deemed incorrect, and thus the obtained first plaintext data is deemed incorrect.

[0074] Since the terminal pre-stores the root key used to encrypt the encryption key in the encryption method, it can use the decryption algorithm and the root key to encrypt the decryption key, obtaining a decryption fingerprint. If the decryption fingerprint matches the encryption fingerprint, it indicates that the obtained decryption algorithm and decryption key are correct. Therefore, the second plaintext data obtained by decrypting the ciphertext data using the decryption algorithm and decryption key is considered correct, and the first plaintext data separated from the second plaintext data is also considered correct. If the decryption fingerprint and encryption fingerprint do not match, it indicates that the obtained decryption algorithm and decryption key are not correct. Therefore, the second plaintext data obtained by decrypting the ciphertext data using the decryption algorithm and decryption key is incorrect, and the first plaintext data separated from the second plaintext data is also incorrect. The process then re-enters step 501. When selecting the decryption algorithm and decryption key again, duplicate selection must be avoided; that is, the combination of the decryption algorithm and decryption key can only be selected once and will not be repeated.

[0075] In this embodiment, by verifying whether the decrypted fingerprint and the encrypted fingerprint match, it can be determined whether the obtained first plaintext data is correct.

[0076] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this patent.

[0077] The sixth embodiment of this application relates to a server, such as Figure 6 As shown, it includes: at least one processor 602; and a memory 601 communicatively connected to the at least one processor; wherein the memory 601 stores instructions executable by the at least one processor 602, the instructions being executed by the at least one processor 602 to enable the at least one processor 602 to execute the encryption method of Embodiment 1, and / or the decryption method of Embodiment 2, and / or the encryption method of Embodiment 3, and / or the decryption method of Embodiment 4, and / or the decryption method of Embodiment 5.

[0078] The memory 601 and processor 602 are connected via a bus, which may include any number of interconnecting buses and bridges. The bus connects various circuits of one or more processors 602 and memory 601 together. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by processor 602 is transmitted over a wireless medium via an antenna, which further receives data and transmits it to processor 602.

[0079] Processor 602 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory 601 can be used to store data used by processor 602 during operation.

[0080] The seventh embodiment of this application relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the encryption method of Embodiment 1, and / or the decryption method of Embodiment 2, and / or the encryption method of Embodiment 3, and / or the decryption method of Embodiment 4, and / or the decryption method of Embodiment 5.

[0081] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0082] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing this application, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of this application.

Claims

1. An encryption / decryption method, characterized in that, include: The encryption key is encrypted using the selected encryption algorithm to obtain the encrypted fingerprint; The plaintext data is encrypted using the encryption algorithm and the encryption key to obtain the first ciphertext data; The encrypted fingerprint and the first ciphertext data are obfuscated to obtain the second ciphertext data; After separating the encrypted fingerprint and the first ciphertext data from the second ciphertext data, the first ciphertext data is decrypted, including: Select a decryption algorithm and a decryption key, and encrypt the decryption key using the selected decryption algorithm to obtain the decryption fingerprint; If the decryption fingerprint matches the encryption fingerprint extracted from the second ciphertext data, the first ciphertext data is decrypted using the decryption algorithm and the decryption key to obtain plaintext data. If the decryption fingerprint and the encryption fingerprint do not match, repeat the step of decrypting the first ciphertext data.

2. The encryption / decryption method according to claim 1, characterized in that, The second ciphertext data contains information used to indicate obfuscation rules.

3. An encryption / decryption method, characterized in that, include: The encryption key is encrypted using the selected encryption algorithm to obtain the encrypted fingerprint; The encrypted fingerprint and the first plaintext data are obfuscated to obtain the second plaintext data; The second plaintext data is encrypted using the encryption algorithm and the encryption key to obtain ciphertext data; After selecting a decryption algorithm and a decryption key, and using the selected decryption algorithm and the decryption key to decrypt the acquired ciphertext data, if the decryption is successful, the second plaintext data is obtained. Separate the encrypted fingerprint and the first plaintext data from the second plaintext data; After separating the encrypted fingerprint and the first plaintext data from the second plaintext, the method further includes: The decryption key is encrypted using the decryption algorithm to obtain the decryption fingerprint; If the decrypted fingerprint matches the encrypted fingerprint extracted from the second plaintext data, the first plaintext data is considered correct. If the decrypted fingerprint and the encrypted fingerprint do not match, repeat the decryption step; If decryption fails, repeat the decryption steps.

4. The encryption / decryption method according to claim 3, characterized in that, The second plaintext data contains information used to indicate obfuscation rules.

5. A decryption method, characterized in that, include: The encrypted fingerprint and the first ciphertext data are separated from the acquired second ciphertext data; wherein the second ciphertext data is obtained by the encryption / decryption method described in claim 1; Decrypting the first ciphertext data includes: Select a decryption algorithm and a decryption key, and encrypt the decryption key using the selected decryption algorithm to obtain the decryption fingerprint; If the decryption fingerprint matches the encryption fingerprint extracted from the second ciphertext data, the first ciphertext data is decrypted using the decryption algorithm and the decryption key to obtain plaintext data. If the decryption fingerprint and the encryption fingerprint do not match, repeat the step of decrypting the first ciphertext data.

6. The decryption method according to claim 5, characterized in that, The step of separating the encrypted fingerprint and the first ciphertext data from the acquired second ciphertext includes: Information about obfuscation rules is identified from the acquired second ciphertext data, and the information about obfuscation rules is used to separate the cryptographic fingerprint and the first ciphertext data from the second ciphertext.

7. A decryption method, characterized in that, A decryption algorithm and a decryption key are selected, and the acquired ciphertext data is decrypted using the selected decryption algorithm and the decryption key; wherein the ciphertext data is obtained by the encryption and decryption method described in claim 4; If decryption is successful, the second plaintext data is obtained; Separate the encrypted fingerprint and the first plaintext data from the second plaintext data; After separating the encrypted fingerprint and the first plaintext data from the second plaintext, the method further includes: The decryption key is encrypted using the decryption algorithm to obtain the decryption fingerprint; If the decrypted fingerprint matches the encrypted fingerprint extracted from the second plaintext data, the first plaintext data is considered correct. If the decrypted fingerprint and the encrypted fingerprint do not match, repeat the decryption step; If decryption fails, repeat the decryption steps.

8. The decryption method according to claim 7, characterized in that, The step of separating the first plaintext data from the second plaintext data includes: Information about obfuscation rules is identified from the second plaintext data, and the first plaintext data is separated from the second plaintext data using the information about obfuscation rules.

9. A server, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the encryption / decryption method as described in any one of claims 1 to 2, and / or the encryption / decryption method as described in any one of claims 3 to 4, and / or the decryption method as described in any one of claims 5 to 6, and / or the decryption method as described in any one of claims 7 to 8.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the encryption / decryption method as described in any one of claims 1 to 2, and / or the encryption / decryption method as described in any one of claims 3 to 4, and / or the decryption method as described in any one of claims 5 to 6, and / or the decryption method as described in any one of claims 7 to 8.