Data self-encryption device and method

Through the multi-layer key decryption mechanism of the data self-encryption device, the problem of poor security in the data encryption method in the storage unit is solved, and high security protection of data during storage and reading is achieved.

CN115865448BActive Publication Date: 2025-09-02SHENZHEN AJLT NEW TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211479805.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-24
Publication Date
2025-09-02
Estimated Expiration
2042-11-24

AI Technical Summary

Technical Problem

The data encryption method in existing storage units is poor in security, easy to be deciphered, and data leakage is lacking effective identity authentication protection.

Method used

The data self-encryption device is adopted, including a first storage unit, a second storage unit, an encryption and decryption module, a key processing module and a key generation module. Through a multi-layer key decryption mechanism, it is ensured that the data always exists in an encrypted form during storage and reading, and the key authentication process is carried out inside the device.

Benefits of technology

Improve the security of data storage, ensure that data is verified by multi-layer keys before reading, effectively preventing data leakage, and enhancing the security of data storage areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115865448B_ABST
    Figure CN115865448B_ABST
Patent Text Reader

Abstract

The present invention provides a data self-encryption method and device, comprising a first storage unit, a second storage unit, an encryption / decryption module, a key processing module, and a key generation module; the second storage unit comprises a data storage area and a key storage area. Upon receiving a data read instruction from a host, the key processing module retrieves second key information from the key storage area and decrypts the second key information using the first key information to obtain initial key information; the encryption / decryption module is configured to retrieve the encrypted data to be read from the data storage area and the initial key information from the key processing module, and decrypt the encrypted data to be read using the initial key information according to a selected encryption / decryption algorithm, and then output the decrypted data to the host. Through the above scheme, data in the data storage area is always stored in an encrypted manner. When data needs to be read, it needs to be decrypted using multiple layers of keys. The entire decryption process is performed internally by the device, effectively improving the security of data storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data encryption and decryption, and in particular to a data self-encryption method and device. Background Art

[0002] At present, data in storage units are generally stored in plain text without effective identity authentication protection. Even if identity authentication exists, it is mostly for access to a certain storage area in the storage unit. Once the encrypted storage area is deciphered, criminals can browse and tamper with the data in the encrypted storage area at will, resulting in low data security and easy to cause huge losses due to data leakage. Summary of the Invention

[0003] Therefore, it is necessary to provide a technical solution for data self-encryption to solve the problem of poor data security in the encryption method of the current storage unit.

[0004] To meet the above needs, in a first aspect, the present invention provides a data self-encryption device, which includes a first storage unit, a second storage unit, an encryption and decryption module, a key processing module, and a key generation module; the second storage unit includes a data storage area and a key storage area;

[0005] The key generation module is used to generate first key information and store the first key information in the first storage unit;

[0006] The key processing module is used to obtain initial key information, encrypt the initial key information using the first key information to obtain second key information, and store the second key information in the key storage area;

[0007] After receiving the data reading instruction from the host side, the key processing module is used to obtain the second key information from the key storage area, and use the first key information to decrypt the second key information to obtain the initial key information; the encryption and decryption module is used to obtain the encrypted data to be read from the data storage area and the initial key information from the key processing module, and use the initial key information to decrypt the encrypted data to be read according to the selected encryption and decryption algorithm and then output it to the host side.

[0008] As an optional embodiment, after receiving a data write instruction from the host side, the key processing module is used to obtain the second key information from the key storage area, and use the first key information to decrypt the second key information to obtain the initial key information; the encryption and decryption module is used to obtain the plaintext data to be written from the host side and the initial key information from the key processing module, and use the initial key information to encrypt the plaintext data to be written according to the selected encryption and decryption algorithm and then store it in the data storage area.

[0009] As an optional embodiment, the key generation module includes a hash operation module;

[0010] The hash operation module is used to obtain user authentication information and / or device identification information, perform a hash operation on the user authentication information and / or device identification information to obtain first key information, and store the first key information in the first storage unit.

[0011] As an optional embodiment, the device further includes a random number generator;

[0012] Performing a hash operation on the user authentication information and / or the device identification information to obtain the first key information includes:

[0013] The hash operation module is used to obtain at least one random number generated by a random number generator, perform a hash operation on the at least one random number, user authentication information and device identification information, and generate first key information.

[0014] As an optional embodiment, the device further includes an OTP storage unit, the OTP storage unit is used to store chip fingerprint information; the key generation module further includes a logic operation module;

[0015] The hash operation module is used to perform a hash operation on the user authentication information and / or the device identification information to obtain a first hash operation result;

[0016] The logic operation module is used to obtain chip fingerprint information from the OTP storage unit, perform a preset logic operation on the first hash operation result and the chip fingerprint information, and obtain first key information.

[0017] As an optional embodiment, the device further includes a random number generator and a register;

[0018] When receiving an encryption partition creation instruction, the random number generator is used to randomly generate a random number and store the generated random number in a register; the initial key information is the randomly generated random number.

[0019] As an optional embodiment, the encryption and decryption module stores at least one encryption and decryption algorithm, and the encryption and decryption algorithm includes an SM4 decryption algorithm;

[0020] The encryption and decryption module is used to divide the encrypted data to be read into several data blocks and use the SM4 decryption algorithm to decrypt each data block separately.

[0021] As an optional embodiment, the first storage unit is an SRAM and / or the second storage unit is a flash memory unit.

[0022] In a second aspect, the present invention provides a data self-encryption method, which is applied to the data self-encryption device according to the first aspect of the present invention;

[0023] The method comprises the following steps:

[0024] The key generation module generates first key information and stores the first key information in the first storage unit;

[0025] The key processing module obtains initial key information, encrypts the initial key information using the first key information to obtain second key information, and stores the second key information in the key storage area;

[0026] After receiving the data write instruction from the host, the key processing module obtains the second key information from the key storage area, decrypts the second key information using the first key information, and obtains the initial key information;

[0027] The encryption and decryption module obtains the plaintext data to be written from the host and the initial key information from the key processing module, and encrypts the plaintext data to be written using the initial key information according to the selected encryption and decryption algorithm and then stores it in the data storage area.

[0028] As an optional embodiment, the method further includes the following steps:

[0029] After receiving the data reading instruction from the host side, the key processing module obtains the second key information from the key storage area, uses the first key information to decrypt the second key information, and obtains the initial key information; the encryption and decryption module obtains the encrypted data to be read from the data storage area and the initial key information from the key processing module, uses the initial key information to decrypt the encrypted data to be read according to the selected encryption and decryption algorithm, and then outputs it to the host side.

[0030] Different from the existing technology, the present invention provides a data self-encryption method and device, which includes a first storage unit, a second storage unit, an encryption and decryption module, a key processing module and a key generation module; the second storage unit includes a data storage area and a key storage area. After receiving a data read instruction from the host side, the key processing module obtains the second key information from the key storage area, uses the first key information to decrypt the second key information, and obtains the initial key information; the encryption and decryption module is used to obtain the encrypted data to be read from the data storage area and the initial key information from the key processing module, and uses the initial key information to decrypt the encrypted data to be read according to the selected encryption and decryption algorithm, and then outputs it to the host side. Through the above scheme, the data in the data storage area is always stored in an encrypted manner. When it needs to be read, it needs to be decrypted through multiple layers of keys. The entire decryption process is carried out inside the device, which effectively improves the security of data storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1This is a module diagram of a data self-encryption device according to one embodiment of the present invention;

[0032] Figure 2 Schematic diagram of the principle of the first key information generation process involved in one embodiment of the present invention;

[0033] Figure 3 Schematic diagram of the principle of the second key information generation process involved in one embodiment of the present invention;

[0034] Figure 4 A schematic diagram of the principle of the data encryption and decryption process involved in one embodiment of the present invention;

[0035] Figure 5 Schematic diagram of a data self-encryption method according to an embodiment of the present invention;

[0036] Figure 6 Schematic diagram of a flow chart of a data self-encryption method according to another embodiment of the present invention;

[0037] Reference numerals:

[0038] 10. Data self-encryption device;

[0039] 101. Encryption and decryption module;

[0040] 102. A second storage unit;

[0041] 1021. Data storage area;

[0042] 1022. Key storage area;

[0043] 103. Key processing module;

[0044] 104. Key generation module;

[0045] 1041. Hash operation module;

[0046] 1042. Logical operation module;

[0047] 105. First storage unit;

[0048] 106. Random number generator;

[0049] 107. Register;

[0050] 108. OTP storage unit;

[0051] 20. Host side. DETAILED DESCRIPTION

[0052] In order to explain in detail the possible application scenarios, technical principles, specific solutions that can be implemented, and the purpose and effects of this application, the following is a detailed description of the specific embodiments listed in conjunction with the accompanying drawings. The embodiments described herein are only used to more clearly illustrate the technical solutions of this application and are therefore only examples and are not intended to limit the scope of protection of this application.

[0053] References to "embodiments" herein mean that the specific features, structures, or characteristics described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the word "embodiment" in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit its independence or relevance to other embodiments. In principle, in this application, as long as there are no technical contradictions or conflicts, the various technical features mentioned in the embodiments can be combined in any manner to form a corresponding implementable technical solution.

[0054] Unless otherwise defined, the technical terms used herein have the same meanings as those generally understood by those skilled in the art to which this application belongs; the use of relevant terms herein is only for describing specific embodiments and is not intended to limit this application.

[0055] In the description of this application, the term "and / or" is used to describe a logical relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A exists, B exists, and both A and B exist. In addition, the character " / " in this document generally indicates that the objects before and after are in a logical "or" relationship.

[0056] In this application, terms such as "first" and "second" are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual quantity, priority or sequence relationship between these entities or operations.

[0057] Without further limitations, in this application, the words "include", "comprise", "have" or other similar expressions used in sentences are intended to cover non-exclusive inclusion. These expressions do not exclude the presence of additional elements in the process, method or product that includes the elements, so that the process, method or product that includes a series of elements may include not only those limited elements, but also other elements that are not explicitly listed, or also include elements that are inherent to such process, method or product.

[0058] Consistent with the understanding in the Examination Guidelines, in this application, expressions such as "greater than," "less than," and "exceed" are understood to exclude the number itself; expressions such as "above," "below," and "within" are understood to include the number itself. Furthermore, in the description of the embodiments of this application, "multiple" means more than two (including two), and similar expressions related to "multiple" are also understood in this manner, such as "multiple groups," "multiple times," etc., unless otherwise specifically defined.

[0059] like Figure 1 As shown, in a first aspect, the present invention provides a data self-encryption device 10, which includes a first storage unit 105, a second storage unit 102, an encryption and decryption module 101, a key processing module 103 and a key generation module 104; the second storage unit 102 includes a data storage area 1021 and a key storage area 1022;

[0060] The key generation module 104 is used to generate first key information and store the first key information in the first storage unit 105;

[0061] The key processing module 103 is used to obtain initial key information, encrypt the initial key information using the first key information to obtain second key information, and store the second key information in the key storage area 1022;

[0062] After receiving the data reading instruction from the host end 20, the key processing module 103 is used to obtain the second key information from the key storage area 1022, and use the first key information to decrypt the second key information to obtain the initial key information; the encryption and decryption module 101 is used to obtain the encrypted data to be read from the data storage area 1021 and obtain the initial key information from the key processing module 103, and use the initial key information to decrypt the encrypted data to be read according to the selected encryption and decryption algorithm and then output it to the host end 20.

[0063] In this embodiment, the first storage unit is a volatile memory. In this way, when the first storage unit is powered off or the host is shut down, the first key information stored in the first storage unit will also disappear, effectively improving data security. The volatile memory can be a DRAM cache unit, an SRAM cache unit, etc. Preferably, the first storage unit is an SRAM (Static Random-Access Memory). The second storage unit is a flash memory unit, which is also called a flash memory. It is a form of electronically erasable programmable read-only memory that allows it to be erased or written multiple times during operation. By setting the second storage unit as a read-only memory, the security of the data in the data storage area can be guaranteed.

[0064] In this embodiment, the second key information refers to the encrypted key information, the initial key information is the original key, i.e., the key used to encrypt or decrypt data, and the first key information refers to the key of the key, i.e., the key required to encrypt the initial key information. Preferably, the first key information, the second key information, and the initial key information are stored in different storage units, which can effectively increase the difficulty of deciphering the key and improve data security.

[0065] In this embodiment, the host 20 is a computer device, including but not limited to a personal computer, a server, a general-purpose computer, a dedicated computer, a network device, an embedded device, a programmable device, a smart mobile terminal, a smart home device, a wearable smart device, an in-vehicle smart device, etc. The data self-encryption device 10 can be placed within the host 20 as part of the host 20, or it can be independently communicatively connected to the host 20.

[0066] When the data self-encryption device 10 receives a data read instruction from the host 20, the key processing module 103 obtains the second key information from the key storage area 1022 and decrypts the second key information using the first key information to obtain the initial key information. The encryption / decryption module 101 obtains the encrypted data to be read from the data storage area 1021 and the initial key information from the key processing module 103. Based on the selected encryption / decryption algorithm, the initial key information is used to decrypt the encrypted data to be read and then outputs it to the host 20. Because the current user's read permission is authenticated using the key information before data is read, and the first key information, second key information, and initial key information used in the authentication process are always transmitted within the data self-encryption device 10, the security of data reading can be effectively improved.

[0067] In some embodiments, after receiving a data write instruction from the host end 20, the key processing module 103 is used to obtain the second key information from the key storage area 1022, and use the first key information to decrypt the second key information to obtain the initial key information; the encryption and decryption module 101 is used to obtain the plaintext data to be written from the host end 20 and the initial key information from the key processing module, and use the initial key information to encrypt the plaintext data to be written according to the selected encryption and decryption algorithm and then store it in the data storage area 1021.

[0068] In short, whether writing or reading data, key authentication is required before the corresponding operation can be executed. Key authentication can be triggered after the user's identity information is authenticated. User identity information can include facial information, fingerprint information, voiceprint information, etc. Data written to data storage area 1021 or data to be read from data storage area 1021 is always stored in an encrypted form, effectively ensuring the security of data storage.

[0069] like Figure 1 As shown, in some embodiments, the key generation module 104 includes a hash operation module 1041. The hash operation module 1041 is used to obtain user authentication information and / or device identification information, perform a hash operation on the user authentication information and / or device identification information to obtain first key information, and store the first key information in the first storage unit 105. User authentication information refers to identity information preset by the user for data reading and writing authentication, such as facial information, fingerprint information, text password, etc. Device identification information refers to identification information corresponding to the current data self-encryption device 10, which can be a combination of characters, text, numbers, etc., for example, a string of characters, which is usually set by the manufacturer before shipment.

[0070] The hash operation can be completed by a hash function, which can be MD4, MD5, SHS, etc. The calculation principle of the hash value is a cumulative block operation (any large data can be divided into multiple small blocks of data to perform the operation), so each operation requires a hash initial value and the data to be operated. The hash initial value can be set to zero when the small block operation is performed for the first time. After the first operation is completed, the obtained hash value is iteratively updated as the hash initial value for the second small block of data to perform the operation, and then the operation is performed with the second small block of data to be operated to obtain a new hash value, and so on until the end. The original application information is used as the data to be operated. After the hash operation, a digest value of a specific length (such as 256 bits) can be obtained, which is the first key information.

[0071] The hash operation module 1041 obtains the first key information by performing a hash operation on the user authentication information and / or the device identification information, thereby ensuring the uniqueness of the first key information and thereby improving the security of data encryption and decryption.

[0072] In some embodiments, the device also includes a random number generator 106. Performing a hash operation on the user authentication information and / or device identification information to obtain the first key information includes: a hash operation module is used to obtain at least one random number generated by the random number generator, and performing a hash operation on the at least one random number, the user authentication information and the device identification information to generate the first key information. In actual application, the number of data storage areas 1021 and key storage areas 1022 can be multiple. In order to improve the security of data in different data storage areas 1021, it is necessary to set the encryption keys in different data storage areas 1021 to be different. In order to implement this solution, the present application introduces a random number generator 106 in the data self-encryption device 10. For the first key information corresponding to different data storage areas 1021, a random number randomly generated by the random number generator 106 is introduced to participate in the hash calculation, thereby effectively ensuring that the encryption keys stored in different data partitions are different, further improving the security of the data partitions.

[0073] Preferably, different security levels can be set for different data storage areas 1021. The higher the security level, the more random numbers are involved in generating the first key information. That is, there is a mapping relationship between the number of random numbers used to generate the first key information and the security level of the data storage area to meet actual application requirements.

[0074] like Figure 1 As shown, in some embodiments, the device further includes an OTP storage unit 108 for storing chip fingerprint information; the key generation module 104 further includes a logic operation module 1042. The hash operation module 1041 is configured to perform a hash operation on user authentication information and / or device identification information to obtain a first hash operation result; the logic operation module 1042 is configured to obtain the chip fingerprint information from the OTP storage unit and perform a preset logic operation on the first hash operation result and the chip fingerprint information to obtain the first key information. The chip fingerprint information refers to a string of characters stored in the OTP storage unit and generated by a true random number generator when the chip leaves the factory or is first used. Preferably, the chip fingerprint information and the first hash operation result can have the same number of bits. If they differ, the high or low bits of one of them can be padded with zeros. Logical operations include AND, OR, NAND, and NOR, etc. By incorporating the chip fingerprint information into the hash operation to generate the first key information, the first key information is made more unique. By storing the chip fingerprint information in the OTP storage unit (i.e., a one-time programmable unit), tampering with the chip fingerprint information can be effectively prevented.

[0075] In some embodiments, the device further includes a random number generator 106 and a register 107. Upon receiving an instruction to create an encrypted partition, the random number generator 106 is configured to generate a random number and store the generated random number in the register 107; the initial key information is the randomly generated random number. The encrypted partition refers to the data storage area 1021 described above. During the creation of the data storage area, a unique key must be configured for reading and writing data in each data storage area 1021. This key is generated by a random number generator, ensuring the randomness of the key and improving data security.

[0076] In some embodiments, the encryption / decryption module 101 stores at least one encryption / decryption algorithm, including the SM4 decryption algorithm; the encryption / decryption module 101 is used to divide the encrypted data to be read into several data blocks, and use the SM4 decryption algorithm to perform decryption operations on each data block separately.

[0077] Typically, the Advanced Encryption Standard (AES) is used as a cryptographic algorithm. AES uses a key to encrypt and decrypt information, using the same key for both encryption and decryption. The encryption and decryption processes exhibit a certain degree of symmetry, making AES a symmetric-key algorithm in cryptography. AES's internal structure consists of multiple layers, each of which operates on the entire 16-byte processing block, looping through multiple rounds. The encryption algorithm involves four operations: byte substitution (SubBytes), row shift (ShiftRows), column mixing (MixColumns), and round key addition (AddRoundKey).

[0078] The characteristics of the SM4 encryption and decryption algorithm and the AES algorithm are compared in Table 1 below:

[0079]

[0080] Table 1

[0081] In this embodiment, the data self-encryption device is an NVMe solid-state controller chip. By introducing national cryptographic algorithm-related technologies and standards into the NVMe solid-state controller chip, that is, supporting the GM / T 0002-2012 "SM4 Block Cipher Algorithm" approved by the State Cryptography Administration, the overall security of the data is guaranteed.

[0082] The encryption and decryption module is an SM4 encryption and decryption module. The module is divided into independently operating encryption and decryption channels, which share a key expansion module. When data is written or read into this module, a corresponding encryption or decryption command request arrives. The encryption / decryption command dispatch module then requests a key expansion operation from the key expansion module and passes it the key index information. The key expansion module then retrieves the key from the symmetric key storage SRAM based on the key index information. After key expansion is complete, the encryption / decryption command dispatch module activates the corresponding SM4 encryption / decryption core group. The SM4 algorithm divides plaintext user data into multiple small bit blocks, each of which undergoes independent SM4 encryption or decryption operations.

[0083] The SM4 encryption and decryption module also offers a self-test mode, which stress-tests the module using random data and configurations. The output of the encryption path is directly fed to the decryption path for decryption. The original plaintext is then compared to the decrypted plaintext at both the encryption and decryption paths. This hardware-level self-test ensures that data can be correctly encrypted and recovered at high speeds. If any data comparison errors are detected, the module reports the error to the software for further processing.

[0084] The device of the present invention closely combines national secret algorithms and high-speed data storage applications, and is based on the underlying PCIe logical interface and NVMe logical interface protocols. It can provide users with flexible and efficient permission management and partition encryption functions, and has the advantages of high bandwidth and low latency. The encryption and decryption of user data is based on the SM4 block cipher algorithm.

[0085] At the same time, in order to take into account both security and flexibility, and not affect the high-speed and low-latency characteristics of the SSD solid-state hard drive controller, the present invention is based on the fact that the encrypted solid-state storage controller chip contains hardware modules such as SM4 block encryption and decryption modules, which can be coordinated with the firmware code to ensure efficient processing of functions such as data encryption and decryption.

[0086] like Figure 5 As shown, in a second aspect, the present invention further provides a data self-encryption method, which is applied to the data self-encryption device as in the first aspect of the present invention;

[0087] The method comprises the following steps:

[0088] First, in step S501, the key generation module generates first key information and stores the first key information in a first storage unit;

[0089] Then, step S502 is entered where the key processing module obtains initial key information, encrypts the initial key information using the first key information to obtain second key information, and stores the second key information in the key storage area;

[0090] Then, step S503 is entered. When the data write instruction from the host is received, the key processing module obtains the second key information from the key storage area, decrypts the second key information using the first key information, and obtains the initial key information.

[0091] Then enter step S504, the encryption and decryption module obtains the plaintext data to be written from the host end and obtains the initial key information from the key processing module, and uses the initial key information to encrypt the plaintext data to be written according to the selected encryption and decryption algorithm and stores it in the data storage area.

[0092] According to the above method, when the data self-encryption device receives a data read instruction from the host, the key processing module obtains the second key information from the key storage area and decrypts the second key information using the first key information to obtain the initial key information. The encryption / decryption module obtains the encrypted data to be read from the data storage area and the initial key information from the key processing module, decrypts the encrypted data to be read using the initial key information according to the selected encryption / decryption algorithm, and then outputs the decrypted data to the host. Because the current user's read permission is authenticated using the key information before data is read, and the first key information, second key information, and initial key information used in the authentication process are always transmitted within the data self-encryption device, the security of data reading can be effectively improved.

[0093] like Figure 6 As shown, in some embodiments, the method further includes the following steps:

[0094] First, in step S601, upon receiving a data read instruction from the host, the key processing module obtains the second key information from the key storage area, decrypts the second key information using the first key information, and obtains the initial key information.

[0095] Then enter step S602, the encryption and decryption module obtains the encrypted data to be read from the data storage area and the initial key information from the key processing module, decrypts the encrypted data to be read using the initial key information according to the selected encryption and decryption algorithm, and outputs it to the host end.

[0096] In short, whether writing or reading data, key authentication is required before the corresponding operation can be executed. Key authentication can be triggered after the user's identity information is authenticated. User identity information can include facial information, fingerprint information, voiceprint information, etc. Data written to the data storage area or data to be read from the data storage area is always stored in an encrypted form, effectively ensuring the security of data storage.

[0097] like Figure 2-Figure 4 As shown, the key (Media Encryption Key, MEK data encryption key) of the present invention is also stored in an encrypted form in the SRB area of ​​​​NAND, and is always only used in the hard disk and cannot be directly read by the external operating system. Another set of passwords called Key Encryption Key (KEK) is used to encrypt MEK, which is generated by processing the password entered by the user (user authentication). When the electronic device is turned on, the data encryption key MEK is decrypted by KEK to obtain the real data encryption key MEK to complete the unlocking of the hard disk. MEK is only stored in volatile memory (such as DRAM cache, SRAM cache). Once the electronic device is turned off or the hard disk is powered off, MEK will disappear. Therefore, the encrypted hard disk of the present invention will re-enter the locked state when it is turned off. The specific implementation is as follows:

[0098] like Figure 2 FIG. 1 is a schematic diagram of a process for generating an encryption key (i.e., first key information, KEK) corresponding to a key. The specific steps are as follows:

[0099] 1. Host data is prepared in SRAM;

[0100] 2. Use the SM3 hash engine (i.e., hash operation module) to calculate the KEK. The specific calculation formula is: KEK = Hash (256-bit random number Nonce + Hash (user PIN) + user ID + chip ID + "KEK") ^ chip fingerprint. The chip fingerprint is stored in the OTP storage unit and is generated by a true random number generator when the chip leaves the factory or is used for the first time.

[0101] 3. After the user authentication is successful (i.e. the received user identity information is authenticated), the (256-bit Nonce + User ID + Chip ID) combination will be stored in the SRB area of ​​the flash memory;

[0102] 4. KEK is temporarily stored in SRAM for the next step.

[0103] like Figure 3 FIG. 1 is a schematic diagram of the MEK (i.e., second key information) generation process, and the specific steps are as follows:

[0104] 1. When an encrypted partition is created, a true random number generator generates a 256-bit random number for use as Flat-MEK;

[0105] 2. The MEK is stored in a 256-bit register within the security subsystem;

[0106] 3. Use the key wrapping / unwrapping hardware module (i.e., key processing module, KeyWrap / Unwrap) to encrypt the flat-MEK based on the KEK to obtain the encrypted MEK;

[0107] 4. Store the MEK ciphertext (Wrapped-MEK) in the SRB of the flash memory to facilitate MEK recovery the next time the power is turned on.

[0108] like Figure 4 FIG. 1 is a schematic diagram showing the principle of the data encryption and decryption process involved in one embodiment of the present invention, that is, the process of implementing data encryption by configuring the key MEK. The specific steps are as follows:

[0109] 1. Read wrapped-MEK from SRB and store it in SRAM;

[0110] 2. Call the key wrapping / unwrapping hardware module (i.e., the key processing module, KeyWrap / Unwrap) and unwrap the wrapped-MEK based on the KEK to obtain the flat-MEK (i.e., the initial key information, the KEK is generated in real time when the user passes authentication);

[0111] 3. The hardware can automatically transfer flat-MEK to MEK-SRAM;

[0112] 4. Start the SM4 block encryption module and configure the encryption and decryption mode. The SM4 block encryption module will use the key in MEK-SRAM to start encrypting and decrypting user data.

[0113] The present invention provides a data self-encryption method and device, comprising a first storage unit, a second storage unit, an encryption / decryption module, a key processing module, and a key generation module; the second storage unit comprises a data storage area and a key storage area. Upon receiving a data read instruction from a host, the key processing module retrieves second key information from the key storage area and decrypts the second key information using the first key information to obtain initial key information; the encryption / decryption module is configured to retrieve the encrypted data to be read from the data storage area and the initial key information from the key processing module, and decrypt the encrypted data to be read using the initial key information according to a selected encryption / decryption algorithm, and then output the decrypted data to the host. Through the above scheme, data in the data storage area is always stored in an encrypted manner. When data needs to be read, it needs to be decrypted using multiple layers of keys. The entire decryption process is performed internally by the device, effectively improving the security of data storage.

[0114] Those skilled in the art will appreciate that the above embodiments can be provided as methods, apparatuses, or computer program products. These embodiments can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware. All or part of the steps in the methods involved in the above embodiments can be completed by a program instructing the relevant hardware. The program can be stored in a computer-readable storage medium for executing all or part of the steps in the methods of the above embodiments.

[0115] The above embodiments are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as the combination of the processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a computer device to generate a machine, so that the instructions executed by the processor of the computer device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0116] These computer program instructions can also be stored in a computer device readable memory that can guide a computer device to work in a specific manner, so that the instructions stored in the computer device readable memory produce a product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0117] These computer program instructions can also be loaded onto a computer device so that a series of operating steps are executed on the computer device to produce a computer-implemented process, whereby the instructions executed on the computer device provide for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0118] Although the above embodiments have been described, those skilled in the art may make additional changes and modifications to these embodiments once they know the basic creative concepts. Therefore, the above are merely embodiments of the present invention and do not limit the scope of patent protection of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the scope of patent protection of the present invention.

Claims

1. A data self-encryption device, characterized in that: The device includes a first storage unit, a second storage unit, an encryption and decryption module, a key processing module, a random number generator and a key generation module; the second storage unit includes a data storage area and a key storage area, the first storage unit is an SRAM, and the second storage unit is a flash memory unit; The key generation module includes a hash operation module, the hash operation module being configured to obtain user authentication information, device identification information, and at least one random number generated by the random number generator, perform a hash operation on the at least one random number, the user authentication information, and the device identification information to generate first key information, and store the first key information in a first storage unit; The key processing module is used to obtain initial key information, encrypt the initial key information using the first key information to obtain second key information, and store the second key information in the key storage area; Upon receiving a data read instruction from the host, the key processing module is configured to obtain second key information from the key storage area, decrypt the second key information using the first key information, and obtain initial key information; the encryption / decryption module is configured to obtain the encrypted data to be read from the data storage area and the initial key information from the key processing module, decrypt the encrypted data to be read using the initial key information according to a selected encryption / decryption algorithm, and then output the decrypted data to the host; There are multiple data storage areas and key storage areas. Different data storage areas correspond to different security levels. The higher the security level of a data storage area, the more random numbers are involved in generating the first key information.

2. The data self-encryption device according to claim 1, wherein: After receiving the data write instruction from the host side, the key processing module is used to obtain the second key information from the key storage area, and use the first key information to decrypt the second key information to obtain the initial key information; the encryption and decryption module is used to obtain the plaintext data to be written from the host side and the initial key information from the key processing module, and use the initial key information to encrypt the plaintext data to be written according to the selected encryption and decryption algorithm and then store it in the data storage area.

3. The data self-encryption device according to claim 1, wherein: The device also includes an OTP storage unit, which is used to store chip fingerprint information; the key generation module also includes a logic operation module; The hash operation module is used to perform a hash operation on the user authentication information and / or the device identification information to obtain a first hash operation result; The logic operation module is used to obtain chip fingerprint information from the OTP storage unit, perform a preset logic operation on the first hash operation result and the chip fingerprint information, and obtain the first key information.

4. The data self-encryption device according to claim 1, wherein: The device also includes a random number generator and a register; When receiving an encrypted partition creation instruction, the random number generator is used to randomly generate a random number and store the generated random number in a register; The initial key information is the random number generated randomly.

5. The data self-encryption device according to claim 1, wherein: The encryption and decryption module stores at least one encryption and decryption algorithm, and the encryption and decryption algorithm includes an SM4 decryption algorithm; The encryption and decryption module is used to divide the encrypted data to be read into several data blocks, and use the SM4 decryption algorithm to perform a decryption operation on each data block separately.

6. A data self-encryption method, characterized in that: The method is applied to the data self-encryption device according to any one of claims 1 to 5; The method comprises the following steps: The key generation module obtains user authentication information, device identification information, and at least one random number generated by a random number generator, performs a hash operation on the at least one random number, the user authentication information, and the device identification information to generate the first key information, and stores the first key information in a first storage unit; The key processing module obtains initial key information, encrypts the initial key information using the first key information to obtain second key information, and stores the second key information in the key storage area; After receiving the data write instruction from the host, the key processing module obtains the second key information from the key storage area, and decrypts the second key information using the first key information to obtain the initial key information; The encryption and decryption module obtains the plaintext data to be written from the host end and the initial key information from the key processing module, encrypts the plaintext data to be written using the initial key information according to the selected encryption and decryption algorithm, and then stores the encrypted data in the data storage area; There are multiple data storage areas and key storage areas. Different data storage areas correspond to different security levels. The higher the security level of a data storage area, the more random numbers are involved in generating the first key information.

7. The data self-encryption method according to claim 6, wherein: The method further comprises the following steps: After receiving the data reading instruction from the host side, the key processing module obtains the second key information from the key storage area, uses the first key information to decrypt the second key information, and obtains the initial key information; the encryption and decryption module obtains the encrypted data to be read from the data storage area and the initial key information from the key processing module, uses the initial key information to decrypt the encrypted data to be read according to the selected encryption and decryption algorithm, and outputs it to the host side.

Citation Information

Patent Citations

  • Encryption solid-state storage disc

    CN204215405U