Memory system and data write method

The memory system uses nonvolatile memory health data and real-time clock data to generate dynamic encryption keys, securing data by making it difficult for third parties to decrypt, thus ensuring only authorized users can access encrypted data.

JP2024135033AInactive Publication Date: 2024-10-04KIOXIA CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2023045524
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-03-22
Publication Date
2024-10-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing memory systems that encrypt data are vulnerable to decryption by third parties due to the detectable regularity in the key generation process, allowing unauthorized access to encrypted data.

Method used

A memory system that generates keys based on nonvolatile memory health data and real-time clock data, encrypts data using these keys, and stores them in a secure area inaccessible to unauthorized users, making it difficult for third parties to decrypt the data.

Benefits of technology

The system enhances data security by ensuring that only authorized users can decrypt the data, as the dynamic and time-dependent key generation process makes it challenging for unauthorized parties to deduce the encryption keys, thereby maintaining data confidentiality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024135033000001_ABST
    Figure 2024135033000001_ABST
Patent Text Reader

Abstract

To provide a memory system for storing encrypted data that can hardly be decrypted by a third party.SOLUTION: A memory system according to an embodiment comprises a non-volatile memory and a controller. The controller is configured to generate a key based on time data and health data of the non-volatile memory, convert data into encrypted data using the key, and write the encrypted data to the non-volatile memory.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] 1 is a block diagram of a memory system according to an embodiment of the present invention; [Background technology]

[0002] There is a memory system that encrypts data and stores the encrypted data. The memory system includes a random number generator, generates a key based on the random numbers, and encrypts the data using the key. The random number generator generates random numbers according to some rules. Therefore, there is a possibility that a third party may detect a rule in the number string included in the key, infer the key from this rule, and decrypt the encrypted data. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] JP 2013-62616 A [Patent Document 2] JP 2012-34268 A [Patent Document 3] U.S. Pat. No. 9,659,191 Summary of the Invention [Problem to be solved by the invention]

[0004] An object of the present invention is to provide a memory system and a data writing method in which encrypted data is difficult to decrypt by a third party. [Means for solving the problem]

[0005] A memory system according to an embodiment includes a non-volatile memory and a controller that generates a key based on time data and health data of the non-volatile memory, converts data into encrypted data using the key, and writes data based on the encrypted data to the non-volatile memory. [Brief description of the drawings]

[0006] [Figure 1] 1 is a block diagram illustrating an example of an information processing system including a memory system according to a first embodiment. [Diagram 2] 6 is a flowchart for explaining an overview of a first example of encryption in the memory system according to the first embodiment. [Diagram 3] FIG. 4 is a diagram for explaining an example of a password table according to the first embodiment. [Figure 4] FIG. 2 is a diagram for explaining an example of a key table according to the first embodiment. [Diagram 5] 11 is a flowchart for explaining an outline of a first example of decoding in the memory system according to the first embodiment. [Figure 6] 11 is a flowchart for explaining an outline of a second example of encryption in the memory system according to the first embodiment. [Figure 7] 11 is a flowchart for explaining an outline of a second example of decoding in the memory system according to the first embodiment. [Figure 8] FIG. 2 is a diagram for explaining an example of health data according to the first embodiment. [Figure 9] FIG. 4 is a diagram for explaining an example of health data used for key generation according to the first embodiment. [Figure 10] FIG. 4 is a diagram for explaining an example of RTC data according to the first embodiment. [Figure 11] FIG. 2 is a diagram for explaining an example of the operation of an RTC according to the first embodiment. [Figure 12] FIG. 2 is a block diagram for explaining a detailed example of an encryption / decryption circuit according to the first embodiment. [Figure 13] 5 is a flowchart for explaining the first half of a detailed example of encryption by the encryption / decryption circuit according to the first embodiment. [Figure 14] 6 is a flowchart for explaining the second half of a detailed example of encryption by the encryption / decryption circuit according to the first embodiment. [Figure 15] FIG. 4 is a diagram for explaining a first example of key allocation in the memory system according to the first embodiment. [Figure 16]FIG. 11 is a diagram for explaining a second example of key allocation in the memory system according to the first embodiment. [Figure 17] FIG. 11 is a diagram for explaining a third example of key allocation in the memory system according to the first embodiment. [Figure 18] 4 is a diagram for explaining an example of key generation timing in the memory system according to the first embodiment. [Figure 19] 4 is a diagram for explaining a detailed example of key generation timing in the memory system according to the first embodiment. [Figure 20] FIG. 4 is a diagram for explaining an example of a key update table of the memory system according to the first embodiment. [Figure 21] FIG. 4 is a diagram for explaining an example of key updating in the memory system according to the first embodiment. [Figure 22] FIG. 4 is a diagram for explaining an example of key updating in the memory system according to the first embodiment. [Diagram 23] 6 is a flowchart illustrating a part of an example of a write operation of the memory system according to the first embodiment. [Figure 24] 11 is a flowchart for explaining the remaining part of the example of the write operation of the memory system according to the first embodiment. [Diagram 25] 6 is a flowchart illustrating a part of an example of a read operation of the memory system according to the first embodiment. [Figure 26] 6 is a flowchart for explaining a part of an example of a patrol read operation of the memory system according to the first embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0007] Hereinafter, the embodiments will be described with reference to the drawings. The following description is an example of an apparatus and a method for embodying the technical idea of ​​the embodiment, and the technical idea of ​​the embodiment is not limited to the structure, shape, arrangement, material, etc. of the components described below. Modifications that a person skilled in the art can easily conceive are naturally included in the scope of the disclosure. In order to make the description clearer, the size, thickness, planar dimensions, or shape of each element may be changed from the actual embodiment and shown diagrammatically. Elements having different dimensional relationships or ratios may be included in multiple drawings. In multiple drawings, corresponding elements may be given the same reference numerals and duplicated descriptions may be omitted. Some elements may be given multiple names, but these examples of names are merely examples and do not deny the use of other names for these elements. In addition, it is not denied that elements not given multiple names may be given other names. In the following description, "connection" may include not only direct connection but also connection via other elements.

[0008] Hereinafter, the present embodiment will be described in detail with reference to the drawings.

[0009] 1 is a block diagram illustrating an example of an information processing system including a memory system 4 according to the first embodiment. The information processing system includes the memory system 4 and a host 2.

[0010] The host 2 is an information processing device serving as an external device that accesses the memory system 4. The host 2 may be a server (storage server) that stores a large amount of diverse data in the memory system 4. The host 2 may be a personal computer.

[0011] The memory system 4 can be used as a main storage of the host 2. The memory system 4 may be a system for business use incorporated in a server such as a data center. The memory system 4 may be a system for personal use incorporated in a personal computer.

[0012] The memory system 4 can be connected to the host 2. The memory system 4 and the host 2 may be provided in the same housing. The memory system 4 and the host 2 may be provided in separate housings. Fig. 1 shows an embodiment in which the memory system 4 and the host 2 are provided in separate housings. In this case, the memory system 4 is connected to the host 2 via a cable or a network.

[0013] The memory system 4 is a storage device configured to write data to or read data from a non-volatile storage medium. Examples of the memory system 4 include a solid state drive (SSD), an embedded multi media card (eMMC), a universal flash storage (UFS) device, and a memory card. Figure 1 shows an embodiment in which the example of the memory system 4 is an SSD.

[0014] Examples of non-volatile storage media include NAND flash memory, NOR flash memory, MRAM (Magneto-resistive Random Access Memory), PRAM (Phase change Random Access Memory), ReRAM (Resistive Random Access Memory), and FeRAM (Ferroelectric Random Access Memory). Figure 1 shows an embodiment in which the example of the non-volatile storage medium is a NAND flash memory (hereinafter referred to as NAND memory) 14.

[0015] The memory system 4 includes a controller 12, a NAND memory 14, and a dynamic random access memory (DRAM) 16. In an SSD, the controller 12 and the NAND memory 14 are formed as separate components. In an eMMC, the controller 12 and the NAND memory 14 are formed as the same component.

[0016] The controller 12 writes data to the NAND memory 14 in accordance with a write request transmitted from the host 2. The controller 12 reads data from the NAND memory 14 in accordance with a read request transmitted from the host 2.

[0017] The controller 12 may be configured by a circuit such as a System on a Chip (SoC).

[0018] The DRAM 16 is an example of a volatile memory. The DRAM 16 is, for example, a DRAM conforming to the DDR3L (Double Data Rate 3 Low voltage) standard. The DRAM 16 operates as a buffer memory that is supplied from the host 2 to the memory system 4 and stores data that is being written to the NAND memory 14 or has not been written, and data that is read from the NAND memory 14 and is being transferred to the host 2 or has not been transferred. The DRAM 16 includes an area that stores an address conversion table that defines the correspondence between a logical address related to an address specified by the host 2 and a physical address of the NAND memory 14, an area that stores a request received from the host 2, an area (called a write buffer) that stores data that is being written to the NAND memory 14 or has not been written, and an area (called a read buffer) that stores data that is being read from the NAND memory 14 and is being transferred to the host 2 or has not been transferred.

[0019] The DRAM 16 as a volatile memory may be provided inside the controller 12 instead of being provided outside the controller 12. Note that, instead of the DRAM 16, a static random access memory (SRAM) that allows faster access may be used as the volatile memory.

[0020] The NAND memory 14 may be composed of a single chip or multiple chips. The chip includes a memory cell array including multiple memory cells arranged in a matrix. The memory cell array may be a two-dimensional memory cell array in which multiple memory cells are arranged in a plane, or a three-dimensional memory cell array in which multiple memory cells are arranged in a three-dimensional shape. The memory cell array includes multiple blocks BLK. Each block BLK includes multiple pages. The block BLK functions as the smallest erase unit. Each page includes multiple memory cells connected to the same word line. The page is the unit of data write operation and data read operation.

[0021] The NAND memory 14 includes a security data area 14a and a user data area 14b. The host 2 can access the user data area 14b but cannot access the security data area 14a. The controller 12 can access the security data area 14a and the user data area 14b.

[0022] The controller 12 includes a CPU 20, a host interface (host I / F) circuit 22, a NAND interface (NAND I / F) circuit 24, a DRAM interface (DRAM I / F) circuit 26, an encryption / decryption circuit 34, and a real-time clock (RTC) 28. The CPU 20, the encryption / decryption circuit 34, the host I / F circuit 22, the NAND I / F circuit 24, and the DRAM I / F circuit 26 are connected to a bus line 30.

[0023] The host I / F circuit 22 is electrically connected to the host 2 , the NAND I / F circuit 24 is electrically connected to the NAND memory 14 , and the DRAM I / F circuit 26 is electrically connected to the DRAM 16 .

[0024] The host I / F circuit 22 supports a variety of interfaces, including SCSI (Small Computer System Interface), SAS (Serial Attached SCSI), ATA (AT Attachment), SATA (Serial ATA), PCIe (PCI Express), TM , Ethernet TM , Fibre channel TM , NVMe (NVM Express) TM , USB (Universal Serial Bus) TM , UART(Universal Asynchronous Receiver / Transmitter) TM Complies with standards such as:

[0025] The NAND I / F circuit 24 complies with standards such as Toggle DDR and ONFI (Open NAND Flash Interface).

[0026] The CPU 20 includes modules that realize various functions by executing firmware stored in the NAND memory 14. Examples of the various functions are an encryption function and a decryption function. The CPU 20 includes an encryption / decryption module 34.

[0027] The host 2 transmits user data in plain text to the memory system 4 .

[0028] The encryption / decryption circuit 34 encrypts user data and decrypts the encrypted data.

[0029] For example, when the CPU 20 receives a write request from the host 2 via the host I / F circuit 22, the CPU 20 inputs user data encryption related to the write request to the encryption / decryption circuit 34. The encryption / decryption circuit 34 encrypts the input user data. The CPU 20 causes an error correction coding (ECC) circuit (not shown) to execute ECC on the data encrypted by the encryption / decryption circuit 34. The ECC circuit generates parity for error correction (ECC parity) and generates a codeword having the generated ECC parity and the encrypted data. Then, the CPU 20 is configured to write the codeword to the NAND memory 14 via the NAND I / F circuit 24. That is, the CPU 20 is configured to write data based on the data encrypted by the encryption / decryption circuit 34 to the NAND memory 14 via the NAND I / F circuit 24 in response to a write request from the host 2.

[0030] Furthermore, when the CPU 20 receives a read request from the host 2 via the host I / F circuit 22, for example, the CPU 20 reads data based on the read request from the NAND memory 14 via the NAND I / F circuit 24. The CPU 20 causes the ECC circuit to execute error correction decoding processing on the read data. The CPIU 20 inputs the read data that has been error correction decoded to the encryption / decryption circuit 34 as encrypted data. The encryption / decryption circuit 34 decrypts the input encrypted data. In other words, the CPU 20 is configured to decrypt data based on the data read from the NAND memory 14 in response to a read request from the host 2, and transmit the decrypted data to the host 2 via the host I / F circuit 22.

[0031] The RTC 28 is an IC that outputs time data (hereinafter referred to as RTC data) indicating the date and time, and is backed up by a battery. The RTC 28 is connected to the CPU 20 via a serial bus. Examples of the serial bus include an I2C bus and an SPI bus. The RTC 28 transmits the RTC data to the CPU 20.

[0032] The storage capacity of a non-volatile memory such as the NAND memory 14 deteriorates with each write or erase. When the number of writes or erases exceeds an upper limit, the non-volatile memory is no longer able to store data. In the memory system 4, a health status command is defined for checking the deterioration state of the NAND memory 14 so that measures can be taken before the number of writes or erases of the NAND memory 14 exceeds a condition number. In response to the health status command, the NAND memory 14 outputs health data indicating the deterioration state. One example of the health data is the number of erases per block.

[0033] The encryption / decryption circuit 34 generates a key based on at least the RTC data and the health data, and performs encryption and decryption processes using the key. Therefore, when generating a key, the encryption / decryption circuit 34 receives the health data output from the NAND memory 14 and the RTC data output from the RTC 28. The encryption / decryption circuit 34 generates a key based on the RTC data and the health data. Since the RTC data and the health data change in a short time, there is a low possibility that the key will be known to a third party. The encryption / decryption circuit 34 may generate a key based on a password set by the user in addition to the RTC data and the health data.

[0034] 1 shows an example in which the encryption / decryption circuit 34 is implemented as hardware. The encryption / decryption circuit 34 may be implemented as firmware or a combination of hardware and firmware.

[0035] The controller 12 may include an encryption circuit instead of the encryption / decryption circuit 34. In this case, the CPU 20 is configured to transmit data based on data read from the NAND memory 14 via the NAND I / F circuit 24 to the host 2 via the host I / F circuit 22 without decrypting the data in response to a read request from the host 2. The host 2 decrypts the data.

[0036] Next, two examples of encryption / decryption processing will be described. The first example is an example in which a password is required. The second example is an example in which a password is not required and the decryption processing is performed on host 2.

[0037] FIG. 2 is a flowchart for explaining an outline of a first example of a write process in the memory system 4 according to the first embodiment.

[0038] The user of the host 2 determines a password for the user data to be written to the memory system 4 , and inputs the password to the host 2 .

[0039] The host 2 transmits a write request and a password to the memory system 4 (S102). The write request includes the user data to be written and a start address (logical address). The start address is the address where the writing of the user data starts.

[0040] When the CPU 20 receives the write request and password via the host I / F circuit 22, the CPU 20 writes the user data, start address, and password specified in the write request to the DRAM 16 via the DRAM I / F circuit 26 (S104).

[0041] The CPU 20 writes a password table indicating the relationship between the starting address and the password to the security data area 14a of the NAND memory 14 via the NAND I / F circuit 24 (S106). Fig. 3 is a diagram for explaining an example of the password table according to the first embodiment. The password table indicates that the password Password-1 is set to data whose starting address is the address Address-1, and the password Password-2 is set to data whose starting address is the address Address-2.

[0042] The CPU 20 transmits a health status command to the NAND memory 14 via the NAND I / F circuit 24 (S110). Upon receiving the health status command, the NAND memory 14 returns health data to the CPU 20 via the NAND I / F circuit 24.

[0043] The CPU 20 transmits the health data to the encryption / decryption circuit 34 (S112).

[0044] The CPU 20 transmits the RTC data output by the RTC 28 to the encryption / decryption circuit 34 (S114).

[0045] The CPU 20 may transmit the RTC data (S114) before transmitting the health status command (S110).

[0046] The CPU 20 reads the user data from the DRAM 16 via the DRAM I / F circuit 26, transmits the user data to the encryption / decryption circuit 34, and causes the encryption / decryption circuit 34 to execute encryption processing (S116).

[0047] The encryption / decryption circuit 34 generates a key according to a key generation algorithm. An example of the key generation algorithm is the RSA algorithm. The encryption / decryption circuit 34 generates a seed based on the password, the health data, and the RTC data (S118).

[0048] The encryption / decryption circuit 34 generates a public key and a private key based on the seed (S120). The public key is used for encryption. The private key is used for decryption.

[0049] The encryption / decryption circuit 34 encrypts the user data using the public key (S122).

[0050] The CPU 20 reads the start address of the encrypted data from the DRAM 16, and writes a key table indicating the relationship between the start address, the public key, and the private key to the security data area 14a of the NAND memory 14 via the NAND I / F circuit 24 (S124). FIG. 4 is a diagram for explaining an example of a key table according to the first embodiment. The key table indicates that a public key PKey-1 and a private key SKey-1 are assigned to data whose start address is address Address-1, and that a public key PKey-2 and a private key SKey-2 are assigned to data whose start address is address Address-2. Since the host 2 cannot access the security data area 14a, the host 2 cannot read out the private key, and the security of the private key is high.

[0051] The CPU 20 may execute the encryption (S122) and the writing of the key table (S124) in the reverse order.

[0052] The CPU 20 causes an ECC circuit (not shown) to perform ECC on the data encrypted by the encryption / decryption circuit 34, and writes a codeword having ECC parity and the encrypted data from the starting address of the user data area 14b of the NAND memory 14 via the NAND I / F circuit 24 (S126).

[0053] The CPU 20 may execute the writing of the key table (S124) and the writing of the codeword (S126) in the reverse order.

[0054] After writing the codeword (S126), the writing process ends.

[0055] FIG. 5 is a flowchart for explaining an outline of a first example of a read process of the memory system 4 according to the first embodiment.

[0056] The user of the host 2 inputs to the host 2 the password for the user data to be read.

[0057] The host 2 transmits a read request and a password to the memory system 4 (S132). The read request includes a start address (logical address) and a data size. The start address is the address from which the codeword starts to be read.

[0058] When the CPU 20 receives the read request and the password via the host I / F circuit 22, the CPU 20 reads the password corresponding to the start address from the password table stored in the security data area 14a via the NAND I / F circuit 24. The CPU 20 performs password authentication by comparing the password sent from the host 2 with the password read from the security data area 14a, and determines whether the password authentication has been successful (S134).

[0059] If the two passwords do not match, that is, if password authentication has failed (No in S134), the CPU 20 ends the read process.

[0060] If the two match, i.e., if password authentication is successful (Yes in S134), the CPU 20 reads out a private key corresponding to the start address from the key table stored in the security data area 14a via the NAND I / F circuit 24, and transmits the private key to the encryption / decryption circuit 34 (S136).

[0061] The CPU 20 reads the codeword from the start address of the user data area 14b via the NAND I / F circuit 24, and causes the ECC circuit to execute error correction decoding processing on the encrypted data included in the codeword (S138). The CPU 20 transmits the data that has been error correction decoded by the ECC circuit as encrypted data to the encryption / decryption circuit 34, and causes the encryption / decryption circuit 34 to execute decryption processing (S139).

[0062] The encryption / decryption circuit 34 decrypts the encrypted data using the private key, and transmits the user data obtained by the decryption to the CPU 20 (S140).

[0063] The CPU 20 transmits the user data to the host 2 via the host I / F circuit 22 (S142).

[0064] After the user data is transmitted (S142), the read process ends.

[0065] FIG. 6 is a flowchart for explaining an outline of a second example of the write process of the memory system 4 according to the first embodiment.

[0066] The host 2 sends a write request to the memory system 4 (S152).

[0067] When the CPU 20 receives the write request via the host I / F circuit 22, it writes the user data and start address specified in the write request to the DRAM 16 via the DRAM I / F circuit 26 (S154).

[0068] The CPU 20 transmits the health status command to the NAND memory 14 via the NAND I / F circuit 24 (S156). Upon receiving the health status command, the NAND memory 14 transmits health data back to the CPU 20 via the NAND I / F circuit 24.

[0069] The CPU 20 transmits the health data to the encryption / decryption circuit 34 (S158).

[0070] The CPU 20 transmits the RTC data output by the RTC 28 to the encryption / decryption circuit 34 (S160).

[0071] The CPU 20 may transmit the RTC data (S160) before transmitting the health status command (S156).

[0072] The CPU 20 reads the user data from the DRAM 16 via the DRAM I / F circuit 26, and transmits the user data to the encryption / decryption circuit 34 (S162).

[0073] The encryption / decryption circuit 34 generates a seed based on the health data and the RTC data (S164).

[0074] The encryption / decryption circuit 34 generates a key based on the seed. If the key generation algorithm is the RSA algorithm, the encryption / decryption circuit 34 generates a public key and a private key based on the seed (S166).

[0075] The encryption / decryption circuit 34 encrypts the user data using the private key or the public key (S168).

[0076] The CPU 20 reads the start address for the encrypted data from the DRAM 16, and writes the key table (FIG. 4) to the security data area 14a of the NAND memory 14 via the NAND I / F circuit 24 (S170).

[0077] The CPU 20 may execute writing of the key table (S170) before transmitting the user data (S162).

[0078] The CPU 20 causes an ECC circuit (not shown) to perform ECC on the data encrypted by the encryption / decryption circuit 34, and writes a codeword having ECC parity and the encrypted data from the starting address of the user data area 14b of the NAND memory 14 via the NAND I / F circuit 24 (S172).

[0079] The CPU 20 may execute the writing of the key table (S170) and the writing of the codeword (S172) in the reverse order.

[0080] After writing the codeword (S172), the writing process ends.

[0081] FIG. 7 is a flowchart for explaining an outline of a second example of the read process of the memory system 4 according to the first embodiment.

[0082] The host 2 sends a read request to the memory system 4 (S182).

[0083] When the CPU 20 receives the read request via the host I / F circuit 22, it reads the private key corresponding to the start address from the key table stored in the security data area 14a via the NAND I / F circuit 24 (S184).

[0084] The CPU 20 reads the codeword from the start address of the user data area 14b via the NAND I / F circuit 24 (S186).

[0085] The CPU 20 may execute the reading of the private key (S184) and the reading of the codeword (S186) in the reverse order.

[0086] The CPU 20 causes the ECC circuit to execute error correction decoding processing on the encrypted data included in the codeword (S188). The CPU 20 transmits the data that has been error correction decoded by the ECC circuit as encrypted data to the host 2 via the host I / F circuit 22, and also transmits the private key to the host 2 via the host I / F circuit 22 (S189).

[0087] The host 2 decrypts the encrypted data using the private key to obtain the user data (S190), after which the read process ends.

[0088] In the first example of the write / read process, the memory system 4 decrypts the data, and only the host 2 used by a password-authenticated user can read the data; a third party who does not know the password cannot read the data. If the data processing performance of the memory system 4 is lower than that of the host 2, the read latency may be higher than in the second example described below.

[0089] In the second example of the write / read process, host 2 decrypts the data, so the read latency is not higher than in the first example. However, all users who access host 2 can know the private key, so the confidentiality of the data may be worse than in the first example.

[0090] The health data will be described. FIG. 8 is a diagram for explaining an example of health data according to the first embodiment. The CPU 20 transmits a health status command including an argument to the NAND memory 14. The argument can be set to one of a plurality of values, for example, one of two values, 91h and 93h. The NAND memory 14 returns health data (91h) to the CPU 20 in response to the health status command with an argument of 91h. The health data (91h) is 10 bytes of data. The 1-byte data at byte position 00h represents the argument (91h) of the health status command. The 1-byte data at byte position 01h represents the status. The status indicates whether the read by the health status command was successful or unsuccessful. The 4-byte data from byte position 10h represents the total amount of data written to the NAND memory 14 (total write size). The 4-byte data from byte position 14h represents the total amount of data read from the NAND memory 14 (total read size).

[0091] The NAND memory 14 returns health data (93h) to the CPU 20 in response to the health status command with an argument of 93h. The health data (93h) is 26 bytes of data. The 1-byte data at byte position 00h represents the argument (93h) of the health status command. The 1-byte data at byte position 01h represents the status. The 4-byte data from byte position 10h represents the minimum number of erases per first type block. The 4-byte data from byte position 14h represents the maximum number of erases per first type block. The 4-byte data from byte position 18h represents the average number of erases per first type block. The 4-byte data from byte position 20h represents the minimum number of erases per second type block. The 4-byte data from byte position 24h represents the maximum number of erases per second type block. The 4-byte data from byte position 28h represents the average number of erases per second type block.

[0092] The memory cells include memory cells that store one bit of data per cell and memory cells that store multiple bits of data per cell. The blocks include multiple types of blocks according to the number of bits of data to be stored per cell. The blocks include a single level cell (SLC) block that stores one bit of data per cell and a block that can store multiple bits of data per cell. The blocks that can store multiple bits of data per cell include a multi level cell (MLC) block that can store two bits of data per cell, a plurality of triple level cell (TLC) blocks that can store three bits of data per cell, and a quad level cell (QLC) block that can store four bits of data per cell. The example of health data (93) in FIG. 8 is an example in which the blocks of the NAND memory 14 include an SLC block and a TLC block. An example of the first type of block is a TLC block, and an example of the second type of block is an SLC block.

[0093] When the memory system 4 is an SSD, the controller 12 is configured as a separate package from the NAND memory 14. When the memory system 4 is an eMMC, the controller 12 is configured as the same package as the NAND memory 14. In an SSD or eMMC, a part of a TLC block can be used as an SLC block. This part of a TLC block used as an SLC block is called a pSLC block. In the case of an eMMC, the health data (93h) includes the minimum, maximum, and average number of erase counts for each pSLC block instead of the minimum, maximum, and average number of erase counts for each SLC block.

[0094] At least one of Health Data (91h) and Health Data (93h) is used to generate the public and private keys.

[0095] 9(a), (b), (c), and (d) are diagrams for explaining an example of health data used for key generation according to the first embodiment. Hereinafter, key generation means generation of a public key and a private key. The CPU 20 generates a key based on 36 bytes (0x24) of health data consisting of health data (91h) and health data (93h). 10 bytes of data at byte positions 00h, 01h, and 10h-17h of health data (91h) are set as 10 bytes of data at byte positions 0-9 of the 36 bytes of health data for key generation. 26 bytes of data at byte positions 00h, 01h, 10h-1Bh, and 20h-2Bh of health data (93h) are set as 26 bytes of data at byte positions A-23 of the 36 bytes of health data for key generation. Health data 91-0x00 in FIG. 9 represents data at byte position 00h of health data (91h). Health data 93-0x00 in FIG. 9 represents the data at byte position 00h of health data (93h).

[0096] The RTC data will be described. FIG. 10 is a diagram for explaining an example of RTC data according to the first embodiment. FIG. 10(a) shows an example of the data format of RTC data. The example of RTC data shown in FIG. 10 is 512 bytes. The 1-byte data at byte position 0 represents the version. The 1-byte data at byte position 1 represents RTC_INFO_TYPE. The 8-byte data r7-r0 at byte positions 2-9 represents SECONDS_PASSED (number of elapsed seconds). The 502 bytes of data at byte positions 10-511 are reserved.

[0097] The encryption / decryption circuit 34 uses SECONDS_PASSED to generate a key. SECONDS_PASSED can have multiple types of data. RTC_INFO_TYPE specifies the data type of SECONDS_PASSED.

[0098] FIG. 10(b) shows an example of the relationship between the data types RTC_INFO_TYPE and SECONDS_PASSED.

[0099] If RTC_INFO_TYPE is 0x01, the data type is absolute time, and SECONDS_PASSED represents the number of seconds from a given time, such as January 1, 0 AD, to the current time in UTC time.

[0100] If RTC_INFO_TYPE is 0x02, the data type is a relative time reference setting, SECONDS_PASSED is ignored, and the sending time of the SET_TIME command accompanied by RTC_INFO_TYPE (=0x02) is set as the relative time reference.

[0101] If RTC_INFO_TYPE is 0x03, the data type is relative time, and SECONDS_PASSED represents the number of seconds elapsed since the time of the most recent SET_TIME command accompanied by RTC_INFO_TYPE (=0x02).

[0102] FIG. 11 is a diagram for explaining an example of the operation of the RTC 28 according to the first embodiment. The user of the host 2 specifies RTC_INFO_TYPE. The host 2 transmits RTC_INFO_TYPE to the memory system 4 before encryption / decryption. When the CPU 20 receives RTC_INFO_TYPE, it transmits RTC_INFO_TYPE to the RTC 28. The RTC 28 returns SECONDS_PASSED of the type specified by RTC_INFO_TYPE to the CPU 20. For example, when RTC_INFO_TYPE is 0x01, the RTC 28 returns SECONDS_PASSED (r7-r0) representing absolute time, for example, “00 00 00 0E D7 60 B9 23” (hexadecimal number). Here, r7=00, r6=00, r5=00, r4=0E, r3=D7, r2=60, r1=B9, and r0=23.

[0103] An example of encryption / decryption by the encryption / decryption circuit 34 will be described.

[0104] 12 is a block diagram for explaining a detailed example of the encryption / decryption circuit 34 according to the first embodiment. The encryption / decryption circuit 34 includes a random number generation unit 50a, a seed generation unit 50b, a key generation unit 50c, an encryption unit 50d, a decryption unit 50e, and buffer memories 50f and 50g. The seed generation unit 50b and the key generation unit 50c generate a public key and a private key according to a certain algorithm, here the RSA algorithm.

[0105] Fig. 13 is a flowchart for explaining the first half of a detailed example of the encryption process of the encryption / decryption circuit 34 according to the first embodiment. Fig. 14 is a flowchart for explaining the second half of a detailed example of the encryption process of the encryption / decryption circuit 34 according to the first embodiment.

[0106] The CPU 20 transmits a health status command with an argument set to 91h to the NAND memory 14 (S306).

[0107] The NAND memory 14 returns the health data (91h) to the CPU 20.

[0108] The CPU 20 transmits the health data (91h) to the encryption / decryption circuit 34 (S308).

[0109] The encryption / decryption circuit 34 writes the health data (91h) to byte positions 0-9 of the buffer memory 50f (S309). The buffer memory 50f stores 36 bytes of health data as shown in FIG.

[0110] The CPU 20 transmits a health status command with an argument set to 93h to the NAND memory 14 (S310).

[0111] The NAND memory 14 returns the health data (93h) to the CPU 20.

[0112] The CPU 20 transmits the health data (93h) to the encryption / decryption circuit 34 (S312).

[0113] The encryption / decryption circuit 34 writes the health data (93h) to byte position A-23 of the buffer memory 50f (S313).

[0114] The encryption / decryption circuit 34 reads the 36 bytes of health data from the buffer memory 50f, and inputs the health data to the seed generation unit 50b (S314).

[0115] The RTC circuit 28 constantly transmits the RTC data to the CPU 20. The CPU 20 constantly transmits the RTC data to the encryption / decryption circuit 34.

[0116] The encryption / decryption circuit 34 inputs the RTC data transmitted from the CPU 20 to the random number generation unit 50a (S316).

[0117] The random number generation unit 50a generates the following random numbers based on SECONDS_PASSED (r7-r0) in the RTC data, and inputs the random numbers to the seed generation unit 50b (S318).

[0118] Random number = r7 3 +r6 2 +r5 3 +r4 3 +r3 2 +r2 4 +r1 2 +r0 3 formula 1 The exponents of each byte of data, 2, 3, and 4, are chosen so that the random number has 8 digits.

[0119] If SECONDS_PASSED(r7-r0) is “00 00 00 0E D7 60 B9 23” (hexadecimal), the random number is expressed as follows:

[0120] random number =0x00 3 +0x00 2 +0x00 3 +0x0E 3 +0xD7 2 +0x60 4 +0xB9 2+0x23 3 =85060725 Formula 2 The random numbers in equation 2 are decimal numbers.

[0121] The CPU 20 requests the host 2 to transmit a password, receives the password transmitted from the host 2, and inputs the password to the seed generation unit 50b (S320). Note that, like the second example of the write / read process shown in Fig. 6 and Fig. 7, a password is not essential for the encryption process.

[0122] The seed generation unit 50b generates a first seed and a second seed for key generation based on the 36-byte health data, the random number, and the password, and inputs the first seed and the second seed to the key generation unit 50c (S322).

[0123] Specifically, the seed generation unit 50b multiplies the health data, the random number, and the password to obtain a 360-digit product (19563...82436). The seed generation unit 50b breaks the 360-digit product into a 180-digit product consisting of odd digits and a 180-digit product consisting of even digits. For simplicity, if the product is a 10-digit number 1956384713 (D9-D0), the product consisting of odd digits (D9, D7, D5, D3, D1) is 15341, and the product consisting of even digits (D8, D6, D4, D2, D0) is 96873.

[0124] The seed generation unit 50b includes a conversion unit that converts an input into a prime number. The seed generation unit 50b inputs a 180-digit product consisting of an odd number of digits to the conversion unit, and generates a first prime number p consisting of 180 digits. The seed generation unit 50b inputs a 180-digit product consisting of an even number of digits to the conversion unit, and generates a second prime number q consisting of 180 digits. The first prime number p is a first seed, and the second prime number q is a second seed.

[0125] The key generation unit 50c generates a public key Pk and a secret key Sk based on the first seed p and the second seed q, and inputs the public key Pk to the encryption unit 50d (S324). The public key Pk is p×q. The secret key Sk is a natural number such that the remainder when Sk×e is divided by (p-1)×(q-1) is 1. Here, e is a natural number that is relatively prime to (p-1)×(q-1). For example, when p=47 and q=71, the public key Pk is 3377. If e is, for example, 79, the secret key Sk is 1019.

[0126] The encryption unit 50d uses the public key Pk to encrypt the user data m sent from the host 2, and generates the encrypted data c=m e The modPk is output (S326). The encrypted data is subjected to error correction coding processing by an ECC circuit (not shown) and then written to the user data area 14b.

[0127] The CPU 20 writes the public key Pk and the private key Sk to the security data area 14a of the NAND memory 14 (S328), after which the encryption process ends. Next, key allocation will be described.

[0128] As the number of keys used by the encryption / decryption circuit 34 increases, the confidentiality of the data increases, but the size of the security data area 14a that stores the public and private keys increases. Assuming that the size of the NAND memory 14 is constant, as the number of keys increases, the size of the user data area 14b decreases, and the cost per bit of data stored in the NAND memory 14 increases.

[0129] The CPU 20 processes user data in units of block data of a fixed size, for example, 4 KB.

[0130] FIG. 15 is a diagram for explaining a first example of key allocation in the memory system 4 according to the first embodiment. FIG. 15(a) shows an example of a key allocation table indicating a pair of a public key and a private key assigned to each block data of 4 KB. In the first example of key allocation, the CPU 20 assigns a first key pair (Key-1) to the first block data (Data-1), and assigns a second key pair (Key-2) to the second block data (Data-2). Similarly, the CPU 20 assigns the nth key pair (Key-n) to the nth block data (Data-n), where n is a positive integer equal to or greater than 2.

[0131] The CPU 20 writes the key allocation table to the buffer memory 50g. When the power supply to the memory system 4 is cut off, the CPU 20 writes the key allocation table to the security data area 14a and makes it non-volatile. When the power supply to the memory system 4 is turned on, the CPU 20 writes the key allocation table stored in the security data area 14a to the buffer memory 50g.

[0132] In the first example of key allocation, a dedicated key pair is assigned to each block of data, ensuring high confidentiality of the data.

[0133] If the same key pair is used for a long time, the possibility of the private key being guessed increases, so the CPU 20 updates the key pair at a certain timing. Hereinafter, key update means updating the public key and updating the private key. Before key update, the CPU 20 reads data encrypted with the public key before update from the user data area 14b, and decrypts the encrypted data by the encryption / decryption circuit 34 using the private key. The CPU 20 re-encrypts the user data obtained by this decryption by the encryption / decryption circuit 34 using the updated public key. The CPU 20 updates the data encrypted with the public key before update stored in the user data area 14b to the re-encrypted data. In the first example of key allocation, one key update requires only updating one block of data. Therefore, the key is updated easily and quickly.

[0134] Assume that the total size of the data to be written is 100MB, the block size is 4KB, and the size of one key pair is 4KB for both the public key and private key. 1024 (=100MB / 4KB) key pairs are assigned to 100MB of data.

[0135] 15(b) is a diagram for explaining the size ratio between the user data area 14b in the NAND memory 14 and the security data area 14a that stores the key pair. In the first example of key allocation, the size of the key pair and the size of the block data are the same, and one key pair is allocated to each block data, so the ratio of the security data area 14a in the NAND memory 14 is 50%. Therefore, the ratio of the user data area 14b that stores data in the NAND memory 14 is 50%.

[0136] Fig. 16 is a diagram for explaining a second example of key allocation in the memory system 4 according to the first embodiment. Fig. 16(a) shows an example of a key allocation table indicating a key pair allocated to each address range of the user data area 14b. Data of a predetermined size, i.e., a plurality of data corresponding to a plurality of code words, is stored in one address range. For example, n pieces of 4KB block data are stored in an address range storing 16MB of data, and one 4KB key pair is assigned to the n pieces of block data.

[0137] In a second example of key assignment, the CPU 20 assigns a first key pair to n pieces of first block data, second block data, ..., nth block data stored in the first address range. The CPU 20 assigns a second key pair to n pieces of (n+1)th block data, (n+2)th block data, ..., 2nth block data stored in the second address range. Similarly, the CPU 20 assigns an Nth key pair to n pieces of ((N-1)xn+1)th block data, ((N-1)xn+2)th block data, ..., (Nxn)th block data stored in the Nth address range. N is a positive integer equal to or greater than 2.

[0138] 16(b) is a diagram for explaining the size ratio between the user data area 14b that stores data and the security data area 14a that stores a key pair in the NAND memory 14. If the key pair size is 4 KB and the storage capacity of the NAND memory 14 is 64 GB, the data storage area 14b is 61 GB and the key pair storage area 14a is 3 GB.

[0139] According to the second example of key allocation, the ratio of the storage area 14a of the key pair in the NAND memory 14 is smaller than that in the first example of key allocation, and the ratio of the storage area 14a of the data in the NAND memory 14 is larger than that in the first example of key allocation. Therefore, the cost per bit of data stored in the NAND memory 14 in the second example of key allocation is lower than that in the first example of key allocation. However, updating one key also requires updating the data. Updating the data requires decrypting all data stored in one address range, re-encrypting the data obtained by the decryption, erasing the data, and re-writing the re-encrypted data. Therefore, in the second example of key allocation, key updating is more complicated and takes more time than in the first example of key allocation.

[0140] Fig. 17 is a diagram for explaining a third example of key allocation in the memory system 4 according to the first embodiment. Fig. 17(a) shows an example of a key allocation table showing a plurality of key pairs allocated to each address range of the user data area 14b. An upper limit number of key pairs that can be allocated to one address range is set. The upper limit number is, for example, 3.

[0141] In a third example of key assignment, the CPU 20 assigns any one of the first to third block data to each block data stored in the first address range. For example, the CPU 20 assigns the first key pair to the first, second, and third block data, the second key pair to the fourth block data, the third key pair to the fifth and sixth block data, and the first key pair to the n-th block data.

[0142] The CPU 20 assigns a fifth key pair to the (n+1)th block data and the (n+2)th block data stored in the second address range, a sixth key pair to the (n+3)th block data, and a seventh key pair to the 2nth block data.

[0143] The CPU 20 assigns the eighth key pair to the (2n+1)th block data stored in the third address range.

[0144] 17(b) is a diagram for explaining the size ratio between the user data area 14b and the security data area 14a that stores the key pair in the NAND memory 14. If the key pair size is 4 KB and the storage capacity of the NAND memory 14 is 64 GB, the user data storage area 14b is 54.4 GB and the key pair storage area 14a is 9.6 GB.

[0145] According to the third key allocation example, the data storage area in the NAND memory 14 is somewhat smaller than that in the second key allocation example. However, updating one key requires updating fewer pieces of data than the number of pieces of data stored in one address range. Therefore, updating the key in the third key allocation example is easier and takes less time than that in the second key allocation example, which requires updating all of the data stored in one address range. Since the NAND memory 14 deteriorates due to writing to update data, the NAND memory 14 is less likely to deteriorate in the third key allocation example than in the second key allocation example.

[0146] The timing of key generation will be described below. Hereinafter, key generation includes new generation and updates that require updating of data after generation. New generation does not require updating of data.

[0147] Fig. 18 is a diagram for explaining three examples of key generation timing in the memory system 4 according to the first embodiment. In the explanation of Fig. 18, it is assumed that the third example of key allocation is used for key allocation. However, the first and second examples of key allocation may be used instead of the third example of key allocation.

[0148] 18(a) is a diagram for explaining a first example of key generation timing. The first example of the key generation timing tg is after the host 2 has received a plurality of write requests Wr-1, Wr-2, Wr-3, Wr-4, Wr-5, ... in succession.

[0149] After receiving a write request, the CPU 20 generates a public key and a private key pair for each block data constituting the user data included in the write request. If only the upper limit number or less of key pairs are assigned to the address range storing the user data included in the write request, the CPU 20 assigns the generated new key pair to the block data included in the write request (new generation). If the upper limit number of keys have already been assigned to the address range storing the user data included in the write request, the CPU 20 updates one of the keys already assigned to that address range with the generated new key. The determination of the key to be updated will be described later.

[0150] 18(b) is a diagram for explaining a second example of the key generation timing. The second example of the key generation timing tg is the timing of error detection during a host read. Assume that the host 2 repeatedly transmits multiple read requests Rd-1, Rd-2, ....

[0151] When the CPU 20 receives a read request, it reads user data of a size specified by the data size from the start address, checks the ECC of the read data, and determines whether the read data contains a correctable error. If the read data contains a correctable error (Rd-Err), the CPU 20 corrects the error and sends the corrected data to the encryption / decryption circuit 34. The CPU 20 generates a key pair and sends the key pair to the encryption / decryption circuit 34. The encryption / decryption circuit 34 decrypts the corrected data. The CPU 20 sends the user data obtained by decryption to the host 2. The CPU 20 updates the key pair assigned to the read data to the new key pair that has been generated.

[0152] FIG. 18(c) is a diagram for explaining a third example of key generation timing. The third example of the key generation timing tg is an error detection timing during patrol read. In patrol read, in order to detect a block with an increased number of errors, the controller 12 generates a read request, regardless of a read request from the host 2, transmits the generated read request to the NAND memory 14, reads data from a specific address in the NAND memory 14, and checks the degree of error in the read data. The controller 12 performs patrol read during an idle period in which no write request or read request is received from the host 2. Id-10 and Id-20 represent patrol read periods of 10 minutes and 20 minutes, respectively (periods in which no errors are detected by patrol read).

[0153] During patrol read, similar to when a read request is received from the host, the CPU 20 reads data from the user data area 14b, performs error correction processing on the read data, and determines whether the error can be corrected. If the error can be corrected (Id-Err), the CPU 20 obtains the data after the error has been corrected.

[0154] The CPIU 20 inputs the error-corrected data as encrypted data to the encryption / decryption circuit 34. The encryption / decryption circuit 34 decrypts the input encrypted data. That is, the CPU 20 decrypts data based on data read from the NAND memory 14 during a patrol read.

[0155] The CPU 20 generates a key pair and transmits the key pair to the encryption / decryption circuit 34. The encryption / decryption circuit 34 encrypts the decrypted data. The CPU 20 updates the data before error correction stored in the user data area 14b to encrypted data after error correction. Writing for updating is called refresh writing.

[0156] FIG. 19 is a diagram for explaining an example of a process in which the memory system 4 according to the first embodiment generates a key according to the first, second and third examples of key generation timing. In the explanation of FIG. 19, it is assumed that the third example of key allocation is used for key allocation. However, the first and second examples may be used instead of the third example of key allocation. FIG. 19(a) shows a process in a certain time period, FIG. 19(b) shows a process in a time period following FIG. 19(a), FIG. 19(c) shows a process in a time period following FIG. 19(b), and FIG. 19(d) shows a process in a time period following FIG. 19(c).

[0157] When the CPU 20 receives a write request Wr-1 for address range 1 from the host 2 (timing t1), it generates a new key pair. At timing t1, it is assumed that only the upper limit number or less of key pairs are assigned to the address range 1. Therefore, the CPU 20 assigns the newly generated key pair to the block data included in the write request. The CPU 20 causes the encryption / decryption circuit 34 to encrypt the block data included in the write request using the generated public key.

[0158] When the CPU 20 receives a write request Wr-2 for address range 2 from the host 2 (timing t2), it generates a new key pair. Assume that even at timing t2, only the upper limit number or less of key pairs are assigned to address range 2. Therefore, the CPU 20 assigns the newly generated key pair to the block data included in the write request. The CPU 20 causes the encryption / decryption circuit 34 to encrypt the user data included in the write request using the generated public key.

[0159] After receiving the two read requests Rd-1 and Rd-2, when the CPU 20 receives a new write request Wr-1 (timing t3), it generates a new key pair or updates the key pair stored in the security data area 14a.

[0160] When the CPU 20 receives a write request Wr-2 for a certain address range when a maximum number of key pairs has already been assigned to the certain address range (timing t4), the CPU 20 updates one of the maximum number of key pairs assigned to the certain address range.

[0161] After receiving a plurality of read requests Rd-1, Rd-2, . . . from the host 2, the CPU 20 detects an error Rd-Err in the read data (timing t5) and updates the key pair.

[0162] When the CPU 20 receives a new write request Wr-1 (timing t6) after detecting an error in the read data (Rd-Err), it generates a key pair or updates the key pair.

[0163] After a 10-minute patrol period Id-10 and a 20-minute patrol period Id-20, the CPU 20 receives two read requests Rd-1, Rd-2 and a write request Wr-1 (timing t7), and generates or updates a key pair.

[0164] After a read request Rd-1, a 10-minute patrol period Id-1, and a 20-minute patrol period Id-20, the CPU 20 detects an error Id-Err by a patrol read (timing t8) and updates the key pair.

[0165] When the CPU 20 receives a write request Wr-1 after receiving the two read requests Rd-1 and Rd-2 (timing t9), it generates or updates a key pair.

[0166] After a 10-minute patrol read period Id-10 and a 20-minute patrol read period Id-20, the controller 12 receives a read request Rd-1 and a write request Wr-1 (timing t10) and generates or updates a key pair.

[0167] When the CPU 20 receives a write request Wr-2 for a certain address range (at timing t11) in a state where a maximum number of key pairs have already been assigned to the certain address range, the CPU 20 updates one of the maximum number of key pairs assigned to the certain address range.

[0168] After a 10-minute patrol read period Id-10 and a 20-minute patrol read period Id-20, the CPU 20 detects an error Id-Err by patrol read (timing t12) and updates the key pair.

[0169] The determination of the key pair to be updated during key updating will now be described.

[0170] 20 is a diagram for explaining an example of a key update table used to determine a key to be updated in the third example of key allocation in the memory system 4 according to the first embodiment. The key update table is stored in the buffer memory 50g. When the power supply to the memory system 4 is cut off, the CPU 20 writes the key update table to the security data area 14a and makes it non-volatile. When the power supply to the memory system 4 is turned on, the CPU 20 writes the key update table stored in the security data area 14a to the buffer memory 50g.

[0171] The CPU 20 refers to the key update table to determine the key pair to be updated. The key update table includes address ranges, key pairs, assignment data, generation order, and the number of encryptions. The upper limit of the number of key pairs that can be assigned to each address range is, for example, 3. The assignment data indicates the block data to which the key pair is assigned. The generation order indicates the order of key generation time, with "1" meaning that the key was generated the oldest or the key was generated the longest, and "3" meaning that the key was generated the most recently or the key was generated the shortest. The number of encryptions indicates the number of block data to which the key is assigned, i.e., the size.

[0172] 17, a first key pair, a second key pair, and a third key pair are assigned to a first address range. The three key pairs are generated in the order of the first key pair, the second key pair, and the third key pair.

[0173] The first key pair was generated the oldest, its order of generation is "1", and it is assigned to the first, second, and third block data, so it has been encrypted "3 times". The second key pair was generated the second oldest, its order of generation is "2", and it is assigned to the fourth block data, so it has been encrypted "1". The third key pair was generated the newest, its order of generation is "3", and it is assigned to the fifth and sixth block data, so it has been encrypted "2".

[0174] As shown in Figure 17, the second address range is assigned the fifth, sixth, and seventh key pairs. The three keys were generated in the following order: the fifth, sixth, and seventh key pairs.

[0175] The fifth key pair is the oldest in generation time, so its generation order is "1", and it is assigned to the (n+1)th block data and the (n+2)th block data, so its encryption count is "2".

[0176] The second key pair is the second oldest in terms of generation time, so its generation order is “2”. It is assigned to the (n+3)th block data, the (n+4)th block data, and the (n+5)th block data, so its encryption count is “3”.

[0177] The seventh key pair is the most recently generated, so its generation order is "3". Since it is assigned to the (n+6)th block data and the (n+7)th block data, the number of encryption times is "2".

[0178] When the CPU 20 generates a new key pair for block data in an address range to which the upper limit number of key pairs has already been assigned, the key pair that is encrypted the least number of times is selected as the update target. The reason for this is that updating a key involves updating data, and it is desired to reduce the size of the data to be updated. The size of data to which the key pair that is encrypted the least number of times is assigned is smaller than the size of data to which other key pairs are assigned. This minimizes the amount of data written with the update, and minimizes the impact of key updates on the lifespan of the NAND memory 14.

[0179] If there are multiple key pairs with the fewest encryption times, CPU 20 selects the key pair with the smallest generation order number as the update target. The reason for this is that the key pair with the smallest generation order number is the oldest generated, and therefore has been used the longest and is considered to be more likely to be guessed. However, if there are multiple key pairs with the fewest encryption times, CPU 20 may select the most recently generated key pair or any key pair as the update target.

[0180] Figures 21 and 22 are diagrams for explaining an example of key updating by generating a new key. Figure 21(a) shows a portion of the first address range in the key allocation table shown in Figure 17. Figure 22(a) shows a portion of the first address range in the key update table shown in Figure 20.

[0181] When the CPU 20 receives a write request to write the seventh block data to an address in the first address range from the host 2, the CPU 20 generates a fourth key pair. After generating the fourth key pair, the CPU 20 assigns the fourth key pair to the seventh block data (FIG. 21(b)).

[0182] The CPU 20 updates the second key pair that has been encrypted the least number of times in the key update table shown in FIG. 22(a). Before updating the second key pair to the fourth key pair, the CPU 20 decrypts the fourth block data to which the second key pair is assigned with the private key of the second key pair, and re-encrypts the plain text obtained by the decryption with the public key of the fourth key pair. The CPU 20 encrypts the seventh block data with the public key of the fourth key pair. The CPU 20 writes the fourth block data (re-encrypted data) and the seventh block data (encrypted data) to the first address range of the user data area 14b. After this, the CPU 20 updates the second key pair to the fourth key pair (FIG. 22(b)). The generation order of the fourth key pair becomes "4". The fourth key pair is assigned to the fourth block data and the seventh block data. The number of encryption times of the fourth key pair becomes "2".

[0183] When the controller 12 receives a write request from the host 2 to write the eighth block data to an address in the first address range, the controller 12 causes the CPU 20 to generate a fifth key pair. After generating the fifth key pair, the CPU 20 assigns the fifth key pair to the eighth block data (FIG. 21(c)).

[0184] The CPU 20 selects the fourth key pair and the third key pair, which have been encrypted the least number of times in the key update table shown in FIG. 22(b), as candidates for update. The CPU 20 selects the third key pair, which has a smaller generation order value, i.e., was generated earlier, as the update target among the fourth key pair and the third key pair. Before updating the third key pair to the fifth key pair, the CPU 20 decrypts the fifth block data and the sixth block data, to which the third key pair is assigned, with the private key of the third key pair, and re-encrypts the plaintext with the public key of the fifth key pair. The CPU 20 encrypts the eighth block data with the public key of the fifth key pair. The CPU 20 writes the fifth block data (encrypted data), the sixth block data (encrypted data), and the eighth block data (encrypted data) to the first address range of the user data area 14b. After this, the CPU 20 updates the third key pair to the fifth key pair (FIG. 22(c)). The generation order of the fifth key pair becomes "5". The fifth key pair is assigned to the fifth block data, the sixth block data, and the seventh block data. The fifth key pair is encrypted three times.

[0185] 23 and 24 are flowcharts for explaining an example of a write operation of the memory system 4 according to the first embodiment.

[0186] When the CPU 20 receives a write request (S402), it refers to the key assignment table (FIG. 17) stored in the buffer memory 50g and determines whether or not the upper limit number of key pairs has been assigned to the write target address range that includes the address specified by the write request (S404).

[0187] If the upper limit number of key pairs has been assigned to the write target address range (Yes in S404), the CPU 20 generates a new key pair for each block data included in the write target user data specified by the write request (S406).

[0188] The CPU 20 refers to the key update table (FIG. 20) stored in the buffer memory 50g and determines the key pair to be updated (S408).

[0189] The CPU 20 reads the key pair to be updated from the security data area 14a (S410).

[0190] The CPU 20 reads a codeword including data encrypted with the key pair to be updated from the user data area 14b, and causes the encryption / decryption circuit 34 to perform a decryption process on the encrypted data using the key pair to be updated, thereby obtaining the user data (S412).

[0191] The CPU 20 causes the encryption / decryption circuit 34 to encrypt the user data obtained in S412 and the user data to be written using the new key pair, and obtains encrypted data (S414).

[0192] The CPU 20 updates the key allocation table (FIG. 17) and the key update table (FIG. 20) (S416).

[0193] The CPU 20 writes the codeword including the encrypted data to the user data area 14b (S418). The CPU 20 may reverse the process of updating the table (S416) and writing the codeword (S418).

[0194] Thereafter, the CPU 20 reports the completion of the write to the host 2 (S420) and ends the write operation.

[0195] If the number of key pairs assigned to the write target address range is equal to or less than the upper limit number (S404 No), the CPU 20 determines whether or not at least one key pair is assigned to the write target address range (S424).

[0196] If not even one key pair has been assigned to the address range to which data is to be written (No in S424), the CPU 20 generates a new key pair for each block data included in the data to be written (S426).

[0197] The CPU 20 causes the encryption / decryption circuit 34 to encrypt the user data to be written using the new key pair, and obtains the encrypted data (S428).

[0198] The CPU 20 updates the key assignment table (FIG. 17) and the key update table (FIG. 20) (S430).

[0199] The CPU 20 writes the codeword containing the encrypted data to the user data area 14b (S418). The process of updating the table (S430) and writing the codeword (S418) may be executed inversely.

[0200] Thereafter, the controller 12 reports the completion of the write to the host 2 (S420), and ends the write operation.

[0201] If at least one key pair has been assigned to the write target address range (Yes in S424), the CPU 20 reads the key pair that was most recently used in the write target address range from the key update table (FIG. 20) (S434).

[0202] The CPU 20 causes the encryption / decryption circuit 34 to encrypt the user data to be written, which is specified by the write request, using the most recently used key pair, and obtains encrypted data (S436).

[0203] The CPU 20 updates the key update table (FIG. 20) (S438).

[0204] The CPU 20 writes the codeword including the encrypted data to the user data area 14b (S418). The CPU 20 may reverse the process of rewriting the table (S438) and writing the codeword (S418).

[0205] Thereafter, the CPU 20 reports the completion of the write to the host 2 (S420) and ends the write operation.

[0206] FIG. 25 is a flowchart for explaining an example of a read operation of the memory system 4 according to the first embodiment.

[0207] When the CPU 20 receives a read request (S502), it refers to the key assignment table (FIG. 17) stored in the buffer memory 50g and reads out the key pair assigned to the read target address range that includes the address specified by the read request (S504).

[0208] The CPU 20 reads from the user data area 14b a codeword including the data to be read (encrypted data) specified by the read request (S506).

[0209] The CPU 20 checks the ECC of the read codeword, and if the encrypted data contains a correctable error, corrects the error (S508).

[0210] If the error is corrected, the CPU 20 performs refresh writing. The CPU 20 determines whether the error has been corrected, that is, whether refresh writing of the NAND memory 14 is necessary (S512).

[0211] If refresh writing is necessary (Yes in S512), the CPU 20 finds an address range of the same size as the address range to be read (S514).

[0212] The CPU 20 causes the encryption / decryption circuit 34 to execute the decryption process using the key pair read out in S504 on the encrypted data after the error correction, thereby obtaining the user data (S516).

[0213] The CPU 20 generates a new key pair (S518).

[0214] The CPU 20 causes the encryption / decryption circuit 34 to encrypt the user data obtained in S516 using the new key pair, thereby obtaining re-encrypted data (S520).

[0215] The CPU 20 updates the key allocation table (FIG. 17) and the key update table (FIG. 20) (S522).

[0216] The CPU 20 writes the codeword including the re-encrypted data to the user data area 14b, and updates the encrypted data to the re-encrypted data (S524).

[0217] Thereafter, the CPU 20 transmits the user data obtained in S516 to the host 2 (S526), ​​and ends the read operation.

[0218] If refresh writing is not required (No at S512), the CPU 20 causes the encryption / decryption circuit 34 to execute decryption processing using the key pair read at S504 on the encrypted data after error correction, and obtains user data (S532).

[0219] Thereafter, the CPU 20 transmits the user data obtained in S532 to the host 2 (S534), and ends the read operation.

[0220] FIG. 26 is a flowchart for explaining an example of a patrol read operation of the memory system 4 according to the first embodiment.

[0221] The CPU 20 judges whether or not an idle period during which no write request or read request is received from the host 2 has reached a certain period (S602).

[0222] If the idle period reaches a certain period (Yes in S602), the CPU 20 reads a code word including encrypted data stored at a certain address from the user data area 14b (S604).

[0223] The CPU 20 checks the ECC of the read codeword, and if the encrypted data contains a correctable error, corrects the error (S606).

[0224] The CPU 20 determines whether the error has been corrected, that is, whether refresh writing to the NAND memory 14 is necessary (S608).

[0225] If refresh writing is necessary (S608 Yes), the CPU 20 causes the encryption / decryption circuit 34 to perform a decryption process on the encrypted data after error correction using the key pair assigned to the read data, thereby obtaining user data (S612).

[0226] The CPU 20 generates a new key pair (S614).

[0227] The CPU 20 causes the encryption / decryption circuit 34 to encrypt the user data obtained in S612 using the new key pair, thereby obtaining re-encrypted data (S616).

[0228] The CPU 20 updates the key assignment table (FIG. 17) and the key update table (FIG. 20) (S618).

[0229] The CPU 20 writes the codeword including the re-encrypted data to the user data area 14b, and updates the encrypted data to the re-encrypted data (S620). After that, the CPU 20 determines whether the idle period has reached a certain period (S602).

[0230] If refresh writing is not required (S608 No), the CPI 20 determines whether the idle period has reached a certain period (S602).

[0231] The memory system 4 according to the embodiment generates a key when it receives data to be written to the NAND memory 14 from the host 2. The memory system 4 generates the key based on the RTC data output by the RTC 28 and health data indicating the degradation state of the NAND memory 14. The memory system 4 uses the key to encrypt the data by the encryption / decryption circuit 34, and writes a codeword including the encrypted data and the key to the NAND memory 14. The NAND memory 14 includes a security data area 14a and a user data area 14b. The host 2 can access the user data area 14b but cannot access the security data area 14a. The memory system 4 writes the encrypted data to the user data area 14b and writes the key to the security data area 14a.

[0232] Because the time data and health data on which the key is generated change over time, it is difficult for a third party to guess the key. Therefore, a third party cannot decrypt the encrypted data.

[0233] The storage area of ​​the NAND memory 14 is divided into multiple address ranges. Code words corresponding to multiple data blocks are stored in each address range. A key is assigned to each data block. In order to reduce the storage capacity of the keys, the memory system 4 assigns only a predetermined number of keys to each address range and assigns the same key to multiple data blocks.

[0234] The memory system 4 detects an error during reading. If the memory system 4 detects a correctable error, it corrects the error and performs a refresh write. The memory system 4 also generates a key when performing a refresh write.

[0235] When generating a key when a predetermined number of keys have already been assigned to a certain address range, the memory system 4 erases one of the predetermined number of keys and assigns a newly generated key to the certain address range instead. Before erasing the already assigned key, the memory system 4 decrypts data encrypted with the key to be erased to obtain plaintext, and re-encrypts the plaintext with the newly generated key. The memory system 4 erases the encrypted data and writes the re-encrypted data to the address where the encrypted data was stored, thereby updating the encrypted data to the re-encrypted data.

[0236] Since the key update requires only updating the code words within a certain address range and does not require updating all the code words stored in the NAND memory 14, the key update is completed in a short time and the deterioration of the NAND memory 14 is small.

[0237] Furthermore, since the key to be updated is selected so as to minimize the amount of data to be re-encrypted, the key update time is short and the degree of deterioration of the NAND memory 14 is also small.

[0238] Although some embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These embodiments and their modifications are included in the scope and spirit of the invention, and are included in the scope of the invention and its equivalents described in the claims. [Explanation of symbols]

[0239] 2... host, 4... memory system, 12... controller, 14... NAND memory, 28... RTC, 34... encryption / decryption circuit

Claims

1. A non-volatile memory; a controller that generates a key based on time data and health data representing a degradation state of the non-volatile memory, encrypts data using the key, and writes the encrypted data to the non-volatile memory; A memory system comprising:

2. 2. The memory system according to claim 1, wherein the time data represents an absolute time output from a real-time clock or a relative time from a certain reference time output from a real-time clock.

3. The memory system according to claim 1 , wherein the health data indicates a total write size or a total read size of the non-volatile memory.

4. The memory system of claim 1 , wherein the health data represents an erase count of the non-volatile memory.

5. the non-volatile memory includes a memory cell array including a plurality of blocks; 5. The memory system according to claim 4, wherein the health data represents a minimum value, a maximum value, and an average value of the number of erase operations for each of the plurality of blocks.

6. the non-volatile memory includes a storage area divided into a plurality of address ranges; The memory system of claim 1 , wherein the controller generates a plurality of keys, each key corresponding to a respective one of the plurality of address ranges.

7. The controller: generating a predetermined number of keys for each of the plurality of address ranges; writing the predetermined number of keys for each of the plurality of address ranges into the non-volatile memory; 7. The memory system of claim 6, wherein when a first key is generated for an address range for which the predetermined number of keys are generated, a second key among the predetermined number of generated keys stored in the non-volatile memory is updated to the first key.

8. 8. The memory system of claim 7, wherein when the controller generates the first key, the controller decrypts encrypted data encrypted with the second key with the second key, encrypts the data decrypted with the second key with the first key, and writes the data encrypted with the first key to the non-volatile memory.

9. 8. The memory system according to claim 7, wherein a size of data corresponding to said second key is smaller than a size of data corresponding to keys other than said second key among said predetermined number of keys.

10. 10. The memory system of claim 9, wherein when a size of data corresponding to a key other than the second key among the predetermined number of keys is the same as a size of data corresponding to the second key, the second key is generated earlier than a time when the key other than the second key among the predetermined number of keys is generated.

11. 2. The memory system according to claim 1, wherein when the controller receives a plurality of write requests in succession, the controller newly generates at least one key for encrypting at least one piece of data specified in each of the plurality of write requests.

12. The controller: When the first data encrypted using the third key is read from the non-volatile memory and an error contained in the read first data is corrected, 2. The memory system of claim 1, further comprising: reading second data encrypted using the third key from the non-volatile memory and decrypting the second data; generating a fourth key; encrypting the error-corrected first data using the fourth key; encrypting the second data using the fourth key; and writing the first data encrypted using the fourth key and the second data encrypted using the fourth key to the non-volatile memory.

13. The host is reachable, The memory system according to claim 12 , wherein the controller reads the first data encrypted using the third key from the non-volatile memory in response to a read request from the host.

14. 1. A method for controlling a non-volatile memory, comprising: reading out health data indicative of a degradation state of the non-volatile memory; generating a key based on the time data and the retrieved health data; encrypting data using the generated key; writing data based on the encrypted data to the non-volatile memory.

Citation Information

Patent Citations

  • Nonvolatile memory device and encryption key generating method

    JP2012034268A

  • Storage device, data storage method, and data controller

    JP2013062616A

  • Encryption key storage and modification in a data storage device

    US9659191B2