This application is based upon and claims the benefit of priority from Japanese Patent Application No. 2008-303316, filed Nov. 28, 2008, the entire contents of which are incorporated herein by reference.
1. Field
One embodiment of the invention relates to a storage apparatus and a data writing method, and particularly to a storage apparatus and a data writing method that encrypt, when a key for encrypting user data in a storage medium is changed, the user data with a new key and safely write the encrypted data into the storage medium.
2. Description of the Related Art
In recent years, from the point of view of protecting confidential information and avoiding information leakage, demands for magnetic storage apparatuses and optical storage apparatuses having security functions are increasing. Examples of such storage apparatuses having security functions are a magnetic storage apparatus that reads out, when a key used to encrypt the user data (decryption or encryption) is changed, a part of the user data stored in a sector on a storage medium, encrypts the read user data with the changed key, and write the encrypted user data into the same sector, or a magnetic storage apparatus that retreats the encrypted user data into a temporal retreat region, and writes the retreated user data into the same sector.
There is also proposed a data processing apparatus that encrypts data to be written into a storage medium with random numbers generated by an M-series random number generation module serving as a encryption key (see Japanese Patent Application Publication (KOKAI) No. 2006-259988).
Conventional magnetic storage apparatuses that read out user data, encrypt the read user data with a new key, and write back the encrypted user data into the same sector, when a key is changed, may lose the user data when the power is turned off while writing the encrypted user data into the same sector. Further, a conventional magnetic storage apparatuses that write the encrypted user data into the same sector after the encrypted user data is retreated to a temporal retreat region requires much time for writing the user data when a key is changed.
A general architecture that implements the various features of the invention will now be described with reference to the drawings. The drawings and the associated descriptions are provided to illustrate embodiments of the invention and not to limit the scope of the invention.
Various embodiments according to the invention will be described hereinafter with reference to the accompanying drawings. In general, according to one embodiment of the invention, a storage apparatus includes: a controller configured to encrypt user data with a key, and write the encrypted user data in a storage medium; and a key changing module configured to change the key. The storage medium includes a user data region storing the encrypted user data and a key changing region of a logical block with a predetermined size, the key changing region being adjacent to the user data region. When the key is changed, the controller is configured to divide the user data written in the storage medium into a plurality of pieces of the user data each corresponding to a logical block size of the logical block, encrypt a piece of the user data adjacent to the key changing region with the changed key, write the encrypted piece into the key changing region, sequentially shift each of the pieces of the user data other than the piece of the user data adjacent to the key changing region by one logical block size in a direction toward the key changing region from positions in the storage region in which the pieces of the divided user data other than the piece of the divided user data adjacent to the key changing region are written, and write the shifted pieces.
According to another embodiment of the invention, a data writing method applied to a storage apparatus including a controller and a key changing module, the controller being configured to encrypt user data with a key, and write the encrypted user data in a storage medium, the key changing module being configured to change the key, the storage medium including a user data region storing the encrypted user data and a key changing region of a logical block with a predetermined size, the key changing region being adjacent to the user data region, the data writing method includes: when the key is changed, the controller of the storage apparatus dividing the user data written in the storage medium into a plurality of pieces of the user data each corresponding to a logical block size of the logical block, encrypting a piece of the user data adjacent to the key changing region with the changed key, writing the encrypted piece into the key changing region, sequentially shifting each of the pieces of the user data other than the piece of the user data adjacent to the key changing region by one logical block size in a direction toward the key changing region from positions in the storage region in which the pieces of the divided user data other than the piece of the divided user data adjacent to the key changing region are written, and writing the shifted pieces.
The MPU 11 controls the entire magnetic storage apparatus 1. The host I/F controller 12 is an interface between a host computer (host) 2 and the magnetic storage apparatus 1, and receives a request (a read request, a write request, or a key change request) from the host 2 to inform the MPU 11 of the request. The host I/F controller 12 also returns a response for the request to the host 2 according to an instruction of the MPU 11. The host 2 requests key change by sending a key change command for changing a key used to encrypt the user data, to the magnetic storage apparatus 1 via the host I/F controller 12.
The buffer memory 13 stores therein user data read out from a storage medium 22 and user data to which a write request from the host 2 is subjected. The encryption circuit controller 14 controls the encryption circuit 15 according to an instruction of the MPU 11 to change a key to be used by the encryption circuit 15. More specifically, once the MPU 11 receives a key change request from the host 2, the MPU 11 instructs the encryption circuit controller 14 to change the key to be used by the encryption circuit 15 for encrypting the user data.
The encryption circuit 15 uses the key to encrypt the user data (encryption or decryption) stored in the buffer memory 13. The read channel 16 reads out the user data in the storage medium 22 through the head IC 17 and the head 18 according to an instruction of the MPU 11. The read channel 16 also writes user data encrypted by the encryption circuit 15 into the storage medium 22 through the head IC 17 and the head 18 according to an instruction of the MPU 11. The head IC 17, as is well known, reads out user data from the storage medium 22, and writes the user data into the storage medium 22 through the head 18. The servo controller 19 controls and enables the VCM 20 to perform positioning control of the head 18 according to an instruction of the MPU 11. The servo controller 19 also controls the SPM 21. The VCM 20 performs the positioning control of the head 18 according to an instruction of the servo controller 19. The SPM 21, as is well known, rotationally drives the storage medium 22 according to an instruction of the servo controller 19. User data is written into the storage medium 22.
After the key changing process, the user data that is encrypted with the encryption key EK2 as illustrated in
According to the first embodiment, even when the power is shut down while the data encrypted with the new key is being written into the encryption-key-changing region, the original data is stored still in the region where the shifted data was stored, thereby preventing data loss. As a result, it is possible to safely write the data encrypted with the new key into the storage medium.
First, the MPU 11 determines whether all pieces of the divided user data of the first range have been shifted (S11). If the MPU 11 determines all pieces of the divided user data of the first range have been shifted, the process is terminated. If the MPU 11 determines a piece of the divided user data of the first range remains not shifted, the MPU 11 controls the encryption circuit controller 14 to set the current encryption key (EK1a) to the encryption circuit 15 (S12). The MPU 11 then stores the piece of the divided user data of the first range adjacent to the first encryption-key-changing region in the buffer memory 13 (S13). The MPU 11 controls the encryption circuit controller 14 to set a new encryption key (EK2a) to the encryption circuit 15 (S14). By S14, the piece of the divided user data stored in the buffer memory 13 is encrypted with the key EK2a. The MPU 11 writes the encrypted piece of the divided user data into the first encryption-key-changing region (S15). By S15, the divided user data is shifted into the encryption-key-changing region. After S15, the MPU 11 sets the storage region in which the shifted divided user data was written as a new first encryption-key-changing region (S16), and the process returns to S11.
According to the second embodiment, it is possible to sequentially write pieces of the divided user data to be shifted into a region for changing a key corresponding to the range of the divided user data.
As illustrated in
Subsequently, the MPU 11 sequentially shifts each piece of the second divided user data in a direction toward the encryption-key-changing region (see #1 in
Then, the MPU 11 stores the piece of the divided user data adjacent to the encryption-key-changing region in the buffer memory 13 (S24). The MPU 11 controls the encryption circuit controller 14 to perform the encryption invalid setting on the encryption circuit 15 (S25). The MPU 11 then writes the divided user data stored in the buffer memory 13 into the encryption-key-changing region (S26). By S26, the divided user data is shifted into the encryption-key-changing region. After S26, the MPU 11 sets the storage region in which the shifted divided user data was written as a new encryption-key-changing region (S27), and the process returns to S21.
At S22, if the MPU 11 determines the piece of the divided user data to be shifted is the key changed data, the MPU 11 controls the encryption circuit controller 14 to set the current key (the key originally used for the encryption processing of the key changed data) to the encryption circuit 15 (S28). The encryption circuit 15 uses the set current key to decrypt the piece of the divided user data to be shifted and being stored in the buffer memory 13. The MPU 11 then stores the piece of the divided user data to be shifted, that is, a piece of the divided user data adjacent to the encryption-key-changing region, in the buffer memory 13 (S29). The MPU 11 controls the encryption circuit controller 14 to set a new key to the encryption circuit 15 (S30). The encryption circuit 15 uses the set new key to encrypt the piece of the divided user data to be shifted and stored in the buffer memory 13.
Subsequently, the MPU 11 writes the divided user data that is encrypted with the new key into the encryption-key-changing region (S31). By S31, the divided user data is shifted into the encryption-key-changing region. After S31, the MPU 11 sets the storage region in which the shifted divided user data was written as a new encryption-key-changing region (S32), and the process returns to S21.
Instead of S23, the MPU 11 may set any key to decrypt a piece of the divided user data to be shifted with the set key. Moreover, instead of S25, the MPU 11 may set any key as mentioned above to encrypt a piece of the divided user data to be shifted with the set key.
According to the third embodiment, it is possible to encrypt the divided user data in a range corresponding to a new key with the new key, sequentially shift pieces of the divided user data in a direction toward the encryption-key-changing region, and write the shifted pieces. Further, according to the third embodiment, it is possible to sequentially shift pieces of the divided user data in a range other than the range corresponding to the new key in a direction toward the encryption-key-changing region, and write the shifted pieces, without the encryption processing.
In the storage apparatus and the data writing method, when a key is changed, the user data written in the storage medium is divided into a plurality of pieces of user data. A piece of the divided user data adjacent to the key-changing region, which is provided on the storage medium, is encrypted with the new key and written into the key-changing region. In addition, pieces of the divided user data other than the one adjacent to the key-changing region are sequentially shifted in a direction from positions in the storage region where the pieces of the divided user data are written toward the key-changing region, and written. Consequently, with the storage apparatus and the data writing method of one of the embodiments, even if power is turned off while the data encrypted with the new key is being written into the key-changing region, the original data remains in the region before it is shifted, thereby preventing data loss. As a result, it is possible to safely write the data encrypted with the new key into the storage medium.
Furthermore, in the storage apparatus and the data writing method, unlike conventional storage apparatuses, user data encrypted with a new key is not written in the same sector after it is retreated to a temporal retreat region. Consequently, it is possible to rapidly write the user data encrypted with the new key into the storage medium.
The various modules of the systems described herein can be implemented as software applications, hardware and/or software modules, or components on one or more computers, such as servers. While the various modules are illustrated separately, they may share some or all of the same underlying logic or code.
While certain embodiments of the inventions 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 methods and systems described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the methods and systems 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.
Number | Date | Country | Kind |
---|---|---|---|
2008-303316 | Nov 2008 | JP | national |