Authorization encryption circuit and authorization encryption method

By designing an authorization encryption circuit in DRAM and judging the command address signal to control the authorization encryption mode, the problem of DRAM being vulnerable to attacks is solved and data security is improved.

CN118627142APending Publication Date: 2024-09-10RUILI INTEGRATED CIRCUIT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410841957.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing DRAM storage cells are vulnerable to line hammer attacks, causing unexpected flipping of stored data and threatening memory security.

Method used

Design an authorization encryption circuit. Through the command decoding module and authorization encryption module, it determines whether the command address signal meets the preset conditions. If it meets, it generates an authorization encryption entry or exit signal, controls the DRAM to enter or exit the automatic authorization encryption mode, and blocks or allows Read and write commands to ensure that only authenticated commands are executed.

Benefits of technology

It effectively prevents DRAM attacks and data tampering, increases the security of the storage unit, and ensures that only qualified instructions are executed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118627142A
    Figure CN118627142A
Patent Text Reader

Abstract

The embodiment of the invention provides an authorization encryption circuit and an authorization encryption method, and the authorization encryption circuit comprises a command decoding module which is configured to decode a received command address signal, generate an authorization encryption entry signal if a first preset condition is met, and generate an authorization encryption exit signal if a second preset condition is met; and the authorization encryption module is configured to receive an authorization encryption entry command and an authorization encryption exit command, if the authorization encryption entry command is valid, the read-write command is shielded, and if the authorization encryption exit command is valid, the read-write command is normally operated. By judging whether the command address signal meets the preset condition, the DRAM is controlled to enter the authorized encryption mode and shield the read-write command, or the DRAM is controlled to exit the authorized encryption mode and normally operate the read-write command, so that only the command meeting the condition can be executed by the DRAM, the DRAM is prevented from being attacked, storage data is prevented from being tampered, and the security of the DRAM is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The disclosed embodiments relate to the field of semiconductor technology, and in particular to an authorization encryption circuit and an authorization encryption method. Background Art

[0002] In the semiconductor industry, the storage cell of a memory chip such as a dynamic random access memory (DRAM) consists of a transistor and a capacitor. There are many attacks against DRAM, such as the row hammer attack, which exploits the unexpected charge leakage effect of the capacitor generated during the operation of DRAM. When the storage cells corresponding to a row of DRAM are frequently activated, the capacitors of adjacent rows may receive electromagnetic interference, causing the stored data to flip. This data flip can be used maliciously, and the attacker can cause changes in the stored data value in the memory area that he originally has no access to, resulting in memory security issues. Summary of the invention

[0003] The embodiments of the present disclosure provide an authorization encryption circuit and an authorization encryption method.

[0004] According to some embodiments of the present disclosure, a first aspect of the embodiments of the present disclosure provides an authorization encryption circuit, including: a command decoding module, configured to decode a received command address signal, and generate an authorization encryption entry signal if a first preset condition is met, and generate an authorization encryption exit signal if a second preset condition is met; an authorization encryption module, configured to receive the authorization encryption entry signal and the authorization encryption exit signal, and shield the read and write commands if the authorization encryption entry signal is valid, and perform normal operations on the read and write commands if the authorization encryption exit signal is valid.

[0005] In some embodiments, the authorization encryption circuit also includes: an initial configuration module, configured to receive the authorization encryption entry signal and the initial configuration completion signal, and set the configuration signal to a first preset value, wherein the configuration signal includes a CPU identification signal and the initial configuration completion signal.

[0006] In some embodiments, the authorization encryption circuit further includes: a key generation module configured to receive the obfuscation code, the CPU identification signal and the internal key and perform encryption operations to generate a dynamic key.

[0007] In some embodiments, the first preset condition includes a third sub-preset condition and a fourth sub-preset condition, the second preset condition includes a fifth sub-preset condition and a sixth sub-preset condition, the command address signal includes a first sub-command address signal and a second sub-command address signal, and the command decoding module includes: a first matching module, configured to compare the received dynamic key with the fourth sub-preset condition, and if they are consistent, output a first matching signal; a first triggering module, configured to compare the received first sub-command address signal with the third sub-preset condition in response to the first matching signal, and if they are consistent, generate the authorized encrypted entry signal; or, the first matching module, configured to compare the received dynamic key with the sixth sub-preset condition, and if they are consistent, output a second matching signal; the first triggering module, configured to compare the received first sub-command address signal with the fifth sub-preset condition in response to the second matching signal, and if they are consistent, generate the authorized encrypted exit signal; wherein the second sub-command signal corresponds to the received dynamic key.

[0008] In some embodiments, the authorization encryption module includes: a mask command generation module, configured to receive the authorization encryption entry signal, the authorization encryption exit signal and the initial configuration completion signal, and generate a mask command; a read-write command module, configured to receive the read-write command, and if the mask command is valid, output an invalid read-write command, and if the mask command is invalid, output a valid read-write command.

[0009] In some embodiments, the masking command generation module further receives a training mode completion signal, and is configured to generate the masking command when the training mode completion signal is valid.

[0010] In some embodiments, the authorization encryption circuit further includes: an obfuscation code update module configured to receive the obfuscation code, the CPU identification signal and the authorization encryption exit signal, and generate an updated obfuscation code.

[0011] According to some embodiments of the present disclosure, the second aspect of the embodiments of the present disclosure also provides an authorization encryption method, including: the DRAM receives the dynamic key sent by the CPU and decodes it, determines whether it is consistent with the internal key of the DRAM, and if so, enters an automatic authorization encryption mode, wherein the DRAM shields read and write commands in the automatic authorization encryption mode; the DRAM receives the dynamic key sent by the CPU and decodes it, determines whether it is consistent with the internal key of the DRAM, and if so, exits the automatic authorization encryption mode.

[0012] In some embodiments, before the DRAM enters the automatic authorization encryption mode, it also includes: the CPU reads the register information inside the DRAM to determine whether it is the target DRAM, and if so, sends a command address signal that meets the first preset condition to set the DRAM to start the automatic authorization encryption mode, and the command address signal includes a dynamic key.

[0013] In some embodiments, after the DRAM is set to start the automatic authorization encryption mode and before the DRAM enters the automatic authorization encryption mode, it also includes: determining whether the initial configuration completion signal is a first preset value, and if not, starting the initialization configuration.

[0014] In some embodiments, after starting the initialization configuration process and before the DRAM enters the automatic authorization encryption mode, it also includes: training the command address signal.

[0015] In some implementations, after the DRAM exits the authorized encryption mode, the method further includes: generating an updated obfuscated code.

[0016] The disclosed embodiment provides an authorization encryption circuit and an authorization encryption method, wherein the authorization encryption circuit includes: a command decoding module, configured to decode the received command address signal, and if it meets the first preset condition, generate an authorization encryption entry signal, and if it meets the second preset condition, generate an authorization encryption exit signal; an authorization encryption module, configured to receive the authorization encryption entry signal and the authorization encryption exit signal, and if the authorization encryption entry signal is valid, shield the read and write commands, and if the authorization encryption exit signal is valid, perform normal operations on the read and write commands. In this way, by judging whether the command address signal meets the preset conditions, the DRAM is controlled to enter the authorization encryption mode, shield the read and write commands, or control the DRAM to exit the authorization encryption mode, and perform normal operations on the read and write commands, so that only instructions that meet the conditions can be executed by the DRAM, thereby preventing the DRAM from being attacked and tampering with the stored data, and increasing the security of the DRAM. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings, which do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, and the figures in the drawings do not constitute a scale limitation unless otherwise stated. In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the traditional technology, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 A schematic diagram of the structure of an authorization encryption circuit provided in an embodiment of the present disclosure;

[0019] Figure 2 A schematic diagram of another structure of an authorization encryption circuit provided by an embodiment of the present disclosure;

[0020] Figure 3 A schematic diagram of another structure of an authorization encryption circuit provided by an embodiment of the present disclosure;

[0021] Figure 4 A schematic diagram of the structure of a command decoding module provided in an embodiment of the present disclosure;

[0022] Figure 5 A specific circuit diagram of a command decoding module provided by an embodiment of the present disclosure;

[0023] Figure 6 A schematic diagram of the composition structure of an authorization encryption module provided in an embodiment of the present disclosure;

[0024] Figure 7 A specific circuit diagram of an authorization encryption module provided by an embodiment of the present disclosure;

[0025] Figure 8 Another specific circuit diagram of an authorization encryption module provided by an embodiment of the present disclosure;

[0026] Fig. 9 A schematic diagram of another structure of an authorization encryption circuit provided by an embodiment of the present disclosure;

[0027] Fig.10 A specific circuit diagram of an obfuscation code update module provided in an embodiment of the present disclosure;

[0028] Fig.11 A schematic diagram of the process steps of an authorization encryption method provided in an embodiment of the present disclosure;

[0029] Fig.12 A schematic diagram of another process step of an authorization encryption method provided in an embodiment of the present disclosure;

[0030] Fig.13 A schematic diagram of another process step of an authorization encryption method provided in an embodiment of the present disclosure;

[0031] Fig.14 A schematic diagram of another process step of an authorization encryption method provided in an embodiment of the present disclosure;

[0032] Fig.15 A schematic diagram of another process step of an authorization encryption method provided in an embodiment of the present disclosure;

[0033] Fig.16 A timing diagram corresponding to an authorization encryption method provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure. In addition, although the disclosure in the present disclosure is introduced according to one or several exemplary examples, it should be understood that each aspect of the disclosure can also constitute a complete implementation method separately.

[0035] It should be noted that the brief description of terms in the present disclosure is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of the present disclosure. Unless otherwise specified, these terms should be understood according to their ordinary and common meanings.

[0036] The terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar or similar objects or entities, and are not necessarily meant to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way are interchangeable under appropriate circumstances, for example, they can be implemented in an order other than those given in the diagrams or descriptions of the embodiments of the present disclosure.

[0037] In addition, the terms "include" and "have" and any variations thereof are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to those components expressly listed but may include other components not expressly listed or inherent to such products or devices.

[0038] The term "module" as used in this disclosure refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.

[0039] As Moore's Law continues to develop, the density of DRAM continues to increase. Without changing the size of the memory circuit board area, in order to store more data, the distance between storage cells is getting closer and closer. Although the chip manufacturing process has improved, the isolation between each capacitor cannot be completely isolated. When the storage cells in a row are frequently activated, the capacitors in the adjacent rows may receive electromagnetic interference, causing the stored data to flip from 1 to 0, or vice versa. This data flip can be used maliciously, and the attacker can control the location and result of the data flip through a carefully designed memory access pattern. The phenomenon of reading a row in DRAM at a high frequency and affecting the data in the adjacent rows is called the row hammer effect.

[0040] The disclosed embodiment provides an authorization encryption circuit, including: a command decoding module, configured to decode a received command address signal, and if it meets a first preset condition, generate an authorization encryption entry signal, and if it meets a second preset condition, generate an authorization encryption exit signal; an authorization encryption module, configured to receive an authorization encryption entry signal and an authorization encryption exit signal, and if the authorization encryption entry signal is valid, shield the read and write commands, and if the authorization encryption exit signal is valid, perform normal operations on the read and write commands. In this way, by judging whether the command address signal meets the preset conditions, the DRAM is controlled to enter the authorization encryption mode, shield the read and write commands, or control the DRAM to exit the authorization encryption mode, and perform normal operations on the read and write commands, so that only instructions that meet the conditions can be executed by the DRAM, thereby preventing the DRAM from being attacked and the stored data from being tampered with, and increasing the security of the DRAM.

[0041] The following will describe the various embodiments of the present disclosure in detail with reference to the accompanying drawings. However, it will be appreciated by those skilled in the art that in the various embodiments of the present disclosure, many technical details are provided in order to enable the reader to better understand the present disclosure. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present disclosure can be implemented.

[0042] In one embodiment of the present disclosure, reference Figure 1 , which shows a schematic diagram of the composition structure of an authorization encryption circuit provided by an embodiment of the present disclosure. Figure 1As shown, the authorization encryption circuit includes: a command decoding module 10, configured to decode the received command address signal CA<13:0>, and if a first preset condition is met, an authorization encryption entry signal AuthEntry is generated, and if a second preset condition is met, an authorization encryption exit signal AuthExit is generated; an authorization encryption module 20, configured to receive the authorization encryption entry signal AuthEntry and the authorization encryption exit signal AuthExit, if the authorization encryption entry signal AuthEntry is valid, the read and write command CMD is shielded, and if the authorization encryption exit signal AuthExit is valid, the read and write command CMD is operated normally.

[0043] In order to prevent the DRAM from being attacked, by decoding the command address signal CA<13:0>, when the instruction meets the first preset condition, the command decoding module 10 will generate an authorization encryption entry signal AuthEntry, indicating that the DRAM enters the automatic authorization encryption mode. During the automatic authorization encryption mode, the DRAM will only decode and execute the instructions that meet the authentication, and the instructions that do not meet the authentication will not be decoded, thereby preventing the DRAM from being attacked and tampering with the stored data. Here, during the automatic authorization encryption mode, the DRAM will only decode and execute the instructions that meet the authentication, and the instructions that do not meet the authentication will not be decoded, which means that when part of the command address signal CA<13:0> received by the DRAM meets the authentication rules, the DRAM can decode and execute the command address signal CA<13:0> normally. Here, at least one bit in the command address signal CA<13:0> can be set as an instruction bit. The more bits, the more complex the corresponding authentication instructions, and the lower the possibility of the DRAM being deciphered and attacked, thereby preventing the DRAM from being attacked and tampering with the stored data.

[0044] The authorization encryption module 20 receives the authorization encryption entry signal AuthEntry and the authorization encryption exit signal AuthExit. It is understandable that only one of the authorization encryption entry signal AuthEntry and the authorization encryption exit signal AuthExit is valid at the same time. Therefore, when the authorization encryption entry signal AuthEntry is valid, it instructs the DRAM to enter the automatic authorization encryption mode and shield the read and write commands CMD. When the authorization encryption exit signal AuthExit is valid, it instructs the DRAM to exit the automatic authorization encryption mode and perform normal operations on the read and write commands CMD. Here, the read and write commands CMD are taken as an example, but in actual operation, various operations that the DRAM may receive may be included, including but not limited to read commands, write commands, mode register read commands (Mode Register Read, MRR), mode register write commands (Mode Register Write, MRW), etc.

[0045] In order to prevent the DRAM from being attacked at any possible moment, the DRAM needs to enter the automatic authorization encryption mode as quickly as possible after power-on, that is, after the DRAM completes the training of the command address signal CA<13:0> after power-on, it should enter the automatic authorization encryption mode at the first moment, so that the DRAM can be prevented from being attacked and tampered with before it is ready. Therefore, by setting the command address signal CA<13:0> to meet the first preset condition, the DRAM can enter the automatic authorization encryption mode in time before any command operation is performed, thereby protecting the security of the DRAM.

[0046] For DRAM, after power-on and completion of training of the command address signal CA<13:0>, the CPU needs to read the information in the mode register in the DRAM through the mode register read command to determine whether the current DRAM is the target DRAM, that is, the DRAM that needs to enter the automatic authorization encryption mode. Only in this way will the CPU send the command address signal CA<13:0> that meets the first preset condition to the DRAM for decoding. Otherwise, if it is not the target DRAM, the CPU sends the command address signal CA<13:0> to the DRAM according to the normal read and write command operation, and does not involve the operation of entering the automatic authorization encryption mode.

[0047] In some embodiments, the mode register MR239 in the DRAM can be set to store a dual-inline memory module identification code (Dual-Inline-Memory-Modules, DIMM ID), the mode register 247 can be set to store a package identification code (Package ID), and the mode register 255 can be set to store a manufacturing identification code (Manufacture ID). The CPU can determine whether the current DRAM is the target DRAM, that is, the DRAM that needs to enter the automatic authorization encryption mode, by reading the information of the identification codes stored in these registers.

[0048] In one embodiment of the present disclosure, reference Figure 2 , which shows another structural diagram of an authorization encryption circuit provided by an embodiment of the present disclosure. Figure 2 As shown, the authorization encryption circuit also includes: an initial configuration module 30, which is configured to receive the authorization encryption entry signal AuthEntry and the initial configuration completion signal Config_1, set the configuration signal Config to a first preset value, and the configuration signal includes a CPU identification signal (CPU ID) and the initial configuration completion signal Config_1.

[0049] Before generating the authorization encryption entry signal AuthEntry, the CPU has determined that the current DRAM is the target DRAM by reading the information in the mode register. However, for the DRAM, if a judgment operation is required every time it is powered on and the training of the command address signal CA<13:0> is completed, it will waste time and energy consumption and affect the performance of the DRAM. Therefore, it can be set to initialize the target DRAM after generating the authorization encryption entry signal AuthEntry and before entering the automatic authorization encryption mode. Here, the initial configuration module 30 can set the configuration signal Config to a first preset value in response to the authorization encryption entry signal AuthEntry. The configuration signal Config can be a signal including 3 bits of data, wherein the initial configuration completion signal Config_1 can be the first bit of data of the configuration signal Config, that is, Config <0> . The initial configuration completion signal Config_1 is set to 1, indicating that the DRAM has passed the judgment and is identified as the target DRAM, and there is no need to repeat the judgment operation. It should be noted that since the initial configuration module 30 is configured to receive the authorization encryption entry signal AuthEntry, that is, after judging whether it is the target DRAM operation, there is no situation where the initial configuration completion signal Config_1 is set to 0, that is, it is necessary to judge again. The fuse or anti-fuse corresponding to the initial configuration completion signal Config_1 can be activated by the post-package repair circuit (Post Package Repair, PPR), and the initial configuration completion signal Config_1 is set to 1. Those skilled in the art should understand that setting the initial configuration completion signal Config_1 to 1 or 0 here is only for example, and it can be set as needed in the actual circuit.

[0050] The configuration signal Config may be a signal including 3 bits of data, wherein the CPU identification signal CPU ID may be the 2nd to 3rd bits of the configuration signal Config, i.e., Config<2:1>. In order to ensure that the DRAM will not be maliciously operated by an unidentified CPU, the corresponding CPU identification signal CPUID may also be synchronously stored in the DRAM during the initialization configuration process. In the subsequent communication process between the CPU and the DRAM, the CPU may prove its identity through the CPU identification signal CPU ID, ensuring that the DRAM can identify a secure, certified CPU during the automatic authorization encryption process and perform corresponding operations.

[0051] In order to reduce the time for the DRAM to perform the judgment operation after each power-on and completion of the command address signal CA<13:0> training, the initial configuration module 30 also receives the initial configuration completion signal Config_1. When the initial configuration completion signal Config_1 is valid, it indicates that the DRAM has been initialized and configured, and no judgment operation is required, which avoids repeated operations and improves the efficiency of the authorized encryption mode. It should be noted that the initial configuration module 30 here only needs to work once. When the received initial configuration completion signal Config_1 is invalid, it means that the DRAM has not been initialized yet. The initial configuration module 30 works to generate a valid initial configuration completion signal Config_1 and a CPU identification signal CPU ID.

[0052] In one embodiment of the present disclosure, reference Figure 3 , which shows another structural diagram of an authorization encryption circuit provided by an embodiment of the present disclosure. Figure 3 As shown, the authorization encryption circuit also includes: a key generation module 40, which is configured to receive the confusion code Confusion code, the CPU identification signal CPU ID and the internal key Key_1 and perform encryption operations to generate a dynamic key Dynamic Key.

[0053] During the automatic authorization encryption mode, DRAM will only decode and execute instructions that meet the authentication requirements. Instructions that do not meet the authentication requirements will not be decoded, thereby preventing DRAM from being attacked and tampering with stored data. An internal key Key_1 with a preset value can be stored in DRAM in advance. When DRAM receives an instruction sent by the CPU that is consistent with the internal key Key_1 after decoding, subsequent operations will be performed. In order to further reduce the possibility of instructions being cracked, the CPU will send a random confusion code Confusion code every time the DRAM is powered on. The key generation module 40 receives the confusion code Confusion code, the CPU identification signal CPU ID and the internal key Key_1, performs encryption operations based on the three, and generates a dynamic key DynamicKey. In some embodiments, the key generation module 40 can be an XOR gate, which receives the confusion code Confusion code, the CPU identification signal CPU ID and the internal key Key_1 for XOR operations to generate a dynamic key DynamicKey. The dynamic key DynamicKey can be used for direct transmission communication between the CPU and the DRAM. In this way, by setting the confusion code Confusioncode to participate in encryption, even if the communication between the CPU and the DRAM is monitored, the internal key Key_1 will not be leaked, which can prevent brute force cracking of the DRAM.

[0054] In one embodiment of the present disclosure, reference Figure 4 , which shows a schematic diagram of the composition structure of a command decoding module 10 provided in an embodiment of the present disclosure. Figure 4 As shown, the command decoding module 10 includes: a first matching module 101, configured to compare the received dynamic key Dynamic Key with the fourth sub-preset condition, and if they are consistent, output a first matching signal Match_1; a first triggering module 102, configured to compare the received first sub-command address signal CA_1 with the third sub-preset condition in response to the first matching signal Match_1, and if they are consistent, generate an authorized encryption entry signal AuthEntry; or, the first matching module 101, configured to compare the received dynamic key Dynamic Key with the sixth sub-preset condition, and if they are consistent, output a second matching signal Match_2; the first triggering module 102, configured to compare the received first sub-command address signal CA_1 with the fifth sub-preset condition in response to the second matching signal Match_2, and if they are consistent, generate an authorized encryption exit signal AuthExit.

[0055] In some embodiments, the command address signal CA<13:0> can be set to include a first sub-command address signal CA_1 and a second sub-command address signal CA_2, wherein the first sub-command signal CA_1 can be selected according to the truth table specified in the DRAM industry standard, and can generally include CA1-CA5, which is used to decode and generate corresponding read and write operations. The second sub-command signal CA_2 may include CA6-CA13, and CA6-CA13 may be used to receive the dynamic key Dynamic Key transmitted by the CPU. If the received command address signal CA<13:0> meets the first preset condition, the DRAM will enter the automatic authorization encryption state. It can be understood that the dynamic key Dynamic Key may include one or more bits in CA6-CA13. The more bits, the more complex the corresponding authentication-compliant instructions, and the lower the possibility of the DRAM being deciphered and attacked, thereby preventing the DRAM from being attacked and tampering with the stored data.

[0056] The command decoding module 10 may include a first matching module 101 and a first triggering module 102. The first preset condition may include a third sub-preset condition and a fourth sub-preset condition. Among them, the first matching module 101 will compare the received dynamic key Dynamic Key with the fourth sub-preset condition, that is, the data obtained after decrypting the received second sub-command signal CA_2 (i.e., dynamic key) and the confusion code Confusion code and the CPU identification signal CPU ID, and determine whether it is consistent with the internal key Key_1 stored in the DRAM. If the same, a first matching signal Match_1 is generated. The first triggering module 102 will respond to the first matching signal Match_1 and compare the received first sub-command signal CA_1 with the third sub-preset condition, that is, decode the received first sub-command signal CA_1. If the decoding corresponds to the RFU instruction (Reserve for future, RFU), an authorized encrypted entry signal AuthEntry is generated.

[0057] The second preset condition may include a fifth sub-preset condition and a sixth sub-preset condition. In some embodiments, the first matching module 101 compares the received dynamic key Dynamic Key with the sixth sub-preset condition, that is, the data obtained after decrypting the received second sub-command signal CA_2 (i.e., dynamic key) and the confusion code Confusion code and CPU identification signal CPU ID, and determines whether it is consistent with the internal key Key_1 stored in the DRAM. If the same, a second matching signal Match_2 is generated. The first triggering module 102 will respond to the second matching signal Match_2 and compare the received first sub-command signal CA_1 with the fifth sub-preset condition, that is, decode the received first sub-command signal CA_1. If the decoding corresponds to the RFU instruction (Reserve for future, RFU), an authorization encryption exit signal AuthExit is generated.

[0058] It can be understood that the first matching module 101 and the first triggering module 102 here are both used to receive the dynamic key Dynamic Key and determine whether it is consistent with the preset conditions. If it is consistent, the authorization encryption entry signal AuthEntry or the authorization encryption exit signal AuthExit is generated. The only difference is the working time. Therefore, the command decryption module 10 can have multiple first matching modules 101 and first triggering modules 102, which generate the authorization encryption entry signal AuthEntry or the authorization encryption exit signal AuthExit accordingly, or can reuse one first matching module 101 and the first triggering module 102 to generate the authorization encryption entry signal AuthEntry or the authorization encryption exit signal AuthExit at different times.

[0059] In some embodiments, the first matching module 101 may be a plurality of parallel-connected NAND gates. The first trigger module 102 may be a D flip-flop, the input end of which is connected to the output end of a NOR gate, the input end of the NOR gate is connected to the output ends of a plurality of parallel-connected NAND gates, the clock end of the D flip-flop receives the authorization encryption signal AuthCmd, and the output end of the D flip-flop outputs the authorization encryption entry signal AuthEntry or the authorization encryption exit signal AuthExit.

[0060] For example, when the received dynamic key is 8-bit data, the first matching module 101 may include two four-input NAND gates, which can compare the data obtained after decrypting the dynamic key Dynamic code, the confusion code Confusion code, and the CPU identification signal CPU ID with the internal key Key_1. If they are consistent, the two four-input NAND gates receive "1111" and output "00". The NOR gate outputs 1, and only when the authorization encryption signal AuthCmd received at the clock end of the D flip-flop is valid, will it trigger the output of the authorization encryption entry signal AuthEntry or the authorization encryption exit signal AuthExit to be 1. The authorization encryption signal AuthCmd here corresponds to the RFU instruction generated by decoding the first sub-command signal CA0-CA5, that is, when CA0-CA5 decodes to generate the RFU instruction, the authorization encryption signal AuthCmd is valid, indicating that the DRAM enters or exits the authorization encryption mode.

[0061] In some embodiments, the internal key may include multiple keys. For example, the CPU may send a command address signal CA<13:0> that conforms to the instruction to enter the authorization encryption mode, and then send three command address signals CA<13:0> that conform to the instruction in sequence to exit the authorization encryption mode, and then the read and write commands issued can be decoded normally. In this way, the security of the DRAM can be increased, and data can be effectively prevented from being stolen or tampered with by malicious devices through the bus, thereby protecting data security.

[0062] When the internal key Key_1 is 3, refer to Figure 5 , which shows a specific circuit diagram of a command decoding module 10 provided in an embodiment of the present disclosure. Figure 5As shown, the first matching module 101 includes three XOR gates, which are used to receive the first, second and third dynamic key Dynamic code, and XOR the dynamic key Dynamic code received each time with the confusion code Confusion Code and the CPU identification signal CPU ID to generate the first, second and third operation codes Step 1 / 2 / 3 OP Code. Multiple NAND gates receive the first, second and third operation codes Step 1 / 2 / 3 OP Code, and when they are consistent, the NAND gate outputs 0, the NOR gate receives the output of the NAND gate, and the NOR gate outputs 1. The first trigger module 102 includes three D flip-flops, the first D flip-flop receives the output of the first NOR gate, and outputs Q=1 when the authorization encryption command AuthCmd is valid. One input end of the second NOR gate is connected to the output end of the first D flip-flop. When Q=1, after an inverter, the NOR gate receives 0, which is used to indicate that the first command address signal meets the authentication rules and does not affect the subsequent judgment. The second D flip-flop receives the output of the second NOR gate, and outputs Q=1 when the authorization encryption command AuthCmd is valid. One input of the third NOR gate is connected to the output of the second D flip-flop. When Q=1, after an inverter, the NOR gate receives 0, which is used to indicate that the second command address signal meets the authentication rules and does not affect subsequent judgments. If the first command address signal does not meet the authentication rules, the first D flip-flop outputs 0, and the second NOR gate receives 1. Even if the second and third command address signals meet the authentication rules, it is still impossible to generate a valid authorization encryption entry signal AuthEntry or authorization encryption exit AuthExit signal. In this way, the complexity of the authentication rules can be increased and the security of DRAM can be improved. The reset ends of the three D flip-flops also receive the authorization encryption reset signal AuthRstN, which is used to reset the D flip-flops to facilitate the decryption and matching of the next key.

[0063] In some embodiments of the present disclosure, reference Figure 6 , which shows a schematic diagram of the composition structure of an authorization encryption module 20 provided in an embodiment of the present disclosure. Figure 6 As shown, the authorization encryption module 20 includes: a shielding command generation module 201, which is configured to receive the authorization encryption entry signal AuthEntry, the authorization encryption exit signal AuthExit and the initial configuration completion signal Config_1, and generate a shielding command CmdEncr; a read-write command module 202, which is configured to receive a read-write command Cmd and a shielding command CmdEncr, and if the shielding command CmdEncr is valid, output an invalid read-write command CmdOD / CmdOD, and if the shielding command CmdEncr is invalid, output a valid read-write command CmdOD / CmdOD.

[0064] Combined with reference Figure 7 , which shows a specific circuit diagram of the authorization encryption module 20 provided in the embodiment of the present disclosure. Figure 7 As shown, the masking command generation module 201 may include an RS latch. One end of an OR gate receives the initial configuration completion signal Config_1, and the other end receives the authorization encryption entry signal AuthEntry. In this way, as long as the authorization encryption entry signal AuthEntry is valid (here, logic 1 and high level are valid as an example), no matter whether the DRAM has been initialized or not, that is, no matter whether the initial configuration completion signal Config_1 is 1 or 0, the OR gate will output 0. The output end of the OR gate is connected to an inverter, the set end of the RS latch is connected to the output end of the inverter, and the reset end receives the authorization encryption exit signal AuthExit and the reset signal Reset. The output end of the RS keeps outputting 1 until the reset end of the RS receives a valid authorization encryption exit signal AuthExit or a reset signal Reset, then the output end of the RS will output 0, and here CmdEncrB (i.e., logic 0) is taken as a valid masking command.

[0065] The read / write command module 202 may include multiple DFF triggers. The input end of the trigger receives the read / write command CMD, the clock end receives the corresponding clock signal, and the set end receives the shielding command CmdEncrB. In this way, if the shielding command CmdEncrB is valid, that is, the DFF trigger is set, it will output an invalid read / write command. If the shielding command CmdEncrB is invalid, the DFF trigger works normally and outputs a valid read / write command. Figure 7 As shown, the read-write command module 202 may include two DFF flip-flops, one DFF flip-flop receives the read-write command odd signal CmdO, and the clock end receives the odd clock signal ClkO, and the other DFF flip-flop receives the read-write command even signal CmdE, and the clock end receives the even clock signal ClkE. The set ends of the two DFF flip-flops both receive the shielding command CmdEncrB. When the shielding command CmdEncrB is logic 0 and the low level is valid, the two DFF flip-flops are set and output invalid read-write commands CmdOD / CmdOD. When the shielding command CmdEncrB is logic 1 and the high level is valid, the two DFF flip-flops work normally and output valid read-write commands CmdOD / CmdOD.

[0066] In some embodiments of the present disclosure, reference Figure 8 , which shows a specific circuit diagram of another shielding command generating module 201 provided in an embodiment of the present disclosure. Figure 8 As shown, the masking command generating module 201 also receives a training mode completion signal, and is configured to generate a masking command CmdEncr when the training mode completion signal is valid.

[0067] It is understandable that after power-on, the DRAM also needs to train the command address signal CA<13:0> so that it is aligned with the external clock signal to avoid the command address signal being mistakenly sampled. Therefore, before the DRAM enters the automatic authorization encryption mode, it is also necessary to complete the training of the command address signal CA<13:0>. Therefore, the shielding command generation module 201 also receives a training mode completion signal, which is used to shield the subsequently received commands only when the training mode is indicated to be completed. The output end of the RS latch is connected to an inverter, and the output end of the inverter is connected to the input end of an NOR gate. The other input end of the NOR gate receives the training mode completion signal. In this way, only when the training mode completion signal is valid, the NOR gate will output a valid shielding command CmdEncrB. In some embodiments, the completion of the training mode can be indicated by data stored in the mode register, such as the 7th bit data MR2OP7 of the second mode register or the data of the third mode register MR3.

[0068] In some embodiments of the present disclosure, reference Fig. 9 , which shows another structural diagram of an authorization encryption circuit provided by an embodiment of the present disclosure. Fig. 9 As shown, the authorization encryption circuit further includes: a confusion code update module 50, which is configured to receive the confusion code Confusion Code, the CPU identification signal CPU ID and the authorization encryption exit signal AuthExit, and generate an updated confusion code.

[0069] In order to further enhance the security of DRAM, the Confusion Code will be dynamically updated after each exit from the automatic authorization encryption mode, and different dynamic codes will be generated according to different CPU identification signals CPU ID. For example, after each exit from the automatic authorization encryption mode, the Confusion Code will be updated in the DRAM and CPU respectively through the same algorithm, and different CPU identification signals CPU ID will also participate in the algorithm, making the Confusion Code a private key in the communication process. Only the CPU can generate the correct Confusion Code that is consistent with the DRAM, and thus encrypt and generate the correct dynamic key Dynamic Code, or receive the dynamic key Dynamic Code and decrypt it correctly, if it knows the algorithm.

[0070] Combined with reference Fig.10 , which shows a specific circuit diagram of the obfuscation code update module 50 provided in an embodiment of the present disclosure. Fig.10As shown, the confusion code update module 50 may include a trigger and a linear feedback shift register (LFSR). The input end of the trigger receives the confusion code Confusion Code, the clock end receives the authorization encryption exit signal AuthExit, the input end of the LFSR is connected to the output end of the trigger, and also receives the CPU identification signal, which is used to start updating the confusion code Confusion Code when exiting the automatic authorization encryption mode. The enable end of the LFSR can also receive the shielding signal CmdEncrB, so that the shift of the LFSR can be turned off when the shielding signal is invalid, saving the power consumption of the circuit.

[0071] The disclosed embodiment also provides an authorization encryption method, including: DRAM receives a dynamic key sent by a CPU and decodes it, determines whether it is consistent with an internal key of the DRAM, and if so, enters an automatic authorization encryption mode, in which the DRAM shields read and write commands; DRAM receives a dynamic key sent by a CPU and decodes it, determines whether it is consistent with an internal key of the DRAM, and if so, exits the authorization encryption mode.

[0072] In one embodiment of the present disclosure, reference Fig.11 , which shows a schematic diagram of the process steps of an authorization encryption method provided by an embodiment of the present disclosure. Fig.11 As shown, the authorization encryption method includes the following steps:

[0073] Step S1: DRAM receives the dynamic key sent by CPU and decodes it to determine whether it is consistent with the internal key of the DRAM. If it is consistent, it enters the automatic authorization encryption mode, in which the DRAM shields the read and write commands;

[0074] Step S2: DRAM receives the dynamic key sent by the CPU and decodes it to determine whether it is consistent with the internal key of DRAM. If it is consistent, the authorization encryption mode is exited.

[0075] In some embodiments, in combination Figure 1 , Figure 4 and Fig.11, the specific process of step S1 includes: DRAM receives the dynamic key Dynamic code sent by the CPU and decodes it to determine whether it is consistent with the internal key Key_1 stored in the DRAM. If it is consistent, an authorization encryption entry signal AuthEntry is generated to enable the DRAM to enter the automatic authorization encryption mode. The DRAM shields the read and write commands Cmd in the automatic authorization encryption mode. This dynamic key Dynamic code can be decoded by the command address signal CA<13:0>. The specific process of step S2 includes: DRAM can also receive the dynamic key Dynamiccode sent by the CPU and decode it to determine whether it is consistent with the internal key Key_1 of the DRAM. If it is consistent, an authorization encryption exit signal AuthExit is generated to enable the DRAM to exit the authorization encryption mode. Here, the internal key Key_1 corresponding to the authorization encryption entry signal AuthEntry and the authorization encryption exit signal AuthExit can be the same or different.

[0076] refer to Fig.12 , which shows another process step diagram of an authorization encryption method provided by an embodiment of the present disclosure. Fig.12 As shown, before entering the automatic authorization encryption mode, the authorization encryption method further includes:

[0077] S0: The CPU reads the register information inside the DRAM to determine whether it is the target DRAM. If so, it sends a command address signal that meets the first preset condition to set the DRAM to start the automatic authorization encryption mode, and the command address signal includes a dynamic key.

[0078] In some embodiments, in combination Figure 3 and Fig.12 The specific process of step S0 includes: the CPU reads the register information inside the DRAM, determines whether it is the target DRAM, and if so, sends a command address signal CA<13:0> that meets the first preset condition, sets the DRAM to start the automatic authorization encryption mode, and the command address signal CA<13:0> includes the dynamic key DynamicCode.

[0079] For DRAM, after power-on and completion of training of the command address signal CA<13:0>, the CPU needs to read the information in the mode register in the DRAM through the mode register read command to determine whether the current DRAM is the target DRAM, that is, the DRAM that needs to enter the automatic authorization encryption mode. Only in this way will the CPU send the command address signal CA<13:0> that meets the first preset condition to the DRAM for decoding. Otherwise, if it is not the target DRAM, the CPU sends the command address signal CA<13:0> to the DRAM according to the normal read and write command operation, and does not involve the operation of entering the automatic authorization encryption mode.

[0080] In some embodiments, the command address signal CA<13:0> can be set to include a first sub-command address signal CA_1 and a second sub-command address signal CA_2, wherein the first sub-command signal CA_1 can be selected according to the truth table specified in the DRAM industry standard, and can usually include CA1-CA5, which is used to decode and generate corresponding read and write operations. The second sub-command signal CA_2 may include CA6-CA13, and CA6-CA13 may be used to receive the dynamic key Dynamic Key transmitted by the CPU. If the received dynamic key Dynamic Key complies with the authentication, the DRAM will decode and execute CA1-CA5. It can be understood that the dynamic key Dynamic Key may include one or more bits in CA6-CA13. The more bits, the more complex the corresponding authentication-compliant instructions, and the lower the possibility of the DRAM being deciphered and attacked, thereby preventing the DRAM from being attacked and tampering with the stored data.

[0081] The first preset condition may include a third sub-preset condition and a fourth sub-preset condition. The received dynamic key Dynamic Key may be compared with the fourth sub-preset condition, that is, the data obtained after decrypting the received second sub-command signal CA_2 (i.e., dynamic key) with the obfuscation code and the CPU identification signal CPU ID is judged whether it is consistent with the internal key Key_1 stored in the DRAM. If the same, a first matching signal Match_1 is generated. The received first sub-command signal CA_1 is then compared with the third sub-preset condition, that is, the received first sub-command signal CA_1 is decoded. If the decoding corresponds to the RFU instruction (Reserve for future, RFU), an authorization encryption entry signal AuthEntry is generated, and the DRAM is set to start the automatic authorization encryption mode.

[0082] In some embodiments, reference Figure 3 and Fig.13 , which shows another process step diagram of an authorization encryption method provided by an embodiment of the present disclosure. Fig.13As shown, the authorization encryption method further includes, after setting the DRAM to start the automatic authorization encryption mode and before the DRAM enters the automatic authorization encryption mode;

[0083] S11: Determine whether the initial configuration completion signal is a first preset value, if not, start the initialization configuration.

[0084] In some embodiments, in combination Figure 3 and Fig.13 The specific process of step S11 includes: determining whether the initial configuration completion signal Config_1 is a first preset value, if not, then (S12) starting the initialization configuration.

[0085] After setting the DRAM to start the automatic authorization encryption mode, before the DRAM enters the automatic authorization encryption mode, the CPU has determined that the current DRAM is the target DRAM by reading the information in the mode register. However, for the DRAM, if a judgment operation is required every time it is powered on and the training of the command address signal CA<13:0> is completed, it will waste time and energy consumption and affect the performance of the DRAM. Therefore, it can be set to perform the initialization configuration judgment on the target DRAM after the automatic authorization encryption mode is turned on and before entering the automatic authorization encryption mode. Here, if the initial configuration completion signal Config_1 is set to 1, it indicates that the DRAM has passed the judgment and is identified as the target DRAM, and no repeated judgment is required. If the initial configuration completion signal Config_1 is not 1, the initial configuration completion signal Config_1 can be set to 1 through the post-package repair circuit (Post Package Repair, PPR) to achieve the initialization setting of the DRAM. Those skilled in the art should understand that the initial configuration completion signal Config_1 is set to 1 or 0 here only as an example, and it can be set as needed in the actual circuit.

[0086] It should be noted that the initialization configuration here also only needs to work once. When the received initialization configuration completion signal Config_1 is invalid, it means that the DRAM has not been initialized yet. After the initialization configuration, the initialization configuration completion signal Config_1 of the first preset value is generated.

[0087] In some embodiments, reference Figure 8 and Fig.14 , which shows another process step diagram of an authorization encryption method provided by an embodiment of the present disclosure. Fig.14 As shown, the authorization encryption method includes, after starting the initialization configuration process and before the DRAM enters the automatic authorization encryption mode;

[0088] S13: Training the command address signal.

[0089] In some embodiments, in combination Figure 8 and Fig.14 The specific process of step S13 includes: training the command address signal CA<13:0> so that the command address signal CA<13:0> is aligned with the internal clock signal to prevent the command address signal CA<13:0> from being mistakenly sampled. After the DRAM completes the initialization configuration, the DRAM will reset, so it is necessary to train the command address signal CA<13:0> so that it is aligned with the internal clock signal.

[0090] In some embodiments, reference Fig. 9 , 10 and Fig.15 , which shows another process step diagram of an authorization encryption method provided by an embodiment of the present disclosure. Fig.15 As shown, after the DRAM exits the authorization encryption mode, the authorization encryption method further includes:

[0091] S3: Generate updated obfuscated code.

[0092] In some embodiments, in combination Fig. 9 , 10 and Fig.15 The specific process of step S15 includes: generating an updated obfuscation code.

[0093] During the automatic authorization encryption mode, DRAM will only decode and execute instructions that meet the authentication requirements. Instructions that do not meet the authentication requirements will not be decoded, thereby preventing DRAM from being attacked and tampering with stored data. An internal key with a preset value can be stored in DRAM in advance. When DRAM receives an instruction sent by the CPU that is consistent with the internal key after decoding, subsequent operations will be performed. In order to further reduce the possibility of instructions being cracked, the CPU will send a random confusion code Confusion code every time the DRAM is powered on. The key generation module 40 receives the confusion code Confusion code, the CPU identification signal CPUID and the internal key Key_1, performs encryption operations based on the three, and generates a dynamic key Dynamic Key. In some embodiments, the key generation module 40 can be an XOR gate, which receives the confusion code Confusion code, the CPU identification signal CPU ID and the internal key Key_1 for XOR operations to generate a dynamic key Dynamic Key. The dynamic key Dynamic Key can be used for direct transmission communication between the CPU and the DRAM. In this way, by setting the confusion code Confusion code to participate in encryption, even if the communication between the CPU and the DRAM is monitored, the internal key Key_1 will not be leaked, and brute force cracking of the DRAM can also be prevented.

[0094] In order to further enhance the security of DRAM, the Confusion Code will be dynamically updated after each exit from the automatic authorization encryption mode, and different dynamic codes will be generated according to different CPU identification signals CPU ID. For example, after each exit from the automatic authorization encryption mode, the Confusion Code will be updated in the DRAM and CPU respectively through the same algorithm, and different CPU identification signals CPU ID will also participate in the algorithm, making the Confusion Code a private key in the communication process. Only the CPU can generate the correct Confusion Code that is consistent with the DRAM, and thus encrypt and generate the correct dynamic key Dynamic Code, or receive the dynamic key Dynamic Code and decrypt it correctly, if it knows the algorithm.

[0095] In some embodiments of the present disclosure, reference Fig.16 , which shows a timing diagram corresponding to an authorization encryption method provided by an embodiment of the present disclosure.

[0096] In the first stage, the CPU sends a command address signal CA<13:0> that meets the first preset condition to the DRAM for decoding, including three dynamic keys AuthEnt1 / AuthEnt2 / AuthEnt3, generates an authorization encryption entry signal AuthEntry, and sets the DRAM to start an automatic authorization encryption mode.

[0097] In the second stage, if the DRAM determines that the initial configuration completion signal Config_1 is not 1, the DRAM performs initial configuration through a PPR operation, sets the initial configuration completion signal Config_1 to a first preset value, and may also include setting a CPU identification signal CPU ID.

[0098] In the third stage, after the DRAM is reset, it trains the command address signal CA<13:0>. When the training mode is completed, Fig.16 As shown, the 7th bit data MR2OP7 of the second mode register becomes logic 1, high level, and the corresponding shielding signal CmdEncrB becomes logic 0, low level, thereby starting to shield the read and write commands.

[0099] In the fourth stage, when the authorization encryption exit signal AuthExit is valid, the corresponding shielding signal CmdEncrB becomes logic 1 and low level, so that the read and write commands are operated normally.

[0100] In summary, the embodiments of the present disclosure provide an authorization encryption circuit and an authorization encryption method, wherein the authorization encryption circuit includes: a command decoding module, configured to decode the received command address signal, and if it meets the first preset condition, generate an authorization encryption entry signal, and if it meets the second preset condition, generate an authorization encryption exit signal; an authorization encryption module, configured to receive an authorization encryption entry command and an authorization encryption exit command, and if the authorization encryption entry command is valid, shield the read and write commands, and if the authorization encryption exit command is valid, perform normal operations on the read and write commands. By judging whether the command address signal meets the preset conditions, the DRAM is controlled to enter the authorization encryption mode, shield the read and write commands, or control the DRAM to exit the authorization encryption mode, and perform normal operations on the read and write commands, so that only instructions that meet the conditions will be executed by the DRAM, thereby preventing the DRAM from being attacked and the stored data from being tampered with, and increasing the security of the DRAM.

[0101] Those skilled in the art can understand that the above-mentioned embodiments are specific examples for implementing the present application, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of the present application. Any person skilled in the art can make their own changes and modifications without departing from the spirit and scope of the present application, so the scope of protection of the present application shall be based on the scope defined in the claims.

Claims

1. An authorization encryption circuit, characterized in that: include: A command decoding module is configured to decode the received command address signal, and generate an authorized encrypted entry signal if a first preset condition is met, and generate an authorized encrypted exit signal if a second preset condition is met; The authorization encryption module is configured to receive the authorization encryption entry signal and the authorization encryption exit signal. If the authorization encryption entry signal is valid, the read and write commands are shielded; if the authorization encryption exit signal is valid, the read and write commands are operated normally.

2. The authorization encryption circuit according to claim 1, characterized in that: Also includes: The initial configuration module is configured to receive the authorization encryption entry signal and the initial configuration completion signal, and set the configuration signal to a first preset value, wherein the configuration signal includes a CPU identification signal and the initial configuration completion signal.

3. The authorization encryption circuit according to claim 2, characterized in that: Also includes: The key generation module is configured to receive the obfuscation code, the CPU identification signal and the internal key and perform encryption operations to generate a dynamic key.

4. The authorization encryption circuit according to claim 3, characterized in that: The first preset condition includes a third sub-preset condition and a fourth sub-preset condition, the second preset condition includes a fifth sub-preset condition and a sixth sub-preset condition, the command address signal includes a first sub-command address signal and a second sub-command address signal, and the command decoding module includes: A first matching module is configured to compare the received dynamic key with the fourth sub-preset condition, and output a first matching signal if they are consistent; A first trigger module is configured to compare the received first sub-command address signal with the third sub-preset condition in response to the first matching signal, and generate the authorized encrypted entry signal if they are consistent; or A first matching module is configured to compare the received dynamic key with the sixth sub-preset condition, and output a second matching signal if they are consistent; A first trigger module is configured to compare the received first sub-command address signal with the fifth sub-preset condition in response to the second matching signal, and generate the authorization encryption exit signal if they are consistent; The second sub-command signal corresponds to the received dynamic key.

5. The authorization encryption circuit according to claim 3, characterized in that: The authorization encryption module includes: A shielding command generating module is configured to receive the authorization encryption entry signal, the authorization encryption exit signal and the initial configuration completion signal, and generate a shielding command; The read-write command module is configured to receive the read-write command, and if the mask command is valid, output an invalid read-write command, and if the mask command is invalid, output a valid read-write command.

6. The authorization encryption circuit according to claim 5, characterized in that: The masking command generating module also receives a training mode completion signal, and is configured to generate the masking command when the training mode completion signal is valid.

7. The authorization encryption circuit according to claim 3, characterized in that: Also includes: The obfuscation code update module is configured to receive the obfuscation code, the CPU identification signal and the authorization encryption exit signal, and generate an updated obfuscation code.

8. An authorization encryption method, characterized in that: include: The DRAM receives the dynamic key sent by the CPU and decodes it to determine whether it is consistent with the internal key of the DRAM. If it is consistent, the DRAM enters the automatic authorization encryption mode, in which the DRAM shields the read and write commands; The DRAM receives and decodes the dynamic key sent by the CPU, and determines whether it is consistent with the internal key of the DRAM. If it is consistent, the automatic authorization encryption mode is exited.

9. The authorization encryption method according to claim 8, characterized in that: Before the DRAM enters the automatic authorization encryption mode, it also includes: the CPU reads the register information inside the DRAM to determine whether it is the target DRAM. If so, it sends a command address signal that meets the first preset condition to set the DRAM to start the automatic authorization encryption mode, and the command address signal includes a dynamic key.

10. The authorization encryption method according to claim 9, characterized in that: After the DRAM is set to start the automatic authorization encryption mode and before the DRAM enters the automatic authorization encryption mode, the method further includes: determining whether the initial configuration completion signal is a first preset value, and if not, starting the initialization configuration.

11. The authorization encryption method according to claim 10, characterized in that: After the initial configuration process is started, Before the DRAM enters the automatic authorization encryption mode, the process also includes: training the command address signal.

12. The authorization encryption method according to claim 8, characterized in that: After the DRAM exits the authorized encryption mode, the method further includes: generating an updated obfuscated code.