A control component
By generating encrypted values for data keys through hash operations and multi-level encryption processes, the firmware is kept away from the keys, thus solving the problem of storage device control components accessing sensitive user information and achieving information security protection for storage devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING STARBLAZE TECH CO LTD
- Filing Date
- 2018-10-30
- Publication Date
- 2026-05-29
AI Technical Summary
The control components of existing storage devices may have access to encrypted or decrypted data keys when running software, which could lead to storage device vendors having access to users' sensitive information and pose a risk to information security.
A key management method is adopted, which generates a user key hash value through hash operation, and uses the hash value to decrypt the encrypted value of the data key, encrypting or decrypting user data. This ensures that the firmware does not directly access the encryption key and data key. The user key hash value is encrypted using a one-time programmable random number, and the encrypted value of the data key is generated through a multi-level hash and encryption process and stored in the storage medium.
It achieves hardware-level protection for data keys, reduces the risk of key leakage, and improves the information security of storage devices.
Smart Images

Figure CN115051806B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information security, and more particularly to a control component for encrypting or decrypting data in a storage device. Background Technology
[0002] Figure 1 A block diagram of the storage device is shown. Storage device 102 is coupled to a host to provide storage capabilities to the host. The host and solid-state storage device 102 can be coupled in various ways, including but not limited to connections via SATA (Serial Advanced Technology Attachment), SCSI (Small Computer System Interface), SAS (Serial Attached SCSI), IDE (Integrated Drive Electronics), USB (Universal Serial Bus), PCIe (Peripheral Component Interconnect Express), NVMe (NVM Express), Ethernet, Fibre Channel, and wireless communication networks. The host can be an information processing device capable of communicating with the storage device via the above methods, such as a personal computer, tablet computer, server, laptop computer, network switch, router, cellular phone, or personal digital assistant. Storage device 102 includes interface 103, control unit 104, one or more NVM chips 105, and DRAM (Dynamic Random Access Memory) 110.
[0003] NAND flash memory, phase change memory, FeRAM (Ferroelectric RAM), MRAM (Magnetic Random Access Memory), RRAM (Resistive Random Access Memory), XPoint memory, etc. are common NVMs.
[0004] Interface 103 is compatible with exchanging data with the host via methods such as SATA, IDE, USB, PCIe, NVMe, SAS, Ethernet, and Fibre Channel.
[0005] The control unit 104 is used to control data transfer between the interface 103, the NVM chip 105, and the DRAM 110. It is also used for memory management, host logical address to flash physical address mapping, erase leveling, bad block management, etc. The control unit 104 can be implemented in various ways, including software, hardware, firmware, or a combination thereof. For example, the control unit 104 can be in the form of an FPGA (Field-programmable gate array), an ASIC (Application Specific Integrated Circuit), or a combination thereof. The control unit 104 may also include a processor or controller, in which software executes to manipulate the hardware of the control unit 104 to process I / O (Input / Output) commands. The control unit 104 can also be coupled to the DRAM 110 and can access the data in the DRAM 110. FTL tables and / or cached I / O command data can be stored in the DRAM.
[0006] The control unit 104 includes a flash interface controller (or media interface controller, flash channel controller), which is coupled to the NVM chip 105 and issues commands to the NVM chip 105 in accordance with the interface protocol of the NVM chip 105 to operate the NVM chip 105, and receives the command execution results output from the NVM chip 105. Known NVM chip interface protocols include "Toggle", "ONFI", etc.
[0007] The software running on the control components of existing storage devices has access to the data keys used for encryption or decryption, which gives storage device vendors access to users' sensitive information, posing a threat to information security. Summary of the Invention
[0008] According to a first aspect of this application, a first key management method according to the first aspect of this application is provided, wherein an input user key is received, a hash operation is performed on the user key to obtain a user key hash value; an encrypted value of a data key is read from a storage medium, the encrypted value of the data key is decrypted using the user key hash value to obtain a data key, and the data key is used to encrypt or decrypt user data.
[0009] According to the first key management method of the first aspect of this application, a second key management method according to the first aspect of this application is provided, wherein the user key is sent by the host to the storage device through a host interface.
[0010] According to the first or second key management method of the first aspect of this application, a third key management method according to the first aspect of this application is provided, wherein the encrypted value of the data key is stored in a storage medium inside or outside the control component.
[0011] According to the first to third key management methods of the first aspect of this application, a fourth key management method according to the first aspect of this application is provided, wherein the user data is written to the storage device by the host through the host interface, the user data is encrypted using the data key, and the encrypted data is written to the NVM chip.
[0012] According to the first to third key management methods of the first aspect of this application, a fifth key management method according to the first aspect of this application is provided, wherein, in response to a host reading data from a storage device, the encrypted data read from the NVM chip is decrypted using the data key, and the decrypted data is transmitted to the host.
[0013] According to the first to fifth key management methods of the first aspect of this application, a sixth key management method according to the first aspect of this application is provided, wherein the firmware controls the encryption process, but the firmware does not access the encryption key and the data key.
[0014] According to the first to sixth key management methods of the first aspect of this application, a seventh key management method according to the first aspect of this application is provided, wherein a user key hash value is encrypted using a generated one-time programmable random number to obtain a user encryption key, and the user encryption key is written into a storage medium.
[0015] According to the seventh key management method of the first aspect of this application, an eighth key management method according to the first aspect of this application is provided, wherein, before reading the encrypted value of the data key from the storage medium, the method further includes: encrypting the hash value of the user key using first data obtained from OTP to obtain a first user encryption key, reading the user encryption key from the storage medium, and if the first user encryption key is the same as the read user encryption key, then reading the encrypted value of the data key from the storage medium.
[0016] According to the first to eighth key management methods of the first aspect of this application, a ninth key management method according to the first aspect of this application is provided, wherein a first random number is generated; and a hash operation is performed on the first random number to obtain the data key.
[0017] According to the ninth key management method of the first aspect of this application, a tenth key management method according to the first aspect of this application is provided, wherein the data key is encrypted using a user key hash value to obtain an encrypted value of the data key; and the encrypted value of the data key is written into a storage medium.
[0018] According to the first to eighth key management methods of the first aspect of the present application, an eleventh key management method according to the first aspect of the present application is provided. For each natural number i from 1 to N, the following operations are performed: generating the i-th random number, and performing a hash operation on the i-th random number to obtain the i-th level data key; when 1 < i <= N, encrypting the i-th level data key with the (i - 1)-th level data key to obtain the encrypted value of the i-th level data key; when i = 1, encrypting the i-th level data key with the user key hash value to obtain the encrypted value of the i-th level data key; writing the encrypted value of the i-th level data key into the storage medium; where the N-th level data key is used as the data key, and N is a natural number greater than 1.
[0019] According to the eleventh key management method of the first aspect of the present application, a twelfth key management method according to the first aspect of the present application is provided. Reading the encrypted value of the first-level data key from the storage medium, decrypting the encrypted value of the first-level data key with the user key hash value to obtain the first-level data key; successively using the (i - 1)-th level data key as the decryption key, reading the encrypted value of the i-th level data key from the storage medium, and decrypting the encrypted value of the i-th level data key to obtain the i-th level data key; where 1 < i <= N and N >= 2; using the N-th level data key to encrypt or decrypt user data.
[0020] According to the first to eighth key management methods of the first aspect of the present application, a thirteenth key management method according to the first aspect of the present application is provided. Generating M random numbers; performing a hash operation on each random number to obtain M data keys; where M is a natural number greater than 1.
[0021] According to the thirteenth key management method of the first aspect of the present application, a fourteenth key management method according to the first aspect of the present application is provided. Using the user key hash value to encrypt each of the M data keys respectively to obtain the encrypted values of the M data keys; writing the encrypted values of the M data keys into the storage medium.
[0022] According to the thirteenth key management method of the first aspect of the present application, a fifteenth key management method according to the first aspect of the present application is provided. Selecting and reading one of the encrypted values of the M data keys from the storage medium, decrypting the encrypted value of the data key with the user key hash value to obtain the data key, and using the data key to encrypt or decrypt user data.
[0023] According to the thirteenth key management method of the first aspect of this application, a sixteenth key management method according to the first aspect of this application is provided, wherein the encrypted values of M data keys are obtained from a storage medium, the encrypted values of the M data keys are decrypted using the user key hash value to obtain M data keys, and the user data is encrypted or decrypted using the M data keys.
[0024] According to the first to sixteenth key management methods of the first aspect of this application, a seventeenth key management method according to the first aspect of this application is provided, wherein each user key corresponds to a user encryption key stored in a storage medium, and an encryption value corresponding to one or more data keys stored in the storage medium.
[0025] According to the first to seventeenth key management methods of the first aspect of this application, an eighteenth key management method according to the first aspect of this application is provided, wherein the generated random number, user key hash value, and N-level data key are accessed by enabling the corresponding random number enable bit.
[0026] According to a second aspect of this application, a first key management system according to the second aspect of this application is provided, comprising: a user key generation subsystem and a processing subsystem; the user key generation subsystem performs a hash operation on an input user key to obtain a user key hash value; the processing subsystem reads an encrypted value of a data key from a storage medium, decrypts the encrypted value of the data key using the user key hash value to obtain a data key, and uses the data key to encrypt or decrypt user data.
[0027] According to the first key management system of the second aspect of this application, a second key management system according to the second aspect of this application is provided, wherein a data key generation subsystem generates a data key based on a user key hash value and stores the encrypted value obtained by encrypting the data key in an off-chip storage medium.
[0028] According to the second key management system of the second aspect of this application, a third key management system according to the second aspect of this application is provided, wherein the data key generation subsystem includes a random number generation module and a hash operation module; the random number generation module generates M random numbers; the hash operation module performs a hash operation on each of the M random numbers to obtain M data keys.
[0029] According to the third key management system of the second aspect of this application, a fourth key management system according to the second aspect of this application is provided, wherein the data key generation subsystem further includes an encryption module; the encryption module encrypts each of the M data keys using a user key hash value to obtain an encrypted value for the M data keys; wherein the encrypted value of the M data keys is written to a storage medium.
[0030] According to the fourth key management system of the second aspect of the present application, a fifth key management system according to the second aspect of the present application is provided. Among them, the user key generation subsystem further includes an OTP and a first encryption module; the OTP is used to provide first data; the first encryption module is used to encrypt according to the first data and the user key hash value to obtain a user encryption key.
[0031] According to the fifth key management system of the second aspect of the present application, a sixth key management system according to the second aspect of the present application is provided. Among them, the first encryption module encrypts the user key hash value using the first data to obtain a user encryption key; or encrypts the first data using the user key hash value to obtain a user encryption key.
[0032] According to the first to sixth key management systems of the second aspect of the present application, a seventh key management system according to the second aspect of the present application is provided. Among them, the user encryption key is written into a storage medium.
[0033] According to the first to seventh key management systems of the second aspect of the present application, an eighth key management system according to the second aspect of the present application is provided. Among them, the data key generation subsystem includes a first random number generation module and a first hash operation module; the first random number generation module generates a first random number; the first hash operation module performs a hash operation on the first random number to obtain the data key.
[0034] According to the eighth key management system of the second aspect of the present application, a ninth key management system according to the second aspect of the present application is provided. Among them, the data key generation subsystem further includes a first encryption module and a first storage module; the first encryption module encrypts the data key using the user key hash value to obtain an encrypted value of the data key; the first storage module writes the encrypted value of the data key into a storage medium.
[0035] According to the first to ninth key management systems of the second aspect of the present application, a tenth key management system according to the second aspect of the present application is provided. Among them, the data key generation subsystem includes N random number generation modules, N hash operation modules and N encryption modules; the i-th random number generation module generates the i-th random number; the i-th hash operation module performs a hash operation on the i-th random number to obtain the i-th level data key; the i-th encryption module, when 1 < i <= N, encrypts the i-th level data key using the (i - 1)-th level data key to obtain an encrypted value of the i-th level data key; when i = 1, encrypts the i-th level data key using the user key hash value to obtain an encrypted value of the i-th level data key; where the encrypted value of the i-th level data key is recorded in a storage medium; where the N-th level data key is used as the data key, and N is a natural number greater than 1.
[0036] According to the tenth key management system of the second aspect of this application, an eleventh key management system according to the second aspect of this application is provided, wherein a processing subsystem reads the encrypted value of a first-level data key from a storage medium, decrypts the encrypted value of the first-level data key using the user key hash value, and obtains a first-level data key; sequentially, the (i-1)th-level data key is used as the decryption key to decrypt the encrypted value of the i-th-level data key read from the storage medium, and obtains an i-th-level data key; wherein 1 <i<=N,N> =2; Use the Nth level data key to encrypt or decrypt user data.
[0037] According to the first to eighth key management systems of the second aspect of this application, a twelfth key management system according to the second aspect of this application is provided, wherein the data key generation subsystem includes M random number generation modules and M hash operation modules; the i-th random number generation module of the M random number generation modules generates the i-th random number; the i-th hash operation module of the M hash operation modules performs a hash operation on the i-th random number to obtain the i-th data key.
[0038] According to the twelfth key management system of the second aspect of this application, a thirteenth key management system according to the second aspect of this application is provided, wherein the data key generation subsystem further includes M encryption modules and M storage modules; the i-th encryption module of the M encryption modules encrypts the i-th data key using the user key hash value to obtain the encrypted value of the i-th data key; wherein the encrypted values of the M data keys are written to the storage medium.
[0039] According to the thirteenth key management system of the second aspect of this application, a fourteenth key management system according to the second aspect of this application is provided, wherein the processing subsystem is specifically used to select one from the encrypted values of M data keys in the storage medium, read it in, decrypt the encrypted value of the data key using the user key hash value to obtain a data key, and use the data key to encrypt or decrypt user data.
[0040] The beneficial effects achieved by this application are as follows: By using the key management method and system provided in this application, the software running on the storage device cannot directly access the key used to encrypt and decrypt data, thereby achieving hardware-level protection of the key and reducing the risk of leakage. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0042] Figure 1 A block diagram of the storage device is shown;
[0043] Figure 2 A schematic diagram of the key management system of this application is shown;
[0044] Figure 3 A schematic diagram illustrating the generation of user encryption keys by the key management unit;
[0045] Figure 4 Flowchart of the method for generating user encryption keys;
[0046] Figure 5 A diagram illustrating how the key management unit verifies a user key using the user's encryption key;
[0047] Figure 6 Flowchart of the method for verifying a user key using a user encryption key;
[0048] Figure 7 This is a diagram illustrating how the key management unit generates a data key based on the user's encryption key.
[0049] Figure 8 A flowchart illustrating the method for generating a data key based on a user's encryption key;
[0050] Figure 9 This is a diagram illustrating another method of generating a data key based on a user's encryption key.
[0051] Figure 10 A flowchart illustrating the method for generating a data key based on a user's encryption key;
[0052] Figure 11 This is a diagram illustrating another method of generating a data key based on a user's encryption key.
[0053] Figure 12 A flowchart illustrating the method for generating a data key based on a user's encryption key;
[0054] Figure 13 This is a schematic diagram illustrating the re-initialization of the primary key after the chip is powered on or reset.
[0055] Figure 14 Flowchart of the method for encrypting data using the set primary data key;
[0056] Figure 15 This is a schematic diagram illustrating the use of M keys to encrypt data after the chip is powered on or reset, according to another embodiment of this application.
[0057] Figure 16 A flowchart illustrating the method for encrypting data using the set M data keys;
[0058] Figure 17 This is a schematic diagram illustrating the encryption of data using a set N-level key according to another embodiment of this application;
[0059] Figure 18 The flowchart illustrates the method for encrypting data using the set N-level data key. Detailed Implementation
[0060] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0061] Figure 2 This is a schematic diagram of a key management system according to an embodiment of this application.
[0062] According to an embodiment of this application, host 210 accesses the storage device through host interface 221. Control unit 220 includes command processing unit 222 and key management unit 223. Command processing unit 222 obtains and processes commands provided by host 210. Commands provided by host 210 include, for example, I / O commands and key management commands.
[0063] As an example, the key management command indicates, for example, a user key. Command processing unit 222 instructs key management unit 223 to process the user key. Key management unit 222 also stores the processed user key (referred to as the user encryption key), which the command processing unit cannot access. Again, as an example, in response to receiving an IO command, the command processing unit also instructs key management unit 222 to encrypt and / or decrypt the data accessed by the IO command. For example, for a read command, key management unit 222 decrypts the data read from the NVM chip according to the specified user encryption key and provides the decrypted data to host interface 210. For a write command, key management unit 222 encrypts the data transmitted to the storage device according to the specified user encryption key and writes the encrypted data to NVM chip 230 via media interface 224. Key management unit 222 encrypts or decrypts the data accessed by the IO command according to the instructions of command processing unit 223, while command processing unit 223 does not need to and cannot access the user encryption key.
[0064] For user keys, if it is a single user, the user key can be the user's power-on password or the password for a specific partition of the storage device; for network storage, the user key may be a password of a user transmitted over the network.
[0065] Figure 3 This is a schematic diagram illustrating how the key management unit processes user keys to generate user encryption keys.
[0066] During the key initialization phase, the storage device receives the user key in response to, for example, a key initialization command, and generates a user encryption key (C_Pin_hash) which is recorded in the storage medium. It also generates a first random number and stores it in the one-time programmable module 310.
[0067] In response to the received user key, a first random number, Data A, is generated via the random number module. Optionally, the first random number, Data A, is also written to the one-time programmable module 310 and its storage space is closed. The first random number, Data A, is one-time data; after being written to the one-time programmable module 310, it can be configured for use via the configuration register, but cannot be accessed. Optionally, multiple sets of hardware-protected random numbers may need to be generated.
[0068] The user key is provided to the hash operation module 320 to generate a corresponding user key hash value, which is temporarily stored in the chip's internal cache. A first random number, Data A, is obtained. Using the first random number Data A as the key and the user key hash value as the data to be encrypted, the encryption module 330 is invoked to generate the user encryption key (C_Pin_hash), which is then written into the storage medium 340.
[0069] Optionally, the user key hash value is used as the key, the first random number Data A is used as the data to be encrypted, and the encryption module 330 is called to generate the user encryption key (C_Pin_hash).
[0070] Throughout the process, the firmware cannot directly access the first random number and the user key hash value; it can only use these data by configuring the corresponding registers.
[0071] Figure 4 Flowchart of the method for generating user encryption keys.
[0072] Receive the user key, perform a hash operation on the user key to obtain the user key hash value (410); use the generated first random number to perform an encryption operation on the user key hash value to obtain the user encryption key (420), and store the user encryption key in the storage medium (430).
[0073] Figure 5 This diagram illustrates how the key management unit verifies a user key using the user's encryption key.
[0074] During the use of the storage device, the host identity is verified again by the user key provided by the host. According to the embodiments of this application, the storage device can only be used by the authenticated host.
[0075] After receiving the user key, the key management unit inputs it into the hash operation module 510 to generate a corresponding user key hash value, which is temporarily stored in the chip's internal cache. A first random number, Data A, is obtained from the one-time programmable module 520. Using the first random number Data A as the key and the user key hash value as the data to be encrypted, the encryption module 530 is invoked to generate a user encryption key (C_Pin_hash). For example, the encryption module 530 encrypts the user key hash value using existing encryption algorithms such as XTS-AES. The user encryption key is read from the storage medium 540, and the judgment module 550 determines whether the read user encryption key is equal to the generated user encryption key. If they are equal, the verification passes; otherwise, the verification fails.
[0076] Throughout the process, the firmware cannot directly access the first random number Data A and the user key hash value; it can only use these data by configuring the corresponding registers.
[0077] For multiple user keys: Following the above process, each user key corresponds to a user encryption key stored in the storage medium. The random numbers used to encrypt the user keys can be the same or different.
[0078] Figure 6 A flowchart illustrating the method for verifying a user key using a user encryption key.
[0079] Perform a hash operation on the user key to generate a user key hash value (610), obtain a first random number, encrypt the user key hash value using the first random number to obtain a first user encryption key (620), read the user encryption key from the storage medium (630), determine whether the first user encryption key is the same as the read user encryption key (640), if they are the same, the user key is a valid key, otherwise the user key is an invalid key.
[0080] Figure 7 This is a diagram illustrating how the key management unit generates encrypted data key values based on the user's encryption key.
[0081] After receiving the user key, the key management unit inputs the user key into the hash operation module 710 to generate the corresponding user key hash value, which is temporarily stored in the chip's internal cache. A first random number, Data A, is obtained from the one-time programmable module 720. Using the first random number Data A as the key and the user key hash value as the data to be encrypted, the encryption module 730 is invoked to generate the user encryption key C_Pin_hash, which is then written into the storage medium 740. For example, the encryption module 730 encrypts the user key hash value using existing encryption algorithms such as XTS-AES.
[0082] Optionally, to generate a data key, the user encryption key C_Pin_hash is obtained from the storage medium 740, and a first random number Data A is obtained from the one-time programmable module 720. The first random number Data A is used as the decryption key, and the user encryption key C_Pin_hash is used as the data to be decrypted. The user encryption key C_Pin_hash is decrypted using the first random number Data A to obtain the user key hash value. As an example, the user encryption key C_Pin_hash is decrypted according to an encryption algorithm of existing technologies such as XTS-AES.
[0083] The random number generation module 750 generates a second random number (TRNG_Data 1), which is input into the hash operation module 760 to generate a corresponding hash value, which is the data key. Using the user key hash value as the key and the data key as the data to be encrypted, the encryption module 770 is called to generate an encrypted data key value, which is then written to the storage medium 740. For example, the encryption module 770 encrypts the user key hash value using existing encryption algorithms such as XTS-AES.
[0084] The storage device uses a data key to encrypt the input plaintext user data using the encryption module 780 to obtain the ciphertext user data, and then stores the ciphertext user data in the storage device.
[0085] Figure 8 A flowchart illustrating the method for generating a data key based on a user's encryption key.
[0086] As an optional embodiment, the process for generating the data key is as follows: the generated second random number is hashed to obtain a hash value, and this hash value is used as the data key (810). The data key is then encrypted using the user key hash value to generate an encrypted data key value (820), and the encrypted data key value is stored in a storage medium (830).
[0087] Figure 9 This is a schematic diagram illustrating the generation of a data key encryption value based on a user encryption key according to yet another embodiment.
[0088] After receiving the user key, the key management unit inputs it into the hash operation module 910 to generate a corresponding user key hash value, which is temporarily stored in the chip's internal cache. A first random number, Data A, is obtained from the one-time programmable module 920. Using Data A as the key and the user key hash value as the data to be encrypted, the encryption module 930 is invoked to generate the user encryption key C_Pin_hash, which is then written into the storage medium 940. For example, the encryption module 930 encrypts the user key hash value using existing encryption algorithms such as XTS-AES.
[0089] Optionally, to generate a data key, the user encryption key C_Pin_hash is obtained from the storage medium 940, and a first random number Data A is obtained from the one-time programmable module 920. The first random number Data A is used as the decryption key, and the user encryption key C_Pin_hash is used as the data to be decrypted. The user encryption key C_Pin_hash is decrypted using the first random number Data A to obtain the user key hash value. As an example, the user encryption key C_Pin_hash is decrypted according to an encryption algorithm of existing technologies such as XTS-AES.
[0090] The random number generation module 950 generates M random numbers (M is a natural number). Each generated random number is input into the hash operation module 960 to generate M corresponding hash values, which are the M data keys. Using the user key hash value as the key and the M data keys as the data to be encrypted, the encryption module 970 is called to generate M encrypted data key values, which are then written into the storage medium 940.
[0091] Select one of the M data keys to encrypt the plaintext user data using the encryption module 980 to obtain the ciphertext user data, and store the ciphertext user data in the storage medium 940.
[0092] Figure 10 A flowchart illustrating the method for generating encrypted data key values based on user encryption keys.
[0093] As an optional embodiment, to generate M data keys, M random numbers are generated (1010); each random number is hashed to obtain M data keys (1020); the user key hash value is used to encrypt the M data keys respectively to obtain the encrypted values of the M data keys (1030); and the encrypted values of the M data keys are written into the storage medium (1040).
[0094] Figure 11 This is a schematic diagram illustrating the generation of a data key encryption value based on a user encryption key, as shown in another embodiment.
[0095] According to Figure 11 In one embodiment, a higher-strength data key is generated using a single user key, and an Nth-level data key encryption value is generated through an N-level encryption process, where N is a natural number greater than 1.
[0096] After receiving the user key, the key management unit inputs the user key into the hash operation module 1110 to generate the corresponding user key hash value, which is temporarily stored in the chip's internal cache. A first random number, Data A, is obtained from the one-time programmable module 1111. Using the first random number Data A as the key and the user key hash value as the data to be encrypted, the encryption module 1112 is invoked to generate the user encryption key C_Pin_hash, which is then written into the storage medium 1113. For example, the encryption module 1112 encrypts the user key hash value using existing encryption algorithms such as XTS-AES.
[0097] Optionally, to generate a data key, the user encryption key C_Pin_hash is obtained from storage medium 1113, and a first random number Data A is obtained from one-time programmable module 1111. The first random number Data A is used as the decryption key, and the user encryption key C_Pin_hash is used as the data to be decrypted. The user encryption key C_Pin_hash is decrypted using the first random number Data A to obtain the user key hash value. As an example, the user encryption key C_Pin_hash is decrypted according to an encryption algorithm of existing technology such as XTS-AES.
[0098] according to Figure 11 In this embodiment, N data keys and N encrypted data key values are generated, numbered from the first to the Nth. The Nth data key is used to encrypt plaintext user data or decrypt ciphertext user data. During the data key initialization process, N encrypted data key values are generated. After the data keys are initialized, the encrypted data key values recorded on storage medium 1113 are decrypted to obtain the Nth level data key, which is used to encrypt plaintext user data or decrypt ciphertext user data.
[0099] The i-th data key generated by the i-th level random number generation module is input into the hash operation module to generate the corresponding i-th level hash value, which serves as the i-th data key, where 1 <= i <= N. The (i-1)-th data key is then used as the key to encrypt the i-th data key, resulting in the i-th level data key encryption value, where 2 <= i <= N. For the first data key, the user key hash value is used to encrypt the first data key, resulting in the first level data key encryption value. All N data key encryption values are recorded in storage medium 1113.
[0100] The first-level random number generation module 1120 generates a first-level random number, which is input into the hash operation module 1121 to generate a corresponding first-level hash value, which serves as the first-level data key. Using the user key hash value as the key and the first-level data key as the data to be encrypted, the encryption module 1122 is called to generate the first-level data key encryption value, which is then written to the storage medium 1113.
[0101] The data key of the previous level is used as the key input for the next level encryption module.
[0102] The Nth-level random number generation module 1130 generates an Nth-level random number, which is input into the hash operation module 1131 to generate the corresponding Nth-level hash value, which serves as the Nth-level data key. Using the (N-1)th-level data key as the main key and the Nth-level data key as the data to be encrypted, the encryption module 1132 generates the Nth-level data key encryption value, which is then written into the storage medium 1113.
[0103] Figure 12 A flowchart illustrating the method for generating encrypted data key values based on user encryption keys.
[0104] For each natural number i from 1 to N, perform the following operations: generate the i-th random number (1210), and perform a hash operation on the i-th random number to obtain the i-th level data key (1220); when i>1, encrypt the i-th level data key using the (i-1)-th level data key to obtain the encrypted value of the i-th level data key (1230). When i=1, encrypt the i-th level data key using the user key hash value to obtain the encrypted value of the i-th level data key. Write the encrypted value of the i-th level data key into the storage medium (1240).
[0105] Figure 13 This is a diagram illustrating the verification of the user key and the generated data key.
[0106] After the storage device is powered on or reset, in response to a user's access request to the storage device, the user key is first verified, and the data key is obtained based on the user key, which is used to encrypt the user data plaintext or decrypt the user data ciphertext.
[0107] After receiving the user key, the key management unit inputs the user key into the hash operation module 1310 to generate the corresponding user key hash value, which is temporarily stored in the chip's internal cache. A first random number, Data A, is obtained from the one-time programmable module 1320. Using the first random number Data A as the key and the user key hash value as the data to be encrypted, the encryption module 1330 is invoked to generate the user encryption key C_Pin_hash. The user encryption key is read from the storage medium 1340, and the judgment module 1350 determines whether the read user encryption key is equal to the generated user encryption key. If they are equal, the verification passes; otherwise, the verification fails.
[0108] If the verification passes, the process of generating a data key is initiated. If the verification fails, the generation of a data key is rejected.
[0109] To generate a data key, an encrypted data key value is read from the storage medium, and the encrypted data key value is decrypted by the decryption module 1360 using the user key hash value to obtain the data key. In one example, the hash operation module 1310 performs a hash operation on the user key to obtain the user key hash value, which serves as the decryption key for the decryption module 1360. In another example, in response to the determination module 1350 indicating that the user key verification has passed, the user encrypted key read from the storage medium 1340 is decrypted using a first random number Data A as the decryption key to obtain the user key hash value.
[0110] In an optional implementation, the user key verification process is omitted. To generate a data key, a first random number Data A is obtained from the one-time programmable module 1320 as the key, and the user encryption key read from the storage medium 1340 is decrypted to obtain the user key hash value.
[0111] During the process of writing user data to the storage device, the plaintext user data is encrypted using the encryption module 1370 with a data key to obtain ciphertext, which is then stored in the storage device. During the process of reading user data from the storage device, the ciphertext read from the storage device is decrypted using the data key to obtain the plaintext user data.
[0112] Figure 14 A flowchart illustrating the method for verifying the user key and generating the data key.
[0113] To verify the user key, a hash operation is performed on the received user key to obtain the user key hash value (1410). A first random number is obtained and the user key hash value is encrypted with the first random number to generate a user encryption key (1420). The user encryption key is read from the storage medium (1430). The generated user encryption key is compared with the read user encryption key to verify the received user key (1440).
[0114] To generate a data key, the encrypted value of the data key is read from the storage medium (1450), the encrypted value of the data key is decrypted using the user key hash value to obtain the data key (1460), and the user data is encrypted or decrypted using the data key (1470).
[0115] Figure 15 This is a schematic diagram of verifying the user key and generating the data key according to another embodiment of this application.
[0116] After receiving the user key, the key management unit inputs the user key into the hash operation module 1510 to generate a corresponding user key hash value, which is temporarily stored in the chip's internal cache. A first random number, Data A, is obtained from the one-time programmable module 1520. Using the first random number Data A as the key and the user key hash value as the data to be encrypted, the encryption module 1530 is invoked to generate a user encryption key. The user encryption key is read from the storage medium 1540, and the judgment module 1550 determines whether the read user encryption key is equal to the generated user encryption key. If they are equal, the verification passes; otherwise, the verification fails.
[0117] There are M data keys, one or more of which are selected to encrypt or decrypt user data. For example, the data key used is determined based on the logical address of the user data, the namespace, the current time, or a specified host.
[0118] If the user key verification is successful, one of the encrypted values of the M data keys in the storage medium 1540 is selected and read in. The encrypted value of the data key is then decrypted by the decryption module 1560 using the hash value of the user key to obtain the data key.
[0119] Alternatively, the encrypted values of M data keys can be obtained from the storage medium, and the encrypted values of the M data keys can be decrypted by the decryption module 1560 using the user key hash value to obtain the M data keys.
[0120] In an optional implementation, the user key verification process is omitted. To generate a data key, a first random number Data A is obtained from the one-time programmable module 1520 as the key, and the user encryption key read from the storage medium 1540 is decrypted to obtain the user key hash value.
[0121] The user data plaintext is encrypted using the encryption module 1570 using the data key to obtain the user data ciphertext, which is then stored in the storage device. Alternatively, the user data ciphertext read from the storage medium 1540 can be decrypted using the data key to obtain the user data plaintext.
[0122] Figure 16The flowchart shows the method for verifying the key and generating the data key.
[0123] To verify the user key, a hash operation is performed on the received user key to obtain the user key hash value (1610). A first random number is obtained from the one-time programmable module, and the user key hash value is encrypted with the first random number to generate a user encryption key (1620). The user encryption key is read from the storage medium (1630), and the generated user encryption key is compared with the read user encryption key (1640) to verify the received user key.
[0124] If the user key is verified, in order to generate a data key, select one of the encrypted values of the M data keys in the storage medium and read it in (1650). Use the user key hash value to decrypt the encrypted value of the data key to obtain the data key (1660). Use the data key to encrypt or decrypt the user data (1670).
[0125] Alternatively, the encrypted values of M data keys can be obtained from the storage medium, and the encrypted values of the M data keys can be decrypted using the hash value of the user key to obtain M data keys. The user data can then be encrypted or decrypted using the M data keys.
[0126] Figure 17 This is a schematic diagram illustrating the verification of the user key and the generation of the data key according to another embodiment of this application.
[0127] After receiving the user key, the key management unit inputs the user key into the hash operation module 1710 to generate a corresponding user key hash value, which is temporarily stored in the chip's internal cache. A first random number, Data A, is obtained from the one-time programmable module 1720. Using the first random number Data A as the key and the user key hash value as the data to be encrypted, the encryption module 1730 is invoked to generate a user encryption key. The user encryption key is read from the storage medium 1740, and the judgment module 1750 determines whether the read user encryption key is equal to the generated user encryption key. If they are equal, the verification passes; otherwise, the verification fails.
[0128] If the user key is verified, the first-level data key encryption value is read from the storage medium 1740, and the first-level data key encryption value is decrypted by the decryption module 1760 using the user key hash value to obtain the first-level data key.
[0129] In an optional implementation, the user key verification process is omitted. To generate a data key, a first random number, Data A, is obtained from the one-time programmable module 1720 as the key. The user encryption key read from the storage medium 1740 is decrypted to obtain the user key hash value. The first-level data key encryption value is then decrypted by the decryption module 1760 using the user key hash value to obtain the first-level data key.
[0130] Using the (i-1)th level data key as the decryption key, the encrypted value of the i-th level data key is read from storage medium 1740, and the encrypted value of the i-th level data key is decrypted to obtain the i-th level data key; where 1 <i<=N,N> =2. As N increases, the strength of the Nth level data key also increases.
[0131] The plaintext user data is encrypted using the encryption module 1780 using the Nth-level data key to obtain ciphertext user data, which is then stored in the storage medium 1740. Alternatively, the ciphertext user data read from the storage medium can be decrypted using the Nth-level data key to obtain the plaintext user data.
[0132] Figure 18 A flowchart illustrating the method for verifying the user key and generating the data key.
[0133] To verify the user key, a hash operation is performed on the received user key to obtain the user key hash value (1810). A first random number is obtained from the one-time programmable module, and the user key hash value is encrypted with the first random number to generate a user encryption key (1820). The user encryption key is read from the storage medium (1830), and the generated user encryption key is compared with the read user encryption key (1840) to verify the received user key.
[0134] If the user key is verified, a data key is generated. To generate the data key, the encrypted value (1850) of the first-level data key is read from the storage medium, and the encrypted value of the first-level data key is decrypted using the hash value of the user key to obtain the first-level data key (1860).
[0135] For each natural number i from 2 to N, the (i-1)th level data key is used as the decryption key. The encrypted value of the i-th level data key is read from the storage medium, and the encrypted value of the i-th level data key is decrypted to obtain the i-th level data key; where 1 <i<=N,N> =2 (1870).
[0136] User data is encrypted or decrypted using the Nth level data key (1880).
[0137] Throughout the entire process described above, the generated random number, user key hash value, and data key are not visible and can only be accessed by enabling the corresponding registers.
[0138] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and modifications.
Claims
1. A control component, characterized in that, include: Command processing unit and key management unit; wherein, The command processing unit responds to a key management command provided by the host indicating a user key, instructing the key management unit to process the user key to obtain a user encryption key, and to save the user encryption key; In response to an I / O command provided by the host, the command processing unit instructs the key management unit to encrypt and / or decrypt the data accessed by the I / O command based on the user encryption key. The command processing unit cannot access the user encryption key managed by the key management unit. The key management unit receives the input user key, performs a hash operation on the user key to obtain a user key hash value, generates a first random number, encrypts it using the first random number and the user key hash value to obtain the user encryption key, and writes the user encryption key into a storage medium. The encryption process is controlled by firmware, but the firmware cannot directly access the first random number and the user key hash value; the firmware uses the first random number and the user key hash value by configuring corresponding registers.
2. The control component as described in claim 1, characterized in that, The key management unit receives the user key provided by the host again, performs a hash operation on the user key to generate a user key hash value, obtains a first random number, encrypts the user key hash value using the first random number to obtain a first user encryption key, and reads the user encryption key from the storage medium. If the first user encryption key is the same as the read user encryption key, then the user key provided by the host again is valid.
3. The control component as described in claim 1 or 2, characterized in that, The key management unit uses the first random number and the user encryption key obtained from the storage medium to decrypt the user encryption key obtained from the storage medium according to the first random number to obtain the user key hash value, and stores it in the cache; A second random number is generated, a hash operation is performed on the second random number to obtain a data key, the data key is encrypted according to the user key hash value to obtain a data key encrypted value, and the data key encrypted value is written to a storage medium.
4. The control component as described in claim 3, characterized in that, The key management unit receives the input user key, performs a hash operation on the user key to obtain the user key hash value; reads the encrypted value of the data key from the storage medium, uses the user key hash value to decrypt the encrypted value of the data key to obtain the data key, and uses the data key to encrypt or decrypt user data.
5. The control component as described in claim 4, characterized in that, The key management unit generates M random numbers; it performs a hash operation on each random number to obtain M data keys; where M is a natural number greater than 1. The user key hash value is used as the key, and M data keys are used as the data to be encrypted to generate M data key encryption values, and the M data key encryption values are written into the storage medium.
6. The control component as described in claim 5, characterized in that, The key management unit obtains the encrypted values of M data keys from the storage medium, decrypts the encrypted values of the M data keys using the user key hash value to obtain M data keys, and uses the M data keys to encrypt or decrypt user data.
7. The control component as described in claim 5, characterized in that, The key management unit reads one of the encrypted values of M data keys from the storage medium, decrypts the encrypted value of the data key using the user key hash value to obtain the data key, and uses the data key to encrypt or decrypt user data.
8. The control component as described in any one of claims 4-7, characterized in that, The key management unit reads the encrypted value of the first-level data key from the storage medium, and decrypts the encrypted value of the first-level data key using the user key hash value to obtain the first-level data key; The (i-1)th level data key is used as the decryption key. The encrypted value of the i-th level data key is read from the storage medium and decrypted to obtain the i-th level data key. Among them 1 <i<=N,N> =2; Use the Nth level data key to encrypt or decrypt user data.