Data protection method based on hardware

Through hardware -based data protection methods, the hardware module generation and management encryption key are used to solve the lack of security and performance of the existing software encryption methods, and the efficient and secure data encryption and decryption process is achieved.

CN119358047AActive Publication Date: 2025-01-24NIO TECH ANHUI CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411380006.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-24
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

In the prior art, software encryption methods have problems such as poor security, performance bottlenecks, dependencies and complexity, and are difficult to effectively use in high throughput and low latency application scenarios.

Method used

Adopting a hardware-based data protection method, the public key, private key, key plaintext and initialization vector are generated through the hardware module, and the preset public key, cipher suite and private key are used for key negotiation and encryption to ensure the security of the encryption and decryption process. Safety and efficiency.

Benefits of technology

It improves the security and computing efficiency of data encryption, enhances the security of the front direction, and simplifies the deployment and maintenance of the system, which is suitable for the environment with limited resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119358047A_ABST
    Figure CN119358047A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, particularly provides a data protection method based on hardware, and aims to solve the technical problem of poor software encryption effect in the prior art. The method comprises the steps of generating a first public key, a first private key, a key plaintext and an initialization vector based on a first module; obtaining additional verification data based on a preset second public key, a preset password suite and the first public key; obtaining a first symmetric key based on the second public key and the first private key; encrypting the key plaintext based on the first symmetric key, the additional verification data and the initialization vector to obtain a negotiation result; and encrypting the to-be-protected data plaintext based on the key plaintext to obtain a data ciphertext. Encryption is carried out based on hardware, so that the safety and the operation efficiency are improved; in each encryption process, the first public key, the first private key, the first secret key plaintext and the initialization vector are randomly generated by hardware, so that the forward security of the encryption process is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and specifically provides a hardware-based data protection method. Background Art

[0002] The current mainstream approach to implementing data encryption solutions is software methods based on open source cryptography libraries such as OpenSSL and Crypto++.

[0003] The above mainstream methods have problems such as poor security, low performance bottlenecks, certain dependencies and complexity, security vulnerabilities, limited customization, and poor ability to resist side-channel attacks. For example: software methods using open source cryptographic libraries are prone to exposing keys to unprotected memory during encryption and decryption, which can lead to the failure of security systems; the versatility of open source cryptographic libraries can lead to low performance, especially in application scenarios that require high throughput and low latency, where the performance of software methods is relatively limited; the use of open source cryptographic libraries introduces additional dependencies and complexity, which poses challenges to the deployment, maintenance, and configuration of the system, especially in embedded or resource-constrained environments; although open source libraries have been extensively reviewed, they still have potential vulnerabilities, and the use of outdated or unupdated library versions is prone to security issues, and the configuration and use of the library need to follow best practices, otherwise it is also easy to introduce vulnerabilities.

[0004] Accordingly, the art needs a new technical solution of a hardware-based data protection method to solve the above problems. Summary of the invention

[0005] In order to overcome at least one of the above-mentioned defects, the present application is proposed to provide a hardware-based data protection method that solves or at least partially solves the technical problem of poor software encryption effect in the prior art.

[0006] In a first aspect, the present application provides a hardware-based data protection method, the method includes at least an encryption stage, the hardware on which the method is based includes at least a first module, and the method includes: based on the first module, generating a first public key, a first private key, a key plaintext and an initialization vector; based on a preset second public key, a preset cryptographic suite and the first public key, obtaining additional verification data; based on the second public key and the first private key, obtaining a first symmetric key; based on the first symmetric key, the additional verification data and the initialization vector, encrypting the key plaintext to obtain a negotiation result; based on the key plaintext, encrypting the data plaintext to be protected to obtain a data ciphertext, wherein the negotiation result is used to decrypt the data ciphertext.

[0007] Through the above technical solution, encryption is performed based on hardware, which improves security and computing efficiency; in each encryption process, the first public key, the first private key, the first key plaintext and the initialization vector are all randomly generated by hardware, which enhances the forward security of the encryption process.

[0008] In a technical solution of the above-mentioned hardware-based data protection method, the additional verification data obtained based on a preset second public key, a preset cryptographic suite and the first public key includes: performing a hash calculation on the second public key to obtain a first hash value; and concatenating the first hash value, the cryptographic suite and the first public key to obtain the additional verification data.

[0009] Through the above technical solution, all additional information is protected, including the cipher suite, the first public key, and the first hash value of the first public key, thereby ensuring the integrity of the information.

[0010] In a technical solution of the above-mentioned hardware-based data protection method, obtaining the first symmetric key based on the second public key and the first private key includes: performing key negotiation on the second public key and the first private key to obtain a first shared key; performing key derivation on the first shared key to obtain a key of length K and record it as the first symmetric key.

[0011] Through the above technical solution, one section of the negotiated shared key is intercepted, which ensures that the security strength remains unchanged while improving the efficiency of the encryption process.

[0012] In a technical solution of the above-mentioned hardware-based data protection method, the key plaintext is encrypted based on the first symmetric key, the additional verification data and the initialization vector to obtain a negotiation result, including: encrypting the key plaintext based on the first symmetric key, the additional verification data and the initialization vector to obtain a key ciphertext and an authentication tag; and concatenating the additional verification data, the initialization vector, the key ciphertext and the authentication tag to obtain the negotiation result.

[0013] Through the above technical solution, a high-strength symmetric key is used to encrypt and protect the key used to encrypt and protect data, rather than directly using the symmetric key to encrypt and protect data. On the one hand, the security of the key is enhanced, and on the other hand, the technicians can flexibly define the appropriate encryption scheme according to the actual situation, such as selecting the appropriate encryption algorithm type.

[0014] In a technical solution of the above-mentioned hardware-based data protection method, the cryptographic suite includes at least encryption algorithm information, and the method further includes: based on the encryption algorithm information, determining whether the process of encrypting the data plaintext to be protected requires the initialization vector; if so, encrypting the data plaintext based on the key plaintext and the initialization vector to obtain the data ciphertext.

[0015] Through the above technical solution, the initialization vector is selectively used to perform encryption steps according to the encryption algorithm information in the cryptographic suite, such as the type of encryption algorithm, so that technicians can indirectly define specific encryption steps according to actual conditions such as device performance or security requirements, thereby improving the flexibility and compatibility of the technical solution.

[0016] In a technical solution of the above-mentioned hardware-based data protection method, the method also includes at least a decryption stage, and the hardware on which the method is based also includes at least a second module. The method also includes: generating a second private key based on the second module; decrypting the data ciphertext based on the negotiation result and the second private key to obtain the data plaintext.

[0017] Through the above technical solution, technical means for the data decryption stage are also provided, which, combined with the technical means for the data encryption stage provided by the above technical solution, can protect the data more comprehensively.

[0018] In a technical solution of the above-mentioned hardware-based data protection method, the data ciphertext is decrypted based on the negotiation result and the second private key to obtain the data plaintext, which includes: splitting the negotiation result to obtain the additional verification data, the initialization vector, the key ciphertext and the authentication tag; splitting the additional verification data to obtain the first public key; obtaining a second symmetric key based on the first public key and the second private key; decrypting the key ciphertext based on the second symmetric key, the additional verification data and the initialization vector to obtain the key plaintext; decrypting the data ciphertext based on the key plaintext to obtain the data plaintext.

[0019] In a technical solution of the above-mentioned hardware-based data protection method, obtaining the second symmetric key based on the first public key and the second private key includes: performing key negotiation on the first public key and the second private key to obtain a second shared key; performing key derivation on the second shared key to obtain a key of length K and record it as the second symmetric key.

[0020] In a technical solution of the above-mentioned hardware-based data protection method, the first hash value is also obtained after the additional verification data is split. Before obtaining the second symmetric key based on the first public key and the second private key, the method also includes: performing hash calculation on the second private key to obtain a second hash value; determining whether the second hash value is the same as the first hash value; if so, executing the step of obtaining the second symmetric key based on the first public key and the second private key.

[0021] Through the above technical solution, the hash value calculated based on the second public key at the first user end can be compared with the hash value calculated based on the second private key at the second user end. If the two are consistent, subsequent steps are performed, further ensuring the security and integrity of the data.

[0022] In a technical solution of the above-mentioned hardware-based data protection method, the cryptographic suite is also obtained after the additional verification data is split, wherein the cryptographic suite at least includes the encryption algorithm information, and the method further includes: based on the encryption algorithm information, determining whether the process of decrypting the data ciphertext requires the initialization vector; if so, decrypting the data ciphertext based on the key plaintext and the initialization vector to obtain the data plaintext.

[0023] In a second aspect, the present application provides a hardware-based data protection system, the system comprising:

[0024] A first module, the first module is configured to generate a first public key, a first private key, a key plaintext, and an initialization vector;

[0025] An encryption module, wherein the encryption module is configured to: obtain additional verification data based on a preset second public key, a preset cipher suite, and the first public key; obtain a first symmetric key based on the second public key and the first private key; encrypt the key plaintext based on the first symmetric key, the additional verification data, and the initialization vector to obtain a negotiation result; encrypt the data plaintext to be protected based on the key plaintext to obtain a data ciphertext, wherein the negotiation result is used to decrypt the data ciphertext.

[0026] In a technical solution of the above hardware-based data protection system, the system further includes:

[0027] a second module, the second module being configured to generate a second private key;

[0028] A decryption module is configured to decrypt the data ciphertext based on the negotiation result and the second private key to obtain the data plaintext.

[0029] In a third aspect, a smart device is provided, comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein a computer program is stored in the memory, and when the computer program is executed by the at least one processor, the method described in any one of the technical solutions of the above-mentioned hardware-based data protection method is implemented.

[0030] In a fourth aspect, a computer-readable storage medium is provided, which stores a plurality of program codes, wherein the program codes are suitable for being loaded and run by a processor to execute the hardware-based data protection method described in any one of the technical solutions of the above-mentioned hardware-based data protection method.

[0031] Solution 1. A hardware-based data protection method, characterized in that the method includes at least an encryption stage, the hardware on which the method is based includes at least a first module, and the method includes:

[0032] Based on the first module, generate a first public key, a first private key, a key plaintext and an initialization vector;

[0033] Obtaining additional verification data based on a preset second public key, a preset cryptographic suite, and the first public key;

[0034] Obtaining a first symmetric key based on the second public key and the first private key;

[0035] Encrypting the key plaintext based on the first symmetric key, the additional verification data, and the initialization vector to obtain a negotiation result;

[0036] The data plaintext to be protected is encrypted based on the key plaintext to obtain data ciphertext, wherein the negotiation result is used to decrypt the data ciphertext.

[0037] Solution 2. The hardware-based data protection method according to Solution 1 is characterized in that the additional verification data obtained based on the preset second public key, the preset cryptographic suite and the first public key comprises:

[0038] Performing a hash calculation on the second public key to obtain a first hash value;

[0039] The first hash value, the cryptographic suite, and the first public key are concatenated to obtain the additional verification data.

[0040] Solution 3. The hardware-based data protection method according to Solution 1, characterized in that obtaining the first symmetric key based on the second public key and the first private key comprises:

[0041] Performing key negotiation on the second public key and the first private key to obtain a first shared key;

[0042] A key derivation is performed on the first shared key to obtain a key of length K and recorded as the first symmetric key.

[0043] Solution 4. The hardware-based data protection method according to Solution 1 is characterized in that the key plaintext is encrypted based on the first symmetric key, the additional verification data and the initialization vector to obtain a negotiation result comprising:

[0044] Encrypting the key plaintext based on the first symmetric key, the additional verification data, and the initialization vector to obtain a key ciphertext and an authentication tag;

[0045] The additional verification data, the initialization vector, the key ciphertext and the authentication tag are concatenated to obtain the negotiation result.

[0046] Solution 5. The hardware-based data protection method according to any one of Solutions 1 to 4, wherein the cryptographic suite includes at least encryption algorithm information, and the method further includes:

[0047] Based on the encryption algorithm information, determining whether the initialization vector is required for the process of encrypting the plaintext data to be protected;

[0048] If so, the data plaintext is encrypted based on the key plaintext and the initialization vector to obtain the data ciphertext.

[0049] Solution 6. The hardware-based data protection method according to Solution 5 is characterized in that the method further includes at least a decryption stage, the hardware on which the method is based also includes at least a second module, and the method further includes:

[0050] Based on the second module, generate a second private key;

[0051] Based on the negotiation result and the second private key, the data ciphertext is decrypted to obtain the data plaintext.

[0052] Solution 7. The hardware-based data protection method according to Solution 6 is characterized in that decrypting the data ciphertext based on the negotiation result and the second private key to obtain the data plaintext includes:

[0053] Splitting the negotiation result to obtain the additional verification data, the initialization vector, the key ciphertext and the authentication tag;

[0054] Splitting the additional verification data to obtain the first public key;

[0055] Obtaining a second symmetric key based on the first public key and the second private key;

[0056] Decrypting the key ciphertext based on the second symmetric key, the additional verification data, and the initialization vector to obtain the key plaintext;

[0057] Based on the key plaintext, the data ciphertext is decrypted to obtain the data plaintext.

[0058] Solution 8. The hardware-based data protection method according to Solution 7, wherein obtaining the second symmetric key based on the first public key and the second private key comprises:

[0059] Performing key negotiation on the first public key and the second private key to obtain a second shared key;

[0060] Key derivation is performed on the second shared key to obtain a key with a length of K and recorded as the second symmetric key.

[0061] Solution 9. The hardware-based data protection method according to Solution 7 is characterized in that the first hash value is obtained after the additional verification data is split, and before the second symmetric key is obtained based on the first public key and the second private key, the method further includes:

[0062] Performing a hash calculation on the second private key to obtain a second hash value;

[0063] Determine whether the second Hash value is the same as the first Hash value;

[0064] If so, execute the step of obtaining the second symmetric key based on the first public key and the second private key.

[0065] Solution 10. The hardware-based data protection method according to any one of solutions 7 to 9, characterized in that the cipher suite is obtained after the additional verification data is split, wherein the cipher suite at least includes the encryption algorithm information, and the method further includes:

[0066] Based on the encryption algorithm information, determining whether the initialization vector is required for decrypting the data ciphertext;

[0067] If so, the data ciphertext is decrypted based on the key plaintext and the initialization vector to obtain the data plaintext.

[0068] Solution 11. A hardware-based data protection system, characterized in that the system comprises:

[0069] A first module, the first module is configured to generate a first public key, a first private key, a key plaintext, and an initialization vector;

[0070] An encryption module, wherein the encryption module is configured to: obtain additional verification data based on a preset second public key, a preset cipher suite, and the first public key; obtain a first symmetric key based on the second public key and the first private key; encrypt the key plaintext based on the first symmetric key, the additional verification data, and the initialization vector to obtain a negotiation result; encrypt the data plaintext to be protected based on the key plaintext to obtain a data ciphertext, wherein the negotiation result is used to decrypt the data ciphertext.

[0071] Solution 12. The hardware-based data protection system according to Solution 11, characterized in that the system further comprises:

[0072] a second module, the second module being configured to generate a second private key;

[0073] A decryption module is configured to decrypt the data ciphertext based on the negotiation result and the second private key to obtain the data plaintext.

[0074] Solution 13. A smart device, comprising:

[0075] at least one processor;

[0076] and, a memory communicatively coupled to the at least one processor;

[0077] The memory stores a computer program, and when the computer program is executed by the at least one processor, the hardware-based data protection method described in any one of Schemes 1 to 10 is implemented.

[0078] Solution 14. A computer-readable storage medium storing a plurality of program codes, wherein the program codes are suitable for being loaded and run by a processor to execute the hardware-based data protection method described in any one of Solutions 1 to 10. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] The disclosure of the present application will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present application. In addition, similar numbers in the drawings are used to represent similar components, among which:

[0080] Figure 1 is a flowchart of the main steps of a hardware-based data protection method according to an embodiment of the present application;

[0081] Figure 2 This is a schematic diagram of the main steps of encrypting plaintext data according to an embodiment of the present application;

[0082] Figure 3 is a flowchart of the main steps of a hardware-based data protection method according to an embodiment of the present application;

[0083] Figure 4 This is a schematic diagram of the main steps of decrypting data ciphertext according to an embodiment of the present application;

[0084] Figure 5 is a schematic diagram of an application scenario of a hardware-based data protection method according to an embodiment of the present application;

[0085] Figure 6 is a schematic diagram of a main structural block diagram of a hardware-based data protection system according to an embodiment of the present application;

[0086] Figure 7 is a schematic diagram of a main structural block diagram of a hardware-based data protection system according to an embodiment of the present application;

[0087] Figure 8 It is a schematic diagram of the main structure of a smart device according to an embodiment of the present application.

[0088] Reference numerals list :

[0089] 61: first module; 62: encryption module; 63: second module; 64: decryption module; 81: memory; 82: processor. DETAILED DESCRIPTION

[0090] Some embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the protection scope of the present application.

[0091] In the description of the present application, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, memory, and may also include software parts, such as program code, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program code, such as a disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B" and may include only A, only B or A and B. The singular terms "one" and "the" may also include plural forms.

[0092] The relevant user personal information that may be involved in the various embodiments of this application is strictly in accordance with the requirements of laws and regulations, following the principles of legality, legitimacy and necessity, based on the reasonable purposes of business scenarios, to process the personal information that users actively provide during the use of products / services or generated due to the use of products / services, as well as the personal information obtained with the user's authorization.

[0093] The user personal information processed by this application will vary depending on the specific product / service scenario, and shall be based on the specific scenario in which the user uses the product / service, and may involve the user's account information, device information, driving information, vehicle information or other related information. This application will treat the user's personal information and its processing with a high degree of diligence.

[0094] This application attaches great importance to the security of user personal information and has taken reasonable and feasible security protection measures that meet industry standards to protect user information and prevent personal information from being accessed, disclosed, used, modified, damaged or lost without authorization.

[0095] Please see attached Figure 1 , Figure 1 FIG. 1 is a flowchart of the main steps of a hardware-based data protection method according to an embodiment of the present application. Figure 1 As shown, the method of the present application mainly includes steps S1 to S5:

[0096] Step S1: Based on the first module, generate a first public key, a first private key, a key plaintext and an initialization vector:

[0097] In this embodiment, the "first module" is physical hardware, and the technical solution of the present application is implemented at least based on the first module. Different from the software encryption method based on open source or proprietary cryptographic libraries (such as OpenSSL, Crypto++, etc.) completed by programming languages ​​(such as C, C++, Java, etc.), the present application implements hardware encryption based on the first module, wherein the first module can be a hardware security engine (HSE), a programmable logic device (Field-Programmable Gate Array, FPGA), etc., and the specific form is not limited. The first module can have the function of automatically generating encryption instructions, and subsequently automatically execute the encryption action corresponding to the encryption instruction, or the first module only has the function of executing actions but not issuing instructions. Therefore, if the first module belongs to the latter, when implementing the technical solution of the present application, it should also be based on a module or system with the function of issuing encryption instructions. The "first user" is generally the data sender and encryptor, and may also be both the data sender (encryptor) and the data receiver (decryptor), without specific limitation; the "first public key and the first private key" are the public key and the private key in the key pair used by the first user for encryption and / or decryption; the "initialization vector" is a parameter used for the encryption algorithm. In this embodiment, the first public key, the first private key, the key plaintext, and the initialization vector are all randomly generated by the first module.

[0098] Step S2: Based on the preset second public key, the preset cryptographic suite and the first public key, obtain additional verification data:

[0099] In this embodiment, the "cipher suite" is a pre-stored encryption algorithm. In one embodiment, the cipher suite can be a universal algorithm pre-set by the data encryption end (or data sending end) and the data decryption end (or data receiving end), which can also include components such as a key exchange algorithm and a message authentication code. The "second public key" is the public key part of the pre-set second public-private key pair. The "additional verification data" is the additional verification data obtained after encryption by the encryption algorithm. In one embodiment, step S2 can also include steps S21-step S22: step S21, performing a hash calculation on the second public key to obtain a first hash value; step S22, concatenating the first hash value, the cipher suite and the first public key to obtain additional verification data. In this embodiment, a hash calculation (SHA-1 calculation) is performed on the second public key to obtain a first hash value, and then the first hash value, the cipher suite and the first public key are concatenated in byte order to obtain additional verification data.

[0100] Step S3: Based on the second public key and the first private key, obtain a first symmetric key:

[0101] In this embodiment, the "first symmetric key" is a key used to encrypt the key plaintext. In one implementation, step S3 may also include: step S31, performing key negotiation on the second public key and the first private key to obtain a first shared key; step S32, performing key derivation on the first shared key to obtain a key of length K and record it as the first symmetric key. In this embodiment, key negotiation is the process of establishing a shared key to ensure the security and confidentiality of the data encryption process, wherein the shared key is a key subsequently attached to the negotiation result so as to complete the decryption of the data based on the key.

[0102] Step S4: Encrypt the key plaintext based on the first symmetric key, the additional verification data and the initialization vector to obtain a negotiation result:

[0103] In this embodiment, the key plaintext is encrypted to obtain the key ciphertext, wherein the negotiation result at least includes the key ciphertext. In one implementation, step S4 may also include steps S41-S42: step S41, based on the first symmetric key, additional verification data and initialization vector, the key plaintext is encrypted to obtain the key ciphertext and the authentication tag; step S42, the additional verification data, the initialization vector, the key ciphertext and the authentication tag are concatenated to obtain the negotiation result. In this implementation, the "authentication tag" is generated in the ciphertext, and its generation process uses the authentication part in the encryption algorithm such as the AEAD algorithm (for example, the AES-GCM algorithm, the AES-CCM algorithm, etc.), which is usually attached to the end of the ciphertext. If the ciphertext is tampered with or forged, the authentication tag will be invalid in the subsequent verification process. The key ciphertext, the authentication tag, the additional verification data and the initialization vector are concatenated in byte order to obtain the negotiation result.

[0104] Step S5: Encrypt the data plaintext to be protected based on the key plaintext to obtain data ciphertext, wherein the negotiation result is used to decrypt the data ciphertext:

[0105] In this embodiment, "data plaintext" is data to be protected, which can be data to be sent or data to be stored. The data format can be text, code, picture, etc., and there is no specific limitation. Correspondingly, the encrypted data is data ciphertext. In one embodiment, the process of encrypting data plaintext can also include: step S51-step S52: step S51, based on the encryption algorithm information, determine whether the process of encrypting the data plaintext to be protected requires an initialization vector; step S52, if so, encrypt the data plaintext based on the key plaintext and the initialization vector to obtain the data ciphertext. In this embodiment, the process of encrypting data plaintext also depends on the type of encryption algorithm information, and whether an initialization vector is required is determined based on its type.

[0106] Based on the above embodiments, please refer to the attached Figure 2 The preferred embodiment provided is: Figure 2 The following is a flowchart of the main steps of encrypting plain text data. Figure 2 As shown, the main steps of encryption can be described as:

[0107] 1. Based on HSE (first module), ECDH (elliptic curve encryption scheme) key negotiation is performed on tsk (temporary ECC private key, i.e., the first private key) and pk (ECC public key, i.e., the second public key) to obtain ss (shared key);

[0108] 2. Based on HSE, derive the key of ss and cut off the specific length to get k (symmetric key);

[0109] 3. Perform SHA-1 calculation (hash function calculation) on pk to obtain pks (first hash value);

[0110] 4. Concatenate cs (cipher suite), pks, tpk (sender's temporary ECC public key, i.e., the first public key) in byte order to obtain aad (additional verification data of the AEAD algorithm, i.e., additional verification data);

[0111] 5. Based on HSE, use aad, iv (initialization vector) and k to perform AEAD encryption on km (the key plaintext used to encrypt data, i.e., the first key plaintext) to obtain kc (the key ciphertext used to encrypt data, i.e., the key ciphertext), where the encryption algorithm is obtained by parsing cs;

[0112] 6. Concatenate aad, iv, kc and tag (the authentication tag of the AED algorithm, i.e., the authentication tag) in byte order to obtain res (which contains all the necessary information for decrypting kc, i.e., the negotiation result);

[0113] 7. Based on HSE, dm is encrypted using km and iv to obtain dc. Specifically, whether to use iv is selected according to the encryption algorithm type. The encryption algorithm is obtained by parsing cs.

[0114] exist Figure 2In the provided implementation mode, HSE is used in the encryption process to improve the security and computational efficiency of the system; tsk, tpk, km and iv of each information interaction are randomly generated by HSE, thereby enhancing the forward security of the system; KDF is not used for key derivation, but ss is intercepted to obtain k, thereby ensuring that the security strength remains unchanged while improving efficiency; all additional information is protected, including cipher suites, temporary public keys and public key hashes, thereby ensuring the integrity of the information; AEAD encryption algorithm is used, and the MAC algorithm is removed compared to the open source library algorithm, thereby simplifying the implementation process and improving performance; the data encryption algorithm can be defined according to device performance or security requirements, thereby improving the flexibility and compatibility of the system; the cipher suite ID is agreed upon through the protocol, and the cipher suite cs only needs to occupy 1 byte, thereby simplifying the negotiation information and reducing the negotiation steps between the two parties.

[0115] In another embodiment, the method of the present application further includes at least a decryption stage, the hardware on which the method is based also includes at least a second module, and the method further includes steps S6-S7: Step S6, based on the second module, generating a second private key:

[0116] In this embodiment, the second module is physical hardware. Compared with the first module applied to the data encryption stage, the second module in this embodiment is applied to the data decryption stage. In some application scenarios, the functional principles implemented by the two are the same. The second module is the first module. For example, after encrypting the data in a specific device or apparatus containing the first module, the encrypted data is saved to the cloud server, and then the encrypted data is downloaded to the above-mentioned device or apparatus, and the first module in the device or apparatus completes the data decryption. The second private key is the private key part of the aforementioned second public-private key pair.

[0117] Step S7: Based on the negotiation result and the second private key, the data ciphertext is decrypted to obtain the data plaintext:

[0118] In this embodiment, the negotiation result includes a key ciphertext for decrypting the data ciphertext. Therefore, the key ciphertext can be obtained based on the negotiation result, and the key ciphertext can be decrypted based on the second private key to obtain the key plaintext. Finally, the data ciphertext is decrypted using the key plaintext to obtain the data plaintext.

[0119] In one embodiment, see the attached Figure 3 , attached Figure 3 FIG. 1 is a flowchart of the main steps of a hardware-based data protection method according to an embodiment of the present application. Figure 3 As shown, step S7 may also include steps S71 to S75:

[0120] Step S71: Split the negotiation result to obtain additional verification data, initialization vector, key ciphertext and authentication tag;

[0121] Step S72: split the additional verification data to obtain a first public key;

[0122] Step S73: Obtain a second symmetric key based on the first public key and the second private key;

[0123] Step S74: decrypt the key ciphertext based on the second symmetric key, the additional verification data and the initialization vector to obtain the key plaintext;

[0124] Step S75: decrypt the data ciphertext based on the key plaintext to obtain the data plaintext.

[0125] In this embodiment, the negotiation result is split, which is the reverse operation of performing the splicing operation in the decryption phase to obtain the negotiation result, and the additional verification data is split in the same manner.

[0126] In one implementation of this embodiment, step S73 may further include steps S731 and S732: step S731, performing key negotiation on the first public key and the second private key to obtain a second shared key; step S732, performing key derivation on the second shared key to obtain a key of length K and record it as a second symmetric key. In this implementation, key negotiation and key derivation are the same as the processes described in the aforementioned steps S31 and S32, and are not described in detail here.

[0127] In one implementation of this embodiment, before executing step S73, the following may be included: performing a hash calculation on the second private key to obtain a second hash value; determining whether the second hash value is the same as the first hash value; if so, executing the step of obtaining a second symmetric key based on the first public key and the second private key. This implementation may compare the hash value calculated on the first user end based on the second public key with the hash value calculated on the second user end based on the second private key, and if the two are consistent, proceed to the subsequent steps, further ensuring the security and integrity of the data.

[0128] In one implementation of this embodiment, step S75 may also include step S751-step S752: step S751, based on the encryption algorithm information, determine whether the process of decrypting the data ciphertext requires an initialization vector; step S752, if so, decrypt the data ciphertext based on the key plaintext and the initialization vector to obtain the data plaintext. This implementation corresponds to the aforementioned step S51 and step S52, that is, if it is determined that an initialization vector is required based on the type of encryption algorithm information, the initialization vector is required in the process of encrypting and decrypting the data.

[0129] Based on this embodiment, please refer to the attached Figure 4 The provided implementation modes, Figure 4FIG. 1 is a flowchart of the main steps of decrypting data ciphertext according to an embodiment of the present application. Figure 4 As shown, the main steps for decrypting data ciphertext can be described as:

[0130] Step 8, split res into tag, kc, iv and aad;

[0131] Step 9: further split aad to obtain tpk and pks (first hash value);

[0132] Step 10: Export pk corresponding to sk (ECC private key, i.e., second private key) based on HSE;

[0133] Step 11: Calculate whether the SHA-1 value of the derived pk (second hash value) is equal to pks (first hash value). If they are equal, proceed to the next step; otherwise, terminate the decryption process.

[0134] Step 12: Perform ECDH key negotiation on sk and tpk based on HSE to obtain ss;

[0135] Step 13: Based on HSE, derive the key of ss and cut off the specific length to obtain k (the second symmetric key);

[0136] Step 14: Based on HSE, use aad, iv, tag and k to perform AEAD decryption on kc to obtain km (second key plaintext);

[0137] Step 15: Based on HSE, use km and iv to decrypt dc to obtain dm, and choose whether to use iv according to the encryption algorithm type.

[0138] exist Figure 4 In the provided implementation mode, HSE is used in the decryption process to improve the security and operational efficiency of the system; KDF is not used for key derivation, but ss is intercepted to obtain k, thereby improving efficiency while ensuring that the security strength remains unchanged; the AEAD encryption algorithm is used, and the MAC algorithm is removed compared to the open source library algorithm, which simplifies the implementation process and improves performance; the data encryption algorithm can be defined according to device performance or security requirements, thereby improving the flexibility and compatibility of the system.

[0139] Please see attached Figure 5 , Figure 5 FIG. 1 is a schematic diagram of an application scenario of a hardware-based data protection method according to an embodiment of the present application. Figure 5As shown, in the new business platform, the hardware-based data protection method provided by the present application is used to encrypt and protect the published data. For example, in the field of automotive engineering, when the vehicle controller is produced and offline, the HSE will generate its own ECC key, and transmit the negotiation information and public key to the background server through the diagnostic communication tool, where the negotiation information includes at least the second public key and the cryptographic suite. The background server encrypts the data according to the recipient's negotiation information, sends the negotiation result to the diagnostic communication tool, and stores the larger ciphertext data in the cloud, which can be downloaded from the cloud when the vehicle needs it.

[0140] So far, the hardware-based data protection method of the present application has been described. It should be pointed out that although the various steps are described in a specific order in the above embodiments, those skilled in the art can understand that in order to achieve the effect of the present application, the different steps do not have to be executed in such an order, and they can be executed simultaneously (in parallel) or in other orders, and these changes are within the scope of protection of the present application.

[0141] Furthermore, the present application also provides a hardware-based data protection system.

[0142] See attached Figure 6 , Figure 6 FIG. 1 is a main structural block diagram of a hardware-based data protection system according to an embodiment of the present application. Figure 6 As shown, the hardware-based data protection system in the embodiment of the present application mainly includes a first module 61 and an encryption module 62. In some embodiments, one or more of the first module 61 and the encryption module 62 can be combined into one module. In some embodiments, the first module 61 can be configured to generate a first public key, a first private key, a key plaintext, and an initialization vector. The encryption module 62 can be configured to: obtain additional verification data based on a preset second public key, a preset cipher suite, and the first public key; obtain a first symmetric key based on the second public key and the first private key; encrypt the key plaintext based on the first symmetric key, the additional verification data, and the initialization vector to obtain a negotiation result; encrypt the data plaintext to be protected based on the key plaintext to obtain a data ciphertext, wherein the negotiation result is used to decrypt the data ciphertext.

[0143] In another embodiment, see the attached Figure 7The hardware-based data protection system provided by the present application may also include a second module 63 and a decryption module 64, wherein the second module 63 is configured to generate a second private key; and the decryption module 64 is configured to decrypt the data ciphertext based on the negotiation result and the second private key to obtain the data plaintext. In some embodiments, one or more of the second module 63 and the decryption module 64 may be combined into one module, wherein the second module 63 may also be used to generate the preset second public key, and the second public key and the second private key constitute a second public-private key pair.

[0144] The hardware-based data protection system is used to perform Figure 1 The hardware-based data protection method embodiment shown in the figure has similar technical principles, technical problems solved and technical effects produced. Technical personnel in this technical field can clearly understand that for the convenience and conciseness of description, the specific working process and related instructions of the hardware-based data protection system can refer to the contents described in the embodiment of the hardware-based data protection method, which will not be repeated here.

[0145] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above-mentioned embodiment of the present application can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code.

[0146] Furthermore, the present application also provides an intelligent device. In an embodiment of an intelligent device according to the present application, the intelligent device may include at least one processor; and a memory connected to the at least one processor; wherein a computer program is stored in the memory, and when the computer program is executed by the at least one processor, the method described in any of the above embodiments is implemented. The intelligent device described in the present application may include a driving device, a smart car, a robot, and other devices. Please refer to the attached Figure 8 , Figure 8 8 shows by way of example that the memory 81 and the processor 82 are communicatively connected via a bus.

[0147] In some embodiments of the present application, the smart device may further include at least one sensor for sensing information. The sensor is communicatively connected to any type of processor mentioned in the present application. Optionally, the smart device may further include an autonomous driving system for guiding the smart device to drive itself or assist in driving. The processor communicates with the sensor and / or the autonomous driving system to complete the method described in any of the above embodiments.

[0148] Furthermore, the present application also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present application, the computer-readable storage medium can be configured to store a program for executing the hardware-based data protection method of the above-mentioned method embodiment, and the program can be loaded and run by the processor to implement the above-mentioned hardware-based data protection method. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present application is a non-temporary computer-readable storage medium.

[0149] Further, it should be understood that since the setting of each module is only for illustrating the functional units of the device of the present application, the physical devices corresponding to these modules may be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only schematic.

[0150] It is understood by those skilled in the art that each module in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principle of the present application, and therefore, the technical solutions after splitting or merging will fall within the protection scope of the present application.

[0151] So far, the technical solutions of the present application have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments. Without departing from the principles of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present application.

Claims

1. A hardware-based data protection method, characterized in that: The method comprises at least an encryption phase, the hardware on which the method is based comprises at least a first module, and the method comprises: Based on the first module, generate a first public key, a first private key, a key plaintext and an initialization vector; Obtaining additional verification data based on a preset second public key, a preset cryptographic suite, and the first public key; Obtaining a first symmetric key based on the second public key and the first private key; Encrypting the key plaintext based on the first symmetric key, the additional verification data, and the initialization vector to obtain a negotiation result; The data plaintext to be protected is encrypted based on the key plaintext to obtain data ciphertext, wherein the negotiation result is used to decrypt the data ciphertext.

2. The hardware-based data protection method according to claim 1, characterized in that: The obtaining of the additional verification data based on the preset second public key, the preset cryptographic suite, and the first public key includes: Performing a hash calculation on the second public key to obtain a first hash value; The first hash value, the cryptographic suite, and the first public key are concatenated to obtain the additional verification data.

3. The hardware-based data protection method according to claim 1, characterized in that: The obtaining a first symmetric key based on the second public key and the first private key comprises: Performing key negotiation on the second public key and the first private key to obtain a first shared key; A key derivation is performed on the first shared key to obtain a key of length K and recorded as the first symmetric key.

4. The hardware-based data protection method according to claim 1, characterized in that: The encrypting the key plaintext based on the first symmetric key, the additional verification data, and the initialization vector to obtain a negotiation result includes: Encrypting the key plaintext based on the first symmetric key, the additional verification data, and the initialization vector to obtain a key ciphertext and an authentication tag; The additional verification data, the initialization vector, the key ciphertext and the authentication tag are concatenated to obtain the negotiation result.

5. The hardware-based data protection method according to any one of claims 1 to 4, characterized in that: The cipher suite includes at least encryption algorithm information, and the method further includes: Based on the encryption algorithm information, determining whether the initialization vector is required for the process of encrypting the plaintext data to be protected; If so, the data plaintext is encrypted based on the key plaintext and the initialization vector to obtain the data ciphertext.

6. The hardware-based data protection method according to claim 5, characterized in that: The method further comprises at least a decryption phase, the hardware on which the method is based further comprises at least a second module, and the method further comprises: Based on the second module, generate a second private key; Based on the negotiation result and the second private key, the data ciphertext is decrypted to obtain the data plaintext.

7. The hardware-based data protection method according to claim 6, characterized in that: The decrypting the data ciphertext based on the negotiation result and the second private key to obtain the data plaintext includes: Splitting the negotiation result to obtain the additional verification data, the initialization vector, the key ciphertext and the authentication tag; Splitting the additional verification data to obtain the first public key; Obtaining a second symmetric key based on the first public key and the second private key; Decrypting the key ciphertext based on the second symmetric key, the additional verification data, and the initialization vector to obtain the key plaintext; Based on the key plaintext, the data ciphertext is decrypted to obtain the data plaintext.

8. The hardware-based data protection method according to claim 7, characterized in that: The obtaining a second symmetric key based on the first public key and the second private key comprises: Performing key negotiation on the first public key and the second private key to obtain a second shared key; Key derivation is performed on the second shared key to obtain a key with a length of K and recorded as the second symmetric key.

9. The hardware-based data protection method according to claim 7, characterized in that: The first Hash value is obtained after splitting the additional verification data, and before obtaining the second symmetric key based on the first public key and the second private key, the method further includes: Performing a hash calculation on the second private key to obtain a second hash value; Determine whether the second Hash value is the same as the first Hash value; If so, execute the step of obtaining the second symmetric key based on the first public key and the second private key.

10. The hardware-based data protection method according to any one of claims 7 to 9, characterized in that: The cipher suite is obtained after splitting the additional verification data, wherein the cipher suite at least includes the encryption algorithm information, and the method further includes: Based on the encryption algorithm information, determining whether the initialization vector is required for decrypting the data ciphertext; If so, the data ciphertext is decrypted based on the key plaintext and the initialization vector to obtain the data plaintext.

Citation Information

Patent Citations

  • Data encryption-decryption method and apparatus

    CN108763917A

  • Hardware encryption and decryption system and method

    CN110287721A

  • Data high-speed encryption and decryption method and device based on symmetric cryptographic algorithm

    CN111464564A

  • File encryption method, file decryption method, file encryption device, file decryption device and equipment

    CN115795513A

  • Encryption method and device based on national commercial cryptographic algorithm

    CN115834038A