Embodiments described herein relate generally to a storage device, a controller, and a data writing method.
There exists a storage device (e.g., hard disk drive) that can prevent stealing and leakage of stored data by storing the data after performing encryption using methods such as AES (Advanced Encryption Standard), and the like. There also exists a storage device in which an encryption key used in encryption and decryption of data can be appropriately updated. The security can be further enhanced by updating the encryption key. For example, by updating the encryption key when discarding the storage device that is no longer necessary, the information leak from the discarded storage device can be prevented.
The storage device having a configuration in which the encryption key can be updated also includes a storage device that adds information (hereinafter referred to as key information) of the encryption key, which is used in encrypting the data, to the data (data in the encrypted state), and stores the same. The key information is used to determine whether the encryption key used in the decryption of when reading out the data matches the encryption key used to encrypt the data. If the encryption key to decrypt the data does not match the encrypted data, the decryption is not correctly carried out, and the incoherent data is output from the storage device. In this case, problems may arise as determination cannot be made on whether or not the decryption is correctly carried out on the host side using the output data. For example, the operation of the host may become unstable, such as the host that received the data that is not correctly decrypted may malfunction, and the like. Assuming such case, the storage device executes the determination on whether or not the encryption key to be used in the decryption process is correct using the key information. The key information is, for example, information indicating the generation of the encryption key in which the value is incremented as the encryption key is updated.
A method of sharing a storage area by performing XOR of the key information with the data protection parity of the user data in order to avoid data other than the user data such as the key information from using a storage area for the user data of the storage device is well known. However, when adding (XOR) the key information to the data and storing the same, it is difficult to detect an error (the errors caused by a malfunction of the logic) of the key information added to the data when reading out the data. Thus, an error (malfunction) arises in the match and unmatch determination of the encryption key to be used in the decryption, and the operation may become unstable, for example, the data may not be read out, although the encryption key which is used to encrypt the data is used.
In general, according to one embodiment, a storage device including a buffer configured to store encrypted data; an error detection code generator configured to generate an error detection code of the encrypted data; a key information generator configured to generate key information which is information of an encryption key used in the encryption of the encrypted data; a protection code generator configured to generate a protection code which is an error detection code of the key information; a key information attaching unit configured to attach the key information and the protection code to the error detection code, and add to the encrypted data as redundant data; and a media configured to store the encrypted data added with the redundant data.
Exemplary embodiments of a storage device, a controller, and a data writing method will be explained below in detail with reference to the accompanying drawings. The present invention is not limited to the following embodiments.
In the controller 10, the I/F control unit 11 exchanges various types of commands and data with the host device 2. The SDRAM arbitration unit 12 arbitrates an access operation to the SDRAM 20 by each unit in the controller 10, and executes write, readout, erase, and the like of the data with respect to the SDRAM 20. The command control unit 13 transmits and receives various types of commands with the host device 2, and also executes processes following the received command. For example, if a command instructing the write of the data is received, an instruction is issued to each unit in the controller 10 to execute the process for writing the data received with the command to the media 30. The media arbitration unit 14 arbitrates an access operation to the media 30 by each unit in the controller 10, and executes write, readout, erase, and the like of the data with respect to the media 30. The encryption processor 15 encrypts the data received from the host device 2 and stores the same in the SDRAM 20. If the data to be output to the host device 2 is stored in the SDRAM 20, such data is retrieved and decrypted. The write processor 16 adds redundant data with respect to the data (hereinafter referred to as actual data) held by the SDRAM 20, and writes the same in the media 30. The redundant data includes an error detection code of the actual data held by the SDRAM 20, and the like. The details on the redundant data will be described later. The readout processor 17 reads out the data (actual data added with the redundant data) written in the media 30, performs an error check of the actual data, and the like, and stores the actual data in the SDRAM 20 if problem is not found. The MPU 18 develops a program stored in the ROM 50 on the RAM 60 and executes the program to control each unit in the controller 10.
In the configuration example illustrated in
The encryption key storage memory 40 holds an encryption key 41 to be used in the encryption process and the decryption process of the data by the encryption processor 15. The encryption key 41 is updated, for example, when receiving a change instruction from the host device 2. The method for updating the encryption key (method for generating a new encryption key) is arbitrary. In the present embodiment, the encryption key storage memory 40 and the media 30 are separate configurations, but an area for storing the encryption key 41 may be arranged in the media 30. The encryption key storage memory 40 may be arranged at one part of the RAM 60. The ROM 50 holds programs and various types of information for operating the storage device 1. The RAM 60 is used as a development memory and an operation memory for the program and the information stored in the ROM 50.
Now, the encryption processor 15, the write processor 16, and the readout processor 17 arranged in the controller 10 will be described.
[Encryption Processor 15]
As illustrated in
The encrypting section 151 receives the data written in the media 30 and encrypts the data. In the encryption process, the encryption key 41 held by the encryption key storage memory 40 is used. After the encryption is completed, the data in the encrypted state is stored in the SDRAM 20 as the actual data to be written to the media 30.
The decrypting section 152 retrieves the actual data read out from the media 30 and stored in the SDRAM 20 by the readout processor 17, and decrypts such data using the encryption key 41.
For example, the data subjected to encryption by the encrypting section 151 is the data (write data) received from the host device 2, and the actual data subjected to decryption by the decrypting section 152 is the data (readout data) to output to the host device 2.
When receiving the change instruction from the host device 2, for example, the encryption key updating section 153 updates the encryption key 41 held in the encryption key storage memory 40. The method for updating the encryption key (method for generating a new encryption key) is arbitrary.
[Write Processor 16]
As illustrated in
The error detection code generator 161 retrieves the actual data stored in the SDRAM 20 through the SDRAM arbitration unit 12, and generates an error detection code of the retrieved actual data. For example, CRC (Cyclic Redundancy Check) is generated as the error detection code. The actual data retrieved from the SDRAM 20 by the error detection code generator 161 is encrypted by the encrypting section 151 illustrated in
The key management information holding section 162 holds the management information of the encryption key used in the encryption process by the encrypting section 151. When the encryption key 41 illustrated in
The key information generator 163 reads out and processes the management information held by the key management information holding section 162, and generates the key information with less amount of information (number of bits) than the management information. For example, if the management information is the key generation information having an eight bit length, the generation of the encryption key can be expressed with a number of bits less than the eight bits in a state the aggregate number of updates of the encryption key is few. Thus, the key information generator 163 extracts low one bit or a few bits actually representing the generation of the key among the management information, and outputs as the key information. If the management information held by the key management information holding section 162 does not need to be processed, that is, if the key information with fewer number of bits than the management information cannot be generated, the key information generator 163 outputs the management information to the key information attaching section 165 as the key information.
The protection code generator 164 generates a protection code, which is the error detection code of the key information generated by the key information generator 163. For example, the CRC is generated as the protection code.
The key information attaching section 165 attaches the key information generated by the key information generator 163 and the protection code generated by the protection code generator 164 to the error detection code received from the error detection code generator 161 to generate redundant data. In this case, the redundant data having the same number of bits as the error detection code is generated. In other words, when attaching the key information and the protection code (hereinafter, the key information and the protection code are collectively referred to as key information with protection code) to the error detection code, an exclusive OR (XOR) is used (see
[Readout Processor 17]
As illustrated in
The error detection code generator 171 reads out the data (actual data added with the redundant data) specified from the host device 2 from the media 30, and generates the error detection code of the readout actual data. The error detection code is generated through a method same as the error detection code generator 161 of the write processor 16. After the generation of the error detection code is finished, the error detection code generator 171 outputs the error detection code to the error detection code comparing section 172 along with the actual data and the redundant data read out from the media 30.
The error detection code comparing section 172 compares the redundant data (error detection code attached with the key information and the protection code) read out from the media 30 and the error detection code generated by the error detection code generator 171. Specifically, the exclusive OR of the redundant data and the error detection code is calculated (see
The data check section 173 checks the error (bit error) of the actual data based on the comparison result in the error detection code comparing section 172. In other words, the data check section 173 determines that the error does not exist in the actual data if the data check bit sequence is zero (all bits are zero). If the error is not detected in the error check, the data check section 173 outputs the actual data and the exclusive OR of the first area (<1> of
The data check section 173 acquires in advance the examination effective bit information from the host device 2 or the key information generator 163 of the write processor 16. The examination effective bit information is the information indicating which portion of the comparison result of the error detection code comparing section 172 corresponds to the second area (data check bit sequence). The host device 2 or the key information generator 163 notifies the examination effective bit information to the data check section 173 when detecting the update of the encryption key 41 (see
The key information check section 174 checks the error (bit error) of the key information received from the data check section 173. If the error is not detected in the error check, the key information check section 174 outputs the actual data and the key information to the key examining section 175.
When receiving the actual data and the key information from the key information check section 174, the key examining section 175 confirms the key information, and determines whether or not the encryption key used in the encryption of the received actual data and the encryption key 41 (current encryption key) set in the encryption processor 15 match. If the encryption keys match, the key examining section 175 stores the actual data in the SDRAM 20. In other words, when receiving the actual data and the key information from the key information check section 174, the key examining section 175 acquires the key information of the current encryption key from the key information generator 163 of the write processor 16, and stores the actual data in the SDRAM 20 if the two received key information match. The key information of the current encryption key may be acquired in advance. For example, each time the actual data is written to the media 30, the key information generator 163 outputs the generated key information to the key information attaching section 165 and the key examining section 175, and the key examining section 175 holds the most recent key information received from the key information generator 163.
In the flowchart of
The data protection strength by the storage device of the present embodiment will be supplementary explained. For example, if the error detection code is the CRC, the CRC is 48 bits, the key information is 20 bits, and the protection code is 2 bits, the 26 bits of the CRC portion (portion of <2> of
Therefore, according to the present embodiment, when storing the data received from the host device 2, the storage device 1 first encrypts the data, the storage device 1 then generates the error detection code for checking the error of the data after the encryption, the key information, which is the information of the encryption key used in encrypting the data, and the protection code for checking the error of the key information. Furthermore, the redundant data, which is the error detection code attached with the key information and the protection code, is generated by calculating the exclusive OR of the error detection code, and the key information and the protection code. The redundant data is added to the data of after the encryption, and then stored. When outputting the stored data to the host device 2, the redundant data added to the data is used to perform the error check of the data, and the right and wrong determination of the encryption key used in the decryption (determination on whether or not the encryption key used in the encryption and the encryption key used in the decryption match). Furthermore, when carrying out the match and unmatch determination of the encryption key, the error check of the key information to use in the determination process is carried out. The malfunction caused by the error of the key information is thereby suppressed, and the reliability of the device can be enhanced. Moreover, the lowering of the data protection strength due to the attachment of the key information and the protection code to the error detection code can be suppressed to a minimum since the bit size of the key information can be varied.
In the embodiment described above, a case in which the storage device is the hard disk drive has been described by way of example, but the storage device may be a SSD (Solid State Drive).
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
This application is based upon and claims the benefit of priority from U.S. Provisional Application No. 61/947049, filed on Mar. 3, 2014; the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
61947049 | Mar 2014 | US |