+

CN115017520A - Security protection system, method, electronic device and storage medium - Google Patents

Security protection system, method, electronic device and storage medium Download PDF

Info

Publication number
CN115017520A
CN115017520A CN202110241277.3A CN202110241277A CN115017520A CN 115017520 A CN115017520 A CN 115017520A CN 202110241277 A CN202110241277 A CN 202110241277A CN 115017520 A CN115017520 A CN 115017520A
Authority
CN
China
Prior art keywords
module
read
processor
ciphertext
plaintext
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110241277.3A
Other languages
Chinese (zh)
Inventor
申宗泽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Long Teng Rong Zhi Information Technology Co ltd
Original Assignee
Beijing Long Teng Rong Zhi Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Long Teng Rong Zhi Information Technology Co ltd filed Critical Beijing Long Teng Rong Zhi Information Technology Co ltd
Priority to CN202110241277.3A priority Critical patent/CN115017520A/en
Publication of CN115017520A publication Critical patent/CN115017520A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6209Protecting access to data via a platform, e.g. using keys or access control rules to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The application provides a safety protection system, a safety protection method, electronic equipment and a storage medium. The safety protection system provided by the application comprises a processor, a memory module and a safety protection module. When the safety protection system is adopted to read data in the memory, a specific initial secret key is generated in the safety protection module according to the equipment information in the processor, and then the plaintext to be read can be obtained after the ciphertext to be read in the memory is decrypted according to the initial secret key in the safety protection module, so that the ciphertext to be read cannot be successfully decrypted if the initial secret keys are not matched, data stealing through a Joint Test Action Group (Joint Test Action Group) interface can be effectively prevented, and meanwhile, the data cannot be directly obtained when the data in the memory is read due to the fact that the ciphertext to be read is stored in the memory.

Description

安全防护系统、方法、电子设备及存储介质Security protection system, method, electronic device and storage medium

技术领域technical field

本申请涉及加解密领域,具体涉及一种安全防护系统、方法、电子设备及存储介质。The present application relates to the field of encryption and decryption, and in particular to a security protection system, method, electronic device and storage medium.

背景技术Background technique

在嵌入式系统中,大都使用内存保存程序可执行代码和重要参数,一般都采用配套编译器的标准明文格式保存。由于这些都是系统的重要知识产权,一旦程序或重要参数被窃取,知识产权就无法保障,给程序的所有者造成重大损失。In embedded systems, most of the program executable codes and important parameters are stored in memory, which are generally stored in the standard plaintext format of the supporting compiler. Since these are important intellectual property rights of the system, once the program or important parameters are stolen, the intellectual property rights cannot be guaranteed, causing heavy losses to the owner of the program.

现有技术中,某些编译器集成的密码功能可实现一定条件下的防护,但是这种方法只能防止通过软件读取实时内存,并不能防止他人通过联合测试工作组(Joint TestAction Group,以下简称JTAG)读取内存得到内存中的数据,也不能防止他人从内存中直接读取数据,防护效果差。In the prior art, the cryptographic function integrated by some compilers can realize protection under certain conditions, but this method can only prevent the real-time memory from being read by software, and cannot prevent others from passing the Joint TestAction Group (Joint TestAction Group, below). JTAG for short) reads the memory to obtain the data in the memory, and it cannot prevent others from directly reading the data from the memory, and the protection effect is poor.

发明内容SUMMARY OF THE INVENTION

本申请提供一种安全防护系统、方法、电子设备及存储介质,旨在解决现有的安全防护方法不能防止他人通过JTAG(Joint Test Action Group,以下简称JTAG)读取内存中的数据,也不能防止从FLASH中直接读取数据,防护效果差的问题。The present application provides a security protection system, method, electronic device and storage medium, aiming at solving the problem that the existing security protection method cannot prevent others from reading data in memory through JTAG (Joint Test Action Group, hereinafter referred to as JTAG), nor can To prevent the direct reading of data from FLASH, the protection effect is poor.

第一方面,本申请提供一种安全防护系统,所述安全防护系统包括:In a first aspect, the present application provides a safety protection system, the safety protection system includes:

所述处理器,用于发送读取命令至所述安全防护模块;the processor, configured to send a read command to the security protection module;

所述内存模块,用于存储待读取密文;the memory module for storing the ciphertext to be read;

所述安全防护模块,用于生成并根据初始密钥对所述待读取密文进行解密处理,得到待读取明文,其中,所述初始密钥根据所述处理器的设备信息生成;The security protection module is configured to generate and decrypt the ciphertext to be read according to an initial key to obtain the plaintext to be read, wherein the initial key is generated according to device information of the processor;

所述处理器,还用于从所述安全防护模块中获取所述待读取明文。The processor is further configured to acquire the plaintext to be read from the security protection module.

在本申请一种可能的实现方式中,所述安全防护模块包括密钥生成模块、加解密模块、外部缓存模块和命令控制模块,所述密钥生成模块、所述加解密模块、所述命令控制模块和所述外部缓存依次通信连接,所述命令控制模块分别与所述内存模块和所述处理器通信连接,所述安全防护模块还包括:In a possible implementation manner of the present application, the security protection module includes a key generation module, an encryption/decryption module, an external cache module and a command control module, the key generation module, the encryption/decryption module, the command The control module and the external cache are sequentially connected in communication, the command control module is respectively connected in communication with the memory module and the processor, and the security protection module further includes:

密钥生成模块,用于获取所述设备信息,并在上电时生成所述初始密钥;a key generation module for acquiring the device information and generating the initial key when powered on;

加解密模块,用于获取所述待读取密文,并根据所述初始密钥对所述待读取密文进行解密处理,得到所述待读取明文;an encryption and decryption module, configured to obtain the ciphertext to be read, and perform decryption processing on the ciphertext to be read according to the initial key to obtain the plaintext to be read;

外部缓存模块,用于存储所述待读取明文;an external cache module for storing the plaintext to be read;

命令控制模块,用于获取所述读取命令,并根据所述读取命令读取并返回所述外部缓存模块中的所述待读取明文至所述处理器。The command control module is configured to obtain the read command, and read and return the to-be-read plaintext in the external cache module to the processor according to the read command.

在本申请一种可能的实现方式中,所述安全防护模块还包括内部缓存模块,所述内部缓存模块分别与所述内存模块和所述加解密模块通信连接;In a possible implementation manner of the present application, the security protection module further includes an internal cache module, and the internal cache module is respectively connected in communication with the memory module and the encryption/decryption module;

所述内部缓存模块用于从所述内存模块中获取并存储所述待读取密文,并在所述加解密模块接收到所述初始密钥时,将所述待读取密文输入到所述加解密模块中。The internal cache module is used to obtain and store the ciphertext to be read from the memory module, and when the encryption and decryption module receives the initial key, input the ciphertext to be read into the ciphertext to be read. in the encryption and decryption module.

在本申请一种可能的实现方式中,所述安全防护模块还包括接口模块,所述接口模块分别与所述处理器、所述内存模块和所述命令控制模块通信连接,所述读取命令携带有处理器时序信息,所述读取命令由所述处理器输入至所述接口模块;In a possible implementation manner of the present application, the security protection module further includes an interface module, and the interface module is respectively connected in communication with the processor, the memory module and the command control module, and the read command Carrying processor timing information, the read command is input to the interface module by the processor;

所述接口模块用于根据所述处理器时序信息生成读取操作请求,其中,读取操作请求用于请求读取所述外部缓存模块中的待读取明文。The interface module is configured to generate a read operation request according to the processor timing information, wherein the read operation request is used to request to read the plaintext to be read in the external cache module.

在本申请一种可能的实现方式中,所述加解密模块还用于:In a possible implementation manner of the present application, the encryption and decryption module is also used for:

对所述初始密钥进行迭代计算,得到并保存迭代密钥;Perform iterative calculation on the initial key to obtain and save the iterative key;

根据所述迭代密钥对所述待读取密文进行解密处理,得到所述待读取明文。Decrypt the ciphertext to be read according to the iteration key to obtain the plaintext to be read.

在本申请一种可能的实现方式中,所述处理器还用于发送写入命令至所述安全防护模块,所述写入命令携带有待写入明文:In a possible implementation manner of the present application, the processor is further configured to send a write command to the security protection module, where the write command carries the plaintext to be written:

所述命令控制模块还用于获取所述写入命令;The command control module is further configured to obtain the write command;

所述外部缓存模块还用于存储待写入命令携带的所述待写入明文;The external cache module is further configured to store the to-be-written plaintext carried by the to-be-written command;

所述加解密模块还用于根据所述初始密钥,对所述待写入明文进行加密处理,得到待写入密文;The encryption and decryption module is further configured to perform encryption processing on the plaintext to be written according to the initial key to obtain the ciphertext to be written;

所述内存模块还用于存储所述待写入密文。The memory module is also used for storing the to-be-written ciphertext.

第二方面,本申请提供一种安全防护方法,所述安全防护方法包括:In a second aspect, the present application provides a security protection method, the security protection method comprising:

根据所述处理器的设备信息获取初始密钥;Obtain an initial key according to the device information of the processor;

根据所述初始密钥对待读取密文进行解密处理,得到待读取明文,其中,所述待读取密文存储在所述内存模块中;Decrypt the ciphertext to be read according to the initial key to obtain the plaintext to be read, wherein the ciphertext to be read is stored in the memory module;

返回所述待读取明文至所述处理器。Return the plaintext to be read to the processor.

在本申请一种可能的实现方式中,所述安全防护方法还包括:In a possible implementation manner of the present application, the security protection method further includes:

获取所述处理器输入的待写入明文,并根据所述初始密钥对所述待写入明文进行加密处理,得到待写入密文;acquiring the plaintext to be written inputted by the processor, and encrypting the plaintext to be written according to the initial key to obtain the ciphertext to be written;

将所述待写入密文存储至所述内存模块中。The to-be-written ciphertext is stored in the memory module.

第三方面,本申请还提供一种电子设备,包括安全防护系统,所述安全防护系统调用所述存储器中的计算机程序时执行如权利要求7至8任一项所述的安全防护方法。In a third aspect, the present application further provides an electronic device, including a security protection system, the security protection method according to any one of claims 7 to 8 is executed when the security protection system invokes the computer program in the memory.

第四方面,本申请还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器进行加载,以执行所述的安全防护方法中的步骤。In a fourth aspect, the present application further provides a computer-readable storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute the steps in the security protection method.

本申请提供了包括处理器、内存模块和安全防护模块的安全防护系统。采用该安全防护系统读取内存中的数据时,首先在安全防护模块中根据处理器中的设备信息生成特定的初始密钥,然后在安全防护模块中根据初始密钥对内存中的待读取密文解密后才能得到待读取明文,因此初始密钥不匹配时就无法成功对待读取密文进行解密,可以有效防止通过JTAG接口窃取数据,同时由于内存中存储的是待读取密文,对内存进行数据读取时也无法直接获得数据。The present application provides a security protection system including a processor, a memory module and a security protection module. When using the security protection system to read data in the memory, a specific initial key is first generated in the security protection module according to the device information in the processor, and then the security protection module is based on the initial key to be read in the memory. The plaintext to be read can only be obtained after the ciphertext is decrypted. Therefore, when the initial key does not match, the ciphertext to be read cannot be successfully decrypted, which can effectively prevent data from being stolen through the JTAG interface. At the same time, the memory stores the ciphertext to be read. , the data cannot be obtained directly when reading data from the memory.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained from these drawings without creative effort.

图1是本申请实施例中提供的安全防护系统的示意图;1 is a schematic diagram of a safety protection system provided in an embodiment of the present application;

图2是本申请实施例中提供的安全防护模块的示意图;2 is a schematic diagram of a security protection module provided in an embodiment of the present application;

图3是本申请实施例中提供的一种安全防护模块的示意图;3 is a schematic diagram of a security protection module provided in an embodiment of the present application;

图4是本申请实施例中提供的安全防护方法的一种流程示意图;4 is a schematic flowchart of a security protection method provided in an embodiment of the present application;

图5是本申请实施例中提供的安全防护方法的一种流程示意图;5 is a schematic flowchart of a security protection method provided in an embodiment of the present application;

图6是本申请实施例中提供的电子设备的一个实施例结构示意图。FIG. 6 is a schematic structural diagram of an embodiment of the electronic device provided in the embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

在本申请实施例的描述中,需要理解的是,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个所述特征。在本申请实施例的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。In the description of the embodiments of the present application, it should be understood that the terms "first" and "second" are only used for description purposes, and should not be interpreted as indicating or implying relative importance or implicitly indicating the indicated technical features quantity. Thus, features defined as "first", "second" may expressly or implicitly include one or more of said features. In the description of the embodiments of the present application, "plurality" means two or more, unless otherwise expressly and specifically defined.

为了使本领域任何技术人员能够实现和使用本申请,给出了以下描述。在以下描述中,为了解释的目的而列出了细节。应当明白的是,本领域普通技术人员可以认识到,在不使用这些特定细节的情况下也可以实现本申请。在其它实例中,不会对公知的过程进行详细阐述,以避免不必要的细节使本申请实施例的描述变得晦涩。因此,本申请并非旨在限于所示的实施例,而是与符合本申请实施例所公开的原理和特征的最广范围相一致。The following description is presented to enable any person skilled in the art to make and use the present application. In the following description, details are set forth for the purpose of explanation. It is to be understood that one of ordinary skill in the art can realize that the present application may be practiced without the use of these specific details. In other instances, well-known procedures have not been described in detail in order to avoid obscuring the description of the embodiments of the present application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown but is to be accorded the widest scope consistent with the principles and features disclosed in the embodiments of this application.

本申请实施例提供一种安全防护系统、方法、电子设备及存储介质。其中,该安全防护系统可以集成在电子设备中,该电子设备可以是服务器,也可以是终端等设备。Embodiments of the present application provide a security protection system, method, electronic device, and storage medium. Wherein, the security protection system may be integrated in an electronic device, and the electronic device may be a server or a terminal or other device.

首先,在介绍本申请实施例之前,先介绍下本申请实施例关于应用背景的相关内容。First, before introducing the embodiments of the present application, the relevant content of the embodiments of the present application regarding the application background is first introduced.

在嵌入式系统中,大都使用内存保存程序可执行代码和重要参数,一般都采用配套编译器的标准明文格式保存。由于这些都是系统的重要信息,一旦程序或重要参数被窃取,信息就无法保障,给程序的所有者造成重大损失。In embedded systems, most of the program executable codes and important parameters are stored in memory, which are generally stored in the standard plaintext format of the supporting compiler. Since these are important information of the system, once the program or important parameters are stolen, the information cannot be guaranteed, causing heavy losses to the owner of the program.

目前主要存在两种窃取系统重要信息的方式,一种是直接读取内存中的可执行程序,再进行反编译得到汇编源代码。例如可以采用烧录器读取内存中的可执行程序,再进行反编译。还有一种方式是通过处理器芯片加载程序后,通过JTAG接口读取处理器芯片中的程序,再进行反编译得到汇编源代码。At present, there are mainly two ways to steal important information of the system. One is to directly read the executable program in the memory, and then decompile to obtain the assembly source code. For example, a burner can be used to read the executable program in the memory, and then decompile it. Another way is to load the program through the processor chip, read the program in the processor chip through the JTAG interface, and then decompile to obtain the assembly source code.

现有技术中,某些编译器集成的密码功能可实现一定条件下的防护,例如在运行程序时,可以使用带有加密功能的软件对处理器芯片进行加密。但是这种方法只能防止通过软件读取实时内存,并不能防止他人通过JTAG读取内存得到内存中的数据,也不能防止他人从内存中直接读取数据,防护效果差。In the prior art, the cryptographic function integrated by some compilers can realize protection under certain conditions, for example, when running a program, software with an encryption function can be used to encrypt the processor chip. However, this method can only prevent the real-time memory from being read by software, and cannot prevent others from reading the memory through JTAG to obtain the data in the memory, nor can it prevent others from directly reading the data from the memory, and the protection effect is poor.

基于现有的相关技术存在的上述缺陷,本申请实施例提供了一种安全防护系统、方法、电子设备及存储介质,至少在一定程度上克服现有的相关技术所存在的缺陷。Based on the above-mentioned defects in the existing related technologies, the embodiments of the present application provide a security protection system, method, electronic device, and storage medium, which overcome the defects in the existing related technologies at least to a certain extent.

需要说明的是,本申请实施例提供的安全防护系统中,模块之间一般采用总线进行连接。其中,总线分为片总线(Chip Bus,C-Bus)、内总线(Internal Bus,I-Bus)和外总线(External Bus,E-Bus)。在本申请实施例中,处理器、安全防护模块和内存模块之间一般采用片总线如I2C总线或SCI总线进行连接。相对地,安全防护模块之内的连接一般采用内总线如PCI总线进行连接。需要明确的是,以上总线仅为举例,并不构成对安全防护系统的限制,可以按照实际需求对总线类别进行调整。It should be noted that, in the security protection system provided by the embodiments of the present application, the modules are generally connected by a bus. Among them, the bus is divided into a chip bus (Chip Bus, C-Bus), an internal bus (Internal Bus, I-Bus) and an external bus (External Bus, E-Bus). In this embodiment of the present application, a chip bus such as an I2C bus or an SCI bus is generally used for connection between the processor, the security protection module, and the memory module. On the contrary, the connection within the security protection module generally adopts an internal bus such as a PCI bus for connection. It should be clarified that the above bus is only an example, and does not constitute a restriction on the safety protection system, and the bus type can be adjusted according to actual needs.

下面,开始结合附图介绍本申请实施例提供的安全防护系统。Next, the security protection system provided by the embodiments of the present application will be introduced with reference to the accompanying drawings.

虽然附图中各模块间的连接关系,但是,本申请实施例中各模块间的连接关系只是示意性说明,并不构成对安全防护系统的限定。各模块可以采用本申请实施例中不同的连接方式,或多种连接方式的组合。Although the connection relationship between the modules in the drawings, the connection relationship between the modules in the embodiment of the present application is only a schematic illustration, and does not constitute a limitation on the safety protection system. Each module may adopt different connection manners in the embodiments of the present application, or a combination of multiple connection manners.

参照图1,该安全防护系统包括处理器10、安全防护模块20和内存模块30,所述处理器10与所述安全防护模块20通信连接,所述安全防护模块20与所述内存模块30通信连接,所述安全防护模块20与所述内存模块30通信连接。1 , the security protection system includes a processor 10 , a security protection module 20 and a memory module 30 , the processor 10 is connected in communication with the security protection module 20 , and the security protection module 20 is in communication with the memory module 30 connected, the security protection module 20 is connected to the memory module 30 in communication.

处理器10,用于发送读取命令至安全防护模块20。具体地,读取命令是指用于读取内存模块30中待读取密文的机器指令,包括待读取密文在内存模块30中的存储位置,即地址信息。The processor 10 is configured to send a read command to the security protection module 20 . Specifically, the read command refers to a machine instruction for reading the ciphertext to be read in the memory module 30 , including the storage location of the ciphertext to be read in the memory module 30 , that is, address information.

同时,处理器10中包含了设备信息,所述设备信息可以包括处理器10的序列号,每一个处理器10都拥有唯一的序列号。例如处理器A的序列号是BFEBFBFF000206D6,则该序列号对应且只对应处理器A。Meanwhile, the processor 10 contains device information, and the device information may include the serial number of the processor 10, and each processor 10 has a unique serial number. For example, the serial number of processor A is BFEBFBFF000206D6, then the serial number corresponds to and only corresponds to processor A.

处理器10的有多种表现形式,示例性地,处理器10可以是:数字信号处理器10(Digital Signal Processor,以下简称DSP)、中央处理器10(central processing unit,以下简称CPU)。进一步地,还可以同时结合DSP和CPU作为处理器。The processor 10 can be represented in various forms, for example, the processor 10 may be: a digital signal processor 10 (Digital Signal Processor, hereinafter referred to as DSP) and a central processing unit (central processing unit, hereinafter referred to as CPU). Further, the DSP and the CPU can also be combined as the processor at the same time.

内存模块30,用于存储待读取密文。具体地,待读取密文是指预先存储在内存中的加密数据。The memory module 30 is used to store the ciphertext to be read. Specifically, the ciphertext to be read refers to encrypted data pre-stored in the memory.

在一些实施例中,内存模块30还可以用于待写入密文。其中,待写入密文是对写入命令携带的待写入明文加密后得到的信息。In some embodiments, the memory module 30 may also be used for ciphertext to be written. The ciphertext to be written is the information obtained by encrypting the plaintext to be written carried by the write command.

进一步地,可以采用闪存(Flash)作为内存模块30。Flash具备电子可擦除可编程(EEPROM)的性能,在不会断电丢失数据的同时可以快速读取数据。闪存包括NAND Flash和NOR Flash,在设计安全防护系统时可以综合考虑成本和容量等因素选择合适的闪存作为内存模块30。Further, a flash memory (Flash) may be used as the memory module 30 . Flash has the performance of electronically erasable and programmable (EEPROM), which can quickly read data without losing data when power is turned off. The flash memory includes NAND Flash and NOR Flash. When designing a security protection system, a suitable flash memory can be selected as the memory module 30 by comprehensively considering factors such as cost and capacity.

安全防护模块20,用于生成并根据初始密钥对所述待读取密文进行解密处理,得到待读取明文。初始密钥是指用于解密待读取密文的参数,可以根据处理器10的设备信息在安全防护模块20中生成,具体可以为矩阵,也可以为二进制字符串。由于每个处理器10都有唯一的设备信息,因此对于每个处理器10都会生成唯一的初始密钥。The security protection module 20 is configured to generate and decrypt the ciphertext to be read according to the initial key to obtain the plaintext to be read. The initial key refers to a parameter used to decrypt the ciphertext to be read, which can be generated in the security protection module 20 according to the device information of the processor 10, and can be a matrix or a binary string. Since each processor 10 has unique device information, a unique initial key is generated for each processor 10.

本申请实施例提供了包括处理器、内存模块和安全防护模块的安全防护系统。主要通过新增安全防护模块对待读取密文进行解密处理,通过内存模块用于存储待读取密文,通过处理器发送读取指令。The embodiments of the present application provide a security protection system including a processor, a memory module and a security protection module. It mainly decrypts the ciphertext to be read by adding a new security protection module, uses the memory module to store the ciphertext to be read, and sends a reading instruction through the processor.

采用该安全防护系统读取内存中的数据时,首先根据处理器中的设备信息生成特定的初始密钥,根据初始密钥对内存中的待读取密文解密后才能得到待读取明文,因此若初始密钥不匹配则无法成功对待读取密文进行解密,可以有效防止通过JTAG接口窃取数据,同时由于内存中存储的是待读取密文,对内存进行数据读取时也无法直接获得数据。下面,以处理器是计算机中CPU、内存模块是计算机中的Flash为例,具体说明安全防护系统的工作过程:When using the security protection system to read data in the memory, first generate a specific initial key according to the device information in the processor, and decrypt the ciphertext to be read in the memory according to the initial key to obtain the plaintext to be read. Therefore, if the initial keys do not match, the ciphertext to be read cannot be successfully decrypted, which can effectively prevent data theft through the JTAG interface. At the same time, since the ciphertext to be read is stored in the memory, it is not possible to directly read data from the memory. get data. Hereinafter, the working process of the security protection system will be described in detail, taking the processor as the CPU in the computer and the memory module as the Flash in the computer as an example:

(1)上电后,安全防护模块获取CPU的设备信息并生成初始密钥。(1) After power-on, the security protection module obtains the device information of the CPU and generates an initial key.

(2)安全防护模块读取Flash中的待读取密文,根据初始密钥对待读取密文进行解密处理,得到待读取明文并存储。上电初始化过程完成。(2) The security protection module reads the ciphertext to be read in the Flash, decrypts the ciphertext to be read according to the initial key, obtains the plaintext to be read and stores it. The power-on initialization process is complete.

(3)CPU发送读取命令至安全防护模块,安全防护模块根据读取命令将待读取明文返回至CPU。(3) The CPU sends a read command to the security protection module, and the security protection module returns the plaintext to be read to the CPU according to the read command.

其中,待读取明文是指将待读取密文解密后得到的未加密数据。The plaintext to be read refers to unencrypted data obtained by decrypting the ciphertext to be read.

进一步地,为了降低成本和加快运算的速度,安全防护模块20可以集成在现场可编程逻辑门阵列(Field Programmable Gate Array,以下简称FPGA)上。Further, in order to reduce the cost and speed up the operation, the security protection module 20 can be integrated on a Field Programmable Gate Array (Field Programmable Gate Array, hereinafter referred to as FPGA).

在一些实施例中,对待读取密文进行解密处理时采用的解密算法可以是对称算法。对称加密算法是指对于某一数据,加密和解密采用的密钥是相同的密钥,因此初始密钥既可以对待读取明文加密生成待读取密文,又可以对待读取密文解密生成待读取明文,即将数据加密并写入内存模块30时,同样采用了初始密钥对数据进行加密。例如,当采用DES算法作为解密算法对内存中的数据进行读取时,若初始密钥是123456789,待读取密文是-60fd73ff69e3352e5e2e976c55e6ed92,可以得到待读取明文“helloWorld”。反之,在将待读取明文加密并写入内存模块30时,同样可以采用初始密钥123456789对待读取明文helloWorld进行加密,得到待读取密文-60fd73ff69e3352e5e2e976c55e6ed92。In some embodiments, the decryption algorithm used when decrypting the ciphertext to be read may be a symmetric algorithm. Symmetric encryption algorithm means that for a certain data, the key used for encryption and decryption is the same key, so the initial key can not only encrypt the plaintext to be read to generate the ciphertext to be read, but also can be decrypted to generate the ciphertext to be read. When the plaintext is to be read, that is, when the data is encrypted and written into the memory module 30, the initial key is also used to encrypt the data. For example, when using the DES algorithm as the decryption algorithm to read the data in the memory, if the initial key is 123456789 and the ciphertext to be read is -60fd73ff69e3352e5e2e976c55e6ed92, the plaintext to be read "helloWorld" can be obtained. Conversely, when the plaintext to be read is encrypted and written into the memory module 30, the initial key 123456789 can also be used to encrypt the plaintext to be read helloWorld to obtain the ciphertext to be read -60fd73ff69e3352e5e2e976c55e6ed92.

在一些实施例中,对待读取密文进行解密处理时采用的解密算法还可以是混合算法,即同时采用对称算法和非对称算法以进一步提高数据的安全性,此时待读取密文根据待读取明文和对初始密钥用预设公钥加密后得到的密钥(以下简称第二初始密钥)生成,具体为以第二初始密钥对待读取明文加密,得到待读取密文。具体地,可以首先根据与预设公钥匹配的预设私钥对第二初始密钥解密,得到初始密钥,然后根据初始密钥对待读取密文解密,得到待读取明文。In some embodiments, the decryption algorithm used in decrypting the ciphertext to be read may also be a hybrid algorithm, that is, a symmetric algorithm and an asymmetric algorithm are used at the same time to further improve the security of the data. At this time, the ciphertext to be read is based on The plaintext to be read and the key obtained by encrypting the initial key with a preset public key (hereinafter referred to as the second initial key) are generated, specifically encrypting the plaintext to be read with the second initial key to obtain the key to be read. arts. Specifically, the second initial key can be decrypted according to the preset private key matching the preset public key to obtain the initial key, and then the ciphertext to be read can be decrypted according to the initial key to obtain the plaintext to be read.

进一步地,初始密钥还可以存储在安全防护系统中。例如,初始密钥可以存储在内存模块30中。此时处理器10发送的读取命令中包含了初始密钥存储的地址,因此通过读取命令,可以同时获取待读取密文和初始密钥。Further, the initial key can also be stored in the security protection system. For example, the initial key may be stored in the memory module 30 . At this time, the read command sent by the processor 10 includes the address where the initial key is stored. Therefore, through the read command, the ciphertext to be read and the initial key can be obtained at the same time.

在安全防护模块20对待读取密文解密完成并得到待读取明文后,处理器10还用于获取待读取明文,以完成从内存模块30中读取信息的过程。After the security protection module 20 completes the decryption of the ciphertext to be read and obtains the plaintext to be read, the processor 10 is further configured to obtain the plaintext to be read to complete the process of reading information from the memory module 30 .

因此采用上述的安全防护系统,可以在通过JTAG接口读取内存中的数据时,首先在安全防护模块中根据处理器10中的设备信息生成特定的初始密钥,然后在安全防护模块中根据初始密钥对内存中的待读取密文解密后才能得到待读取明文,因此若初始密钥不匹配则无法成功对待读取密文进行解密,而对内存进行数据读取时,由于内存中存储的是待读取密文,因此直接对内存进行读取也无法得到明文数据。Therefore, using the above security protection system, when reading data in the memory through the JTAG interface, first generate a specific initial key in the security protection module according to the device information in the processor 10, and then in the security protection module according to the initial The plaintext to be read can only be obtained after the key decrypts the ciphertext to be read in the memory. Therefore, if the initial key does not match, the ciphertext to be read cannot be successfully decrypted. The ciphertext to be read is stored, so the plaintext data cannot be obtained by directly reading the memory.

请参照图2,接下来以图2说明安全防护系统中安全防护模块的一种实施例。对于一些安全防护系统,其中的安全防护模块20可以包括密钥生成模块210、加解密模块220、外部缓存模块230和命令控制模块240,所述密钥生成模块210、所述加解密模块220、所述命令控制模块240和所述外部缓存模块230依次通信连接,所述命令控制模块240分别与所述内存模块30和所述处理器10通信连接。Please refer to FIG. 2 . Next, FIG. 2 is used to describe an embodiment of a security protection module in a security protection system. For some security protection systems, the security protection module 20 may include a key generation module 210, an encryption and decryption module 220, an external cache module 230 and a command control module 240. The key generation module 210, the encryption and decryption module 220, The command control module 240 and the external cache module 230 are sequentially connected in communication, and the command control module 240 is respectively connected in communication with the memory module 30 and the processor 10 .

密钥生成模块210,用于获取所述设备信息,并在上电时生成所述初始密钥。具体地,在对安全防护系统上电后,密钥生成模块210获取处理器10中的设备信息,根据设备信息生成初始密钥并发送给加解密模块220。The key generation module 210 is configured to acquire the device information and generate the initial key when powered on. Specifically, after the security protection system is powered on, the key generation module 210 acquires the device information in the processor 10 , generates an initial key according to the device information, and sends it to the encryption and decryption module 220 .

加解密模块220,用于获取所述待读取密文,并根据所述初始密钥对所述待读取密文进行解密处理,得到所述待读取明文。具体地,加解密模块220获得初始密钥后,从内存模块30中获取待读取密文,然后根据初始密钥对待读取密文进行解密处理,得到待读取明文并发送到命令控制模块240中。The encryption and decryption module 220 is configured to obtain the ciphertext to be read, and decrypt the ciphertext to be read according to the initial key to obtain the plaintext to be read. Specifically, after obtaining the initial key, the encryption and decryption module 220 obtains the ciphertext to be read from the memory module 30, and then decrypts the ciphertext to be read according to the initial key to obtain the plaintext to be read and sends it to the command control module 240 in.

在一些实施例中,加解密模块220中可以采用对称算法对待读取密文进行解密。此时,密钥生成模块210生成的密钥为根据设备信息生成的对称密钥。In some embodiments, the encryption and decryption module 220 may use a symmetric algorithm to decrypt the ciphertext to be read. At this time, the key generated by the key generation module 210 is a symmetric key generated according to the device information.

在一些实施例中,加解密模块220中可以采用混合算法对待读取密文进行解密,此时,密钥生成模块210生成的密钥包括私钥和初始密钥。In some embodiments, the encryption/decryption module 220 may use a hybrid algorithm to decrypt the ciphertext to be read. In this case, the key generated by the key generation module 210 includes a private key and an initial key.

进一步地,根据加解密模块220中采用的解密算法,解密后得到待读取明文的数据位宽不同。例如若采用AES算法,则数据位宽可以为256bit,若采用DES算法,则数据位宽为128bit。Further, according to the decryption algorithm adopted in the encryption and decryption module 220, the data bit widths of the plaintext to be read obtained after decryption are different. For example, if the AES algorithm is adopted, the data bit width can be 256 bits, and if the DES algorithm is adopted, the data bit width is 128 bits.

在一些实施例中,加解密模块220还可以存储初始密钥,并且在掉电后自动初始化以删除存储的初始密钥,在省去多次生成初始密钥的同时避免在两次上电中密钥重复读写。In some embodiments, the encryption/decryption module 220 may also store the initial key, and automatically initialize after power-off to delete the stored initial key, which saves the need to generate the initial key multiple times and avoids the need for two power-ups. The key is repeatedly read and written.

外部缓存模块230,用于存储所述待读取明文。具体地,在加解密模块220将待读取明文发送到命令控制模块240中后,外部缓存模块230获取并储存命令控制模块240发送的待读取明文。The external cache module 230 is used for storing the plaintext to be read. Specifically, after the encryption/decryption module 220 sends the plaintext to be read to the command control module 240 , the external cache module 230 acquires and stores the plaintext to be read sent by the command control module 240 .

进一步地,外部缓存模块230可以包括静态随机存取存储器(Static Random-Access Memory,以下简称Sram),当外部缓存模块230是Sram时,外部缓存模块230还可以解决处理器10和安全防护模块20之间存储总线频率和安全防护模块20的工作时钟频率不同的问题,避免因为该问题而导致的数据丢失。Further, the external cache module 230 may include a static random-access memory (Static Random-Access Memory, hereinafter referred to as Sram). When the external cache module 230 is a Sram, the external cache module 230 can also solve the problem of the processor 10 and the security protection module 20. The problem that the frequency of the storage bus and the operating clock frequency of the security protection module 20 are different is avoided, so as to avoid data loss caused by this problem.

命令控制模块240,用于获取所述读取命令,并根据所述读取命令读取并返回所述外部缓存模块230中的所述待读取明文至所述处理器10。具体地,命令控制模块240获取读取命令后,将读取命令转换为对外部缓存模块的读取请求,并根据读取请求中的地址信息,从外部缓存模块230中获取地址信息对应的待读取密文。The command control module 240 is configured to obtain the read command, and read and return the plaintext to be read in the external cache module 230 to the processor 10 according to the read command. Specifically, after the command control module 240 obtains the read command, it converts the read command into a read request to the external cache module, and obtains from the external cache module 230 the address information corresponding to the address information according to the address information in the read request. Read the ciphertext.

进一步地,在上电时命令控制模块240还可以用于将加解密模块220对待读取密文解密后得到的待读取明文转换为对外部缓存模块230的写入请求,具体地,写入请求还包括外部缓存模块230中写入的目标地址。Further, when the power is turned on, the command control module 240 can also be used to convert the plaintext to be read obtained after decrypting the ciphertext to be read by the encryption and decryption module 220 into a write request to the external cache module 230, specifically, to write The request also includes the target address written in the external cache module 230 .

进一步地,命令控制模块240还用于对处理器10发送的读取命令进行解析处理,将读取命令的格式转化为外部缓存模块230或内存模块30适用的格式,格式可以包括编码格式和语法格式。Further, the command control module 240 is also used to parse and process the read command sent by the processor 10, and convert the format of the read command into a format suitable for the external cache module 230 or the memory module 30, and the format may include an encoding format and a grammar. Format.

下面,以安全防护系统的处理器是计算机中CPU、内存模块是计算机中的Flash、安全防护模块是在计算机中新增模块为例,具体说明该申请实施例中安全防护系统的工作过程:Below, take as an example that the processor of the security protection system is the CPU in the computer, the memory module is the Flash in the computer, and the security protection module is a newly added module in the computer, the working process of the security protection system in the embodiment of the application is specifically described:

(1)上电时,在安全防护系统上电后,安全防护模块20中的密钥生成模块210首先获取CPU的设备信息,然后根据设备信息生成初始密钥。(1) When powered on, after the security protection system is powered on, the key generation module 210 in the security protection module 20 first obtains the device information of the CPU, and then generates an initial key according to the device information.

(2)加解密模块获取Flash中的待读取密文,并根据初始密钥对待读取密文进行解密处理,得到待读取明文。上电初始化过程完成。(2) The encryption and decryption module obtains the ciphertext to be read in the Flash, and decrypts the ciphertext to be read according to the initial key to obtain the plaintext to be read. The power-on initialization process is complete.

(3)CPU发送读取命令至命令控制模块,命令控制模块将读取命令转换为对Sram的读取请求,根据读取请求返回待读取明文至CPU。(3) The CPU sends the read command to the command control module, and the command control module converts the read command into a read request for Sram, and returns the plaintext to be read to the CPU according to the read request.

其中,安全防护模块20还可以包括数据转换模块。具体地,数据转换模块用于将待读取明文转换为特定数据位宽的明文,其中特定数据位宽与外部缓存模块230的存储位宽一致。例如,当外部缓存模块230包括Sram时,外部缓存模块230的存储位宽是16bit,因此特定数据位宽为16bit。若加解密模块220采用AES-128算法作为解密算法,解密后明文的位宽为128bit,则数据转换模块可以将128bit的待写入明文转换为16bit的数据,然后将转换后的数据传送至命令控制模块240中。Wherein, the security protection module 20 may further include a data conversion module. Specifically, the data conversion module is configured to convert the plaintext to be read into plaintext with a specific data bit width, where the specific data bit width is consistent with the storage bit width of the external cache module 230 . For example, when the external cache module 230 includes SRAM, the storage bit width of the external cache module 230 is 16 bits, so the specific data bit width is 16 bits. If the encryption and decryption module 220 adopts the AES-128 algorithm as the decryption algorithm, and the bit width of the decrypted plaintext is 128 bits, the data conversion module can convert the 128-bit plaintext to be written into 16-bit data, and then transmit the converted data to the command in the control module 240.

在一些实施例中,密钥生成模块210可以在上电时先获取密钥。然后根据读取命令的地址信息,加解密模块220对内存模块30中地址信息所对应的待读取密文进行解密处理,并将解密后得到的待读取明文存储在外部缓存模块230中,最后命令控制模块240将外部缓存模块230中的待读取明文返回至处理器10。In some embodiments, the key generation module 210 may first obtain the key when powered on. Then, according to the address information of the read command, the encryption and decryption module 220 decrypts the ciphertext to be read corresponding to the address information in the memory module 30, and stores the decrypted plaintext to be read in the external cache module 230, Finally, the command control module 240 returns the plaintext to be read in the external cache module 230 to the processor 10 .

在一些实施例中,安全防护模块20可以在上电时先在加解密模块220中根据初始密钥对内存模块30中的所有待读取密文进行解密,然后将解密后得到的待读取明文存储在外部缓存模块230中。当处理器10发送读取命令时,根据读取命令的地址信息从外部缓存中返回地址信息所对应的待读取明文至处理器10。这种读取方式可以在上电时就将待读取密文解密并将解密后得到的待读取明文存储在外部缓存模块230中,减少读取的时间。In some embodiments, the security protection module 20 may first decrypt all the ciphertexts to be read in the memory module 30 according to the initial key in the encryption/decryption module 220 when powered on, and then decrypt the decrypted ciphertexts to be read. The plaintext is stored in the external cache module 230 . When the processor 10 sends the read command, the plaintext to be read corresponding to the address information is returned from the external cache to the processor 10 according to the address information of the read command. In this reading method, the ciphertext to be read can be decrypted when the power is turned on, and the decrypted plaintext to be read can be stored in the external cache module 230, thereby reducing the reading time.

在一些实际场景中,为了提高解密的速度,安全防护模块20还包括内部缓存模块250,所述内部缓存模块250分别与所述内存模块30和所述加解密模块220通信连接,用于从所述内存模块30中获取并存储所述待读取密文,并在所述加解密模块220接收到所述初始密钥时,将所述待读取密文输入到所述加解密模块220中。In some practical scenarios, in order to improve the decryption speed, the security protection module 20 further includes an internal cache module 250, and the internal cache module 250 is connected in communication with the memory module 30 and the encryption and decryption module 220, respectively, and is used for obtaining data from all The memory module 30 acquires and stores the ciphertext to be read, and when the encryption/decryption module 220 receives the initial key, inputs the ciphertext to be read into the encryption/decryption module 220 .

其中,内部缓存模块250可以为Fifo存储器(First Input First Output,以下简称Fifo)。上电时,密钥生成模块210在生成初始密钥的过程中,数据转换模块首先发送内部读取请求将内存模块30中的待读取密文存储至Fifo中,当初始密钥生成后,将待读取密文从Fifo中发送到加解密模块220,然后在加解密模块220中实现待读取密文的解密。The internal cache module 250 may be a Fifo memory (First Input First Output, hereinafter referred to as Fifo). When powered on, in the process of generating the initial key by the key generation module 210, the data conversion module first sends an internal read request to store the ciphertext to be read in the memory module 30 into the Fifo. After the initial key is generated, The ciphertext to be read is sent from the Fifo to the encryption and decryption module 220, and then the encryption and decryption module 220 implements the decryption of the ciphertext to be read.

通过增加内部缓存模块250,可以在生成初始密钥的过程中提前将待读取密文读出,当初始密钥生成后直接进行待读取密文的解密,减少了上电初始化的时间,提高了效率。By adding the internal cache module 250, the ciphertext to be read can be read out in advance in the process of generating the initial key, and the ciphertext to be read can be decrypted directly after the initial key is generated, which reduces the power-on initialization time. Increased efficiency.

通过设置内部缓存模块250,可以在对外部缓存模块230进行读操作或写操作时,预先在内部缓存模块250中暂存解析处理后的读取命令或处理后的写入命令,在上一个对外部缓存模块230进行的读操作或写操作结束后,可以马上进行下一个读操作或写操作,提高操作的效率。By setting the internal cache module 250, when a read operation or a write operation is performed on the external cache module 230, the read command after parsing or the processed write command can be temporarily stored in the internal cache module 250 in advance, and the After the read operation or write operation performed by the external cache module 230 is completed, the next read operation or write operation can be performed immediately to improve the efficiency of the operation.

下面,以处理器是计算机中CPU、内存模块是计算机中的Flash,外部缓存模块是Sram,内部缓存模块是Fifo为例,具体说明该申请实施例中安全防护系统的工作过程:Below, take the processor as the CPU in the computer, the memory module as the Flash in the computer, the external cache module as the Sram, and the internal cache module as the Fifo as an example to specifically describe the working process of the security protection system in the application embodiment:

(1)在安全防护系统上电后,安全防护模块20中的密钥生成模块210首先获取CPU的设备信息,然后根据设备信息进行密钥生成操作。(1) After the security protection system is powered on, the key generation module 210 in the security protection module 20 first obtains the device information of the CPU, and then performs a key generation operation according to the device information.

(2)在密钥生成模块210进行密钥生成操作的同时,数据转换模块将Flash中的待读取密文保存在Fifo中。当密钥生成操作完成,加解密模块220得到初始密钥时,数据转换模块将Fifo中的待读取密文发送到加解密模块220中。(2) While the key generation module 210 performs the key generation operation, the data conversion module saves the ciphertext to be read in the Flash in the Fifo. When the key generation operation is completed and the encryption/decryption module 220 obtains the initial key, the data conversion module sends the ciphertext to be read in the Fifo to the encryption/decryption module 220 .

(3)加解密模块220根据初始密钥对待读取密文进行解密,得到待读取明文,待读取明文经过命令控制模块240的处理转换为对Sram的写操作请求后,存储在Sram中。上电初始化过程完成。(3) The encryption and decryption module 220 decrypts the ciphertext to be read according to the initial key, and obtains the plaintext to be read. After the plaintext to be read is converted into a write operation request to the Sram after being processed by the command control module 240, it is stored in the Sram . The power-on initialization process is complete.

(4)CPU发出读取命令,命令控制模块将读取命令转换为对Sram的读取请求,并根据读取请求返回Sram中的待读取明文至CPU。(4) The CPU issues a read command, and the command control module converts the read command into a read request to the Sram, and returns the plaintext to be read in the Sram to the CPU according to the read request.

在一些实际场景中,为了使安全防护系统能够适用于多种处理器10,安全防护模块20还包括接口模块260,所述接口模块260分别与所述处理器10、所述内存模块30和所述命令控制模块240通信连接。In some practical scenarios, in order to make the security protection system applicable to various processors 10, the security protection module 20 further includes an interface module 260, the interface module 260 is respectively connected with the processor 10, the memory module 30 and all the The command control module 240 is communicatively connected.

下面参照图3说明该申请实施例中安全防护系统的构成。The following describes the structure of the safety protection system in the embodiment of the application with reference to FIG. 3 .

在一些实施例中,接口模块260用于根据所述时序信息将所述读取命令转换为所述读取操作请求。具体地,接口模块260可以对处理器10发送的读取命令进行时序采样和解析,获取其中的时序信息。然后根据时序信息,生成读取操作请求,读取操作请求包括对所述外部缓存模块中待读取明文的读取请求。In some embodiments, the interface module 260 is configured to convert the read command into the read operation request according to the timing information. Specifically, the interface module 260 may perform timing sampling and analysis on the read command sent by the processor 10 to obtain timing information therein. Then, according to the timing information, a read operation request is generated, and the read operation request includes a read request for the plaintext to be read in the external cache module.

在一些实施例中,接口模块260还用于将命令控制模块对读取命令转换后生成的读取请求转换为对外部缓存模块的写时序,其中,所述写时序用于将待读取明文写入所述外部缓存模块230中。In some embodiments, the interface module 260 is further configured to convert the read request generated after the command control module converts the read command into a write sequence to the external cache module, wherein the write sequence is used to convert the plaintext to be read. Write into the external cache module 230 .

进一步地,接口模块260还可以用于解决模块间的速度匹配问题。具体地,当输出模块的操作速度小于输入模块的操作速度时,接口模块260可以通过其中设置的数据寄存器对输入模块操作完成后产生的数据进行缓存,当输出模块操作完成后,获取缓存的数据再进行操作,避免输入模块输入的数据因为超出输出模块的数据处理能力而丢失。Further, the interface module 260 can also be used to solve the problem of speed matching between modules. Specifically, when the operation speed of the output module is lower than the operation speed of the input module, the interface module 260 can cache the data generated after the operation of the input module is completed through the data register set therein, and obtain the cached data after the operation of the output module is completed. Perform the operation again to avoid the loss of the data input by the input module because it exceeds the data processing capability of the output module.

接口模块260可以有多种存在形式,示例性地,包括可编程接口芯片,在这种情况下,可以通过对接口模块260中的程序参数进行调整,使接口模块260能够将不同类型处理器10输入的读写命令转换成读写操作请求,或者能够将读写操作请求转换成不同内存模块30可以识别的读写时序。The interface module 260 may exist in various forms, for example, including a programmable interface chip. In this case, by adjusting the program parameters in the interface module 260, the interface module 260 can be used to connect different types of processors 10 . The input read and write commands are converted into read and write operation requests, or the read and write operation requests can be converted into read and write sequences that can be recognized by different memory modules 30 .

下面,以处理器是计算机中CPU、内存模块是计算机中的Flash,外部缓存模块是Sram,内部缓存模块是Fifo为例,具体说明该申请实施例中安全防护系统的工作过程:Below, take the processor as the CPU in the computer, the memory module as the Flash in the computer, the external cache module as the Sram, and the internal cache module as the Fifo as an example to specifically describe the working process of the security protection system in the application embodiment:

(1)在安全防护系统上电后,安全防护模块20中的密钥生成模块210首先获取CPU的设备信息,然后根据设备信息进行密钥生成操作。(1) After the security protection system is powered on, the key generation module 210 in the security protection module 20 first obtains the device information of the CPU, and then performs a key generation operation according to the device information.

(2)在密钥生成模块210进行密钥生成操作的同时,数据转换模块将Flash中的待读取密文保存在Fifo中。当密钥生成操作完成,加解密模块220得到初始密钥时,数据转换模块将Fifo中的待读取密文发送到加解密模块220中。(2) While the key generation module 210 performs the key generation operation, the data conversion module saves the ciphertext to be read in the Flash in the Fifo. When the key generation operation is completed and the encryption/decryption module 220 obtains the initial key, the data conversion module sends the ciphertext to be read in the Fifo to the encryption/decryption module 220 .

(3)加解密模块220根据初始密钥对待读取密文进行解密,得到待读取明文,待读取明文经过命令控制模块240的处理转换为对Sram的写操作请求。(3) The encryption and decryption module 220 decrypts the ciphertext to be read according to the initial key to obtain the plaintext to be read. The plaintext to be read is processed by the command control module 240 and converted into a write operation request to Sram.

(4)接口模块将写操作请求转换为写时序,将待写入明文存储在Sram中。上电初始化过程完成。(4) The interface module converts the write operation request into a write sequence, and stores the plaintext to be written in Sram. The power-on initialization process is complete.

(5)CPU发出读取命令,接口模块260对读取命令进行时序解析,生成读取操作请求,然后命令控制模块将读取操作请求转换为对Sram的读取请求,并根据读取请求返回Sram中的待读取明文至CPU。(5) The CPU issues a read command, the interface module 260 performs time sequence analysis on the read command, generates a read operation request, and then the command control module converts the read operation request into a read request for Sram, and returns according to the read request The plaintext to be read in Sram is sent to the CPU.

在一些实际场景中,为了增强初始密钥的安全性,还可以对初始密钥进行迭代以得到迭代密钥,再根据迭代密钥对待读取密文进行解密。具体地,可以采用现有技术中的密钥迭代方法对初始密钥进行迭代,例如可以采用AES算法中的密钥迭代方法,对初始密钥进行包括字节代换、行移位、列混合和轮密钥加等操作,最终得到迭代密钥。进一步地,对初始密钥进行迭代的轮数可以根据实际场景需要进行调整。例如当采用AES-128算法时,通常对初始密钥进行10轮迭代。又如当采用AES-256算法时,通常对初始密钥进行14轮迭代。In some practical scenarios, in order to enhance the security of the initial key, the initial key can also be iterated to obtain the iterative key, and then the ciphertext to be read is decrypted according to the iterative key. Specifically, the key iteration method in the prior art can be used to iterate the initial key. For example, the key iteration method in the AES algorithm can be used to perform byte substitution, row shift, and column mixing on the initial key. And round key addition and other operations, and finally get the iteration key. Further, the number of rounds for iterating on the initial key can be adjusted according to actual scene needs. For example, when using the AES-128 algorithm, 10 rounds of iterations are usually performed on the initial key. For another example, when the AES-256 algorithm is used, 14 rounds of iterations are usually performed on the initial key.

下面,以处理器是计算机中CPU、内存模块是计算机中的Flash,外部缓存模块是Sram,内部缓存模块是Fifo为例,具体说明该申请实施例中安全防护系统的工作过程:Below, take the processor as the CPU in the computer, the memory module as the Flash in the computer, the external cache module as the Sram, and the internal cache module as the Fifo as an example to specifically describe the working process of the security protection system in the application embodiment:

(1)在安全防护系统上电后,安全防护模块20中的密钥生成模块210首先获取CPU的设备信息,然后根据设备信息进行生成初始密钥。加解密获取初始密钥,并对初始密钥进行迭代计算处理,得到迭代密钥。(1) After the security protection system is powered on, the key generation module 210 in the security protection module 20 first obtains the device information of the CPU, and then generates an initial key according to the device information. The initial key is obtained by encryption and decryption, and the initial key is iteratively calculated to obtain the iterative key.

(2)在本申请实施例的步骤(1)进行的同时,数据转换模块将Flash中的待读取密文保存在Fifo中。当迭代密钥生成后,数据转换模块将Fifo中的待读取密文发送到加解密模块220中。(2) While step (1) in the embodiment of the present application is performed, the data conversion module saves the ciphertext to be read in the Flash in the Fifo. After the iterative key is generated, the data conversion module sends the ciphertext to be read in the Fifo to the encryption and decryption module 220 .

(3)加解密模块220根据迭代密钥对待读取密文进行解密,得到待读取明文,待读取明文经过命令控制模块240的处理转换为对Sram的写操作请求。(3) The encryption and decryption module 220 decrypts the ciphertext to be read according to the iterative key to obtain the plaintext to be read. The plaintext to be read is processed by the command control module 240 and converted into a write operation request to Sram.

(4)接口模块将写操作请求转换为写时序,将待写入明文存储在Sram中。上电初始化过程完成。(4) The interface module converts the write operation request into a write sequence, and stores the plaintext to be written in Sram. The power-on initialization process is complete.

(5)CPU发出读取命令,接口模块260对读取命令进行时序解析,生成读取操作请求,然后命令控制模块将读取操作请求转换为对Sram的读取请求,并根据读取请求返回Sram中的待读取明文至CPU。(5) The CPU issues a read command, the interface module 260 performs time sequence analysis on the read command, generates a read operation request, and then the command control module converts the read operation request into a read request for Sram, and returns according to the read request The plaintext to be read in Sram is sent to the CPU.

本申请实施例中的安全防护模块20还可以用于对待写入明文的加密。The security protection module 20 in this embodiment of the present application may also be used for encryption of plaintext to be written.

在这种情况下,处理器10会发出携带有待写入明文的写入命令至安全防护模块20。写入命令是指用于将待写入明文写入内存模块30的机器指令。In this case, the processor 10 will issue a write command carrying the plaintext to be written to the security protection module 20 . The write command refers to a machine instruction for writing plaintext to be written into the memory module 30 .

命令控制模块240在这种情况下用于获取写入命令。The command control module 240 is used in this case to obtain the write command.

外部缓存模块230在这种情况下还用于存储待写入命令携带的所述待写入明文。In this case, the external cache module 230 is further configured to store the to-be-written plaintext carried by the to-be-written command.

加解密模块220在这种情况下还用于根据所述初始密钥,对所述待写入明文进行加密处理,得到待写入密文。In this case, the encryption/decryption module 220 is further configured to perform encryption processing on the plaintext to be written according to the initial key to obtain the ciphertext to be written.

在一些实施例中,加解密模块220中采用对称算法对待写入明文进行加密。In some embodiments, the encryption and decryption module 220 uses a symmetric algorithm to encrypt the plaintext to be written.

在一些实施例中,加解密模块220中采用混合算法对待写入明文进行加密。In some embodiments, the encryption and decryption module 220 uses a hybrid algorithm to encrypt the plaintext to be written.

内存模块30在这种情况下还用于存储所述待写入密文。In this case, the memory module 30 is also used for storing the ciphertext to be written.

在一些实施例中,还可以采用密钥迭代模块对初始密钥进行迭代以生成迭代密钥,然后根据迭代密钥对待写入明文进行加密。In some embodiments, a key iteration module can also be used to iterate the initial key to generate an iteration key, and then encrypt the plaintext to be written according to the iteration key.

在一些实施例中,还可以采用接口模块260对处理器10发送的写入命令和读取命令进行上文所述的处理,使安全防护系统能够适用于多种处理器10。In some embodiments, the interface module 260 can also be used to process the write commands and read commands sent by the processor 10 as described above, so that the security protection system can be applied to various processors 10 .

在一些实施例中,还可以采用数据转换模块对外部缓存模块230中的待写入明文进行位宽转换,从而使发送到加解密模块220中数据的位宽匹配加密算法的要求。In some embodiments, the data conversion module may also be used to perform bit width conversion on the plaintext to be written in the external cache module 230, so that the bit width of the data sent to the encryption/decryption module 220 matches the requirements of the encryption algorithm.

下面,以处理器是计算机中CPU、内存模块是计算机中的Flash,外部缓存模块是Sram,内部缓存模块是Fifo为例,具体说明该申请实施例中安全防护系统的工作过程:Below, take the processor as the CPU in the computer, the memory module as the Flash in the computer, the external cache module as the Sram, and the internal cache module as the Fifo as an example to specifically describe the working process of the security protection system in the application embodiment:

(1)CPU发送写入命令至命令控制模块240,命令控制模块240将写入命令转换为写操作请求,其中,写操作请求中包含了待写入明文的信息。(1) The CPU sends a write command to the command control module 240, and the command control module 240 converts the write command into a write operation request, wherein the write operation request includes the information to be written in plaintext.

(2)将待写入明文的信息存储在Fifo中。(2) Store the information to be written in plaintext in the Fifo.

(3)若Fifo中存储的信息满足预设要求,则将Fifo中的信息存储至Sram中。对于本申请实施例中的情况,若加解密模块220中采用SM4算法作为加解密算法,则当Fifo中存入了8个连续地址的信息时,将Fifo中的信息存储至Sram中。(3) If the information stored in the Fifo meets the preset requirements, the information in the Fifo is stored in the Sram. For the situation in the embodiment of the present application, if the encryption and decryption module 220 adopts the SM4 algorithm as the encryption and decryption algorithm, when the information of 8 consecutive addresses is stored in the Fifo, the information in the Fifo is stored in the Sram.

(4)数据转换模块将Sram中的信息转换为符合加解密算法220位宽要求的数据后,在加解密模块220中根据初始密钥对转换后得到的数据进行加密,得到待写入密文。(4) After the data conversion module converts the information in the Sram into data that meets the 220-bit width requirement of the encryption and decryption algorithm, the encryption and decryption module 220 encrypts the converted data according to the initial key to obtain the ciphertext to be written .

(5)数据转换模块对待写入密文进行处理,得到数据位宽符合Flash存储位宽要求的待写入密文,接口模块260和命令控制模块240对处理后的待写入密文进行处理后,将其存储在Flash中。(5) The data conversion module processes the to-be-written ciphertext to obtain the to-be-written ciphertext whose data bit width meets the flash storage bit width requirement. The interface module 260 and the command control module 240 process the processed to-be-written ciphertext After that, store it in Flash.

下面,介绍基于本申请中安全防护系统实现的安全防护方法。Next, a security protection method implemented based on the security protection system in the present application is introduced.

本申请实施例安全防护方法的执行主体可以为本申请实施例提供的安全防护系统,或者集成了该安全防护系统的服务器设备、物理主机或者用户设备(User Equipment,UE)等不同类型的电子设备,其中,安全防护系统可以采用硬件或者软件的方式实现,UE具体可以为智能手机、平板电脑、笔记本电脑、掌上电脑、台式电脑或者个人数字助理(Personal Digital Assistant,PDA)等终端设备。The execution body of the security protection method in the embodiment of the present application may be the security protection system provided in the embodiment of the present application, or different types of electronic devices such as a server device, a physical host, or user equipment (User Equipment, UE) integrated with the security protection system. , wherein the security protection system may be implemented in hardware or software, and the UE may specifically be a terminal device such as a smart phone, tablet computer, notebook computer, palmtop computer, desktop computer, or personal digital assistant (Personal Digital Assistant, PDA).

该电子设备可以采用单独运行的工作方式,或者也可以采用设备集群的工作方式,通过应用本申请实施例提供的安全防护方法,在通过JTAG接口读取内存中的数据时,首先根据处理器中的设备信息生成特定的初始密钥,根据初始密钥对内存中的待读取密文解密后才能得到待读取明文,因此若初始密钥不匹配则无法成功对待读取密文进行解密,而对内存进行数据读取时,由于内存中存储的是待读取密文,因此直接对内存进行读取也无法得到明文数据。The electronic device may use a working mode of independent operation, or may also use a working mode of device cluster. By applying the security protection method provided by the embodiment of the present application, when reading data in the memory through the JTAG interface, firstly according to the data in the processor The device information of the device generates a specific initial key. According to the initial key, the ciphertext to be read in the memory can be decrypted to obtain the plaintext to be read. Therefore, if the initial key does not match, the ciphertext to be read cannot be successfully decrypted. When reading data from the memory, since the ciphertext to be read is stored in the memory, the plaintext data cannot be obtained by directly reading the memory.

参照图4,图4是本申请实施例提供的安全防护方法的一种流程示意图,所述安全防护方法基于安全防护系统实现。需要说明的是,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。该安全防护方法包括步骤S10~S30,其中:Referring to FIG. 4 , FIG. 4 is a schematic flowchart of a security protection method provided by an embodiment of the present application, where the security protection method is implemented based on a security protection system. It should be noted that although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be performed in an order different from that herein. The security protection method includes steps S10-S30, wherein:

S10、根据所述处理器10的设备信息获取初始密钥。S10. Acquire an initial key according to the device information of the processor 10.

S20、根据所述初始密钥对待读取密文进行解密处理,得到待读取明文,其中,所述待读取密文存储在所述内存模块30中。S20. Decrypt the ciphertext to be read according to the initial key to obtain the plaintext to be read, wherein the ciphertext to be read is stored in the memory module 30.

S30、返回所述待读取明文至所述处理器10。S30 , returning the plaintext to be read to the processor 10 .

以下具体描述从上电到处理器得到待读取明文的整个过程:The following describes the entire process from power-on to the processor getting the plaintext to be read:

(1)在安全防护系统上电后,安全防护模块20中的密钥生成模块210首先获取处理器10的设备信息,然后根据设备信息进行密钥生成操作。(1) After the security protection system is powered on, the key generation module 210 in the security protection module 20 first acquires the device information of the processor 10, and then performs a key generation operation according to the device information.

(2)在密钥生成模块210进行密钥生成操作的同时,数据转换模块将内存模块30中的待读取密文保存在内部缓存模块250中。当密钥生成操作完成,加解密模块220得到初始密钥时,数据转换模块将内部缓存模块250中的待读取密文发送到加解密模块220中。(2) While the key generation module 210 performs the key generation operation, the data conversion module saves the ciphertext to be read in the memory module 30 in the internal cache module 250 . When the key generation operation is completed and the encryption/decryption module 220 obtains the initial key, the data conversion module sends the ciphertext to be read in the internal cache module 250 to the encryption/decryption module 220 .

在一些实施例中,加解密模块220得到初始密钥后,还可以对初始密钥进行迭代计算处理,得到迭代密钥并保存。在得到迭代密钥的同时,数据转换模块将内部缓存模块250中的待读取密文发送到加解密模块220中。In some embodiments, after the encryption/decryption module 220 obtains the initial key, iterative calculation processing may be performed on the initial key to obtain and save the iterative key. When obtaining the iteration key, the data conversion module sends the ciphertext to be read in the internal cache module 250 to the encryption and decryption module 220 .

(3)加解密模块220根据初始密钥对待读取密文进行解密,得到待读取明文,待读取明文经过命令控制模块240和接口模块260的处理后,存储在外部缓存模块230中。所述处理包括将待读取明文转换为对外部缓存模块230的写入请求和将写入请求转换为对外部缓存模块230的缓存时序命令。(3) The encryption and decryption module 220 decrypts the ciphertext to be read according to the initial key, and obtains the plaintext to be read. After the plaintext to be read is processed by the command control module 240 and the interface module 260, it is stored in the external cache module 230. The processing includes converting the plaintext to be read into a write request to the external cache module 230 and converting the write request into a cache timing command to the external cache module 230 .

在一些实施例中,加解密模块220还会对初始密钥进行迭代处理,得到迭代密钥,因此加解密模块220可以根据迭代密钥对待读取密文进行解密,得到待读取明文。In some embodiments, the encryption/decryption module 220 may also perform iterative processing on the initial key to obtain the iterative key, so the encryption/decryption module 220 may decrypt the ciphertext to be read according to the iteration key to obtain the plaintext to be read.

经过步骤A、B、C,上电初始化过程完成,处理器10可以发出读取命令或写入命令。After steps A, B, and C, the power-on initialization process is completed, and the processor 10 can issue a read command or a write command.

(4)处理器10发出读取命令,接口模块260对读取命令进行处理,生成读取操作请求,其中,读取命令携带有时序信息,读取操作请求用于请求读取所述外部缓存模块中的待读取明文。(4) The processor 10 issues a read command, and the interface module 260 processes the read command to generate a read operation request, wherein the read command carries timing information, and the read operation request is used to request to read the external cache The plaintext to be read in the module.

(5)命令控制模块240根据操作读取指令,返回存储在外部缓存模块230中的待读取明文至处理器10。(5) The command control module 240 returns the plaintext to be read stored in the external cache module 230 to the processor 10 according to the operation read instruction.

参照图5,图5是本申请实施例提供的安全防护方法的一种流程示意图。Referring to FIG. 5 , FIG. 5 is a schematic flowchart of a security protection method provided by an embodiment of the present application.

在一些实际场景中,本申请实施例提供的安全防护系统还可以用于加密处理器10写入内存的数据,此时安全防护方法包括步骤S40-S50:In some practical scenarios, the security protection system provided by the embodiments of the present application may also be used to encrypt data written into the memory by the processor 10. In this case, the security protection method includes steps S40-S50:

S40、获取所述处理器10输入的待写入明文,并根据所述初始密钥对所述待写入明文进行加密处理,得到待写入密文。S40: Acquire the plaintext to be written inputted by the processor 10, and encrypt the plaintext to be written according to the initial key to obtain the ciphertext to be written.

S50、将所述待写入密文烧存储所述内存模块30中。S50 , burning the to-be-written ciphertext into the memory module 30 .

以下具体描述整个写入过程:The following describes the entire writing process in detail:

(1)处理器10发出携带待写入明文和处理器10时序信息的写入命令,接口模块260根据处理器10时序信息将写入命令转化为对外部缓存模块的写入请求,并将写入请求中的信息存储在内部缓存模块250中。具体地,写入请求中的信息包括待写入明文。(1) The processor 10 issues a write command carrying the plaintext to be written and the timing information of the processor 10. The interface module 260 converts the write command into a write request to the external cache module according to the timing information of the processor 10, and writes the write command to the external cache module. The information in the incoming request is stored in the internal cache module 250 . Specifically, the information in the write request includes plaintext to be written.

(2)若内部缓存模块250中存储的信息满足预设要求,则将内部缓存模块250中的信息存储至外部缓存模块230中。例如内部缓存模块250是Fifo,外部缓存模块230是Sram,加解密模块220中的加密算法为SM4算法。当Fifo中存入了8个连续地址的信息时,将Fifo中的信息存储至Sram中。(2) If the information stored in the internal cache module 250 meets the preset requirements, the information in the internal cache module 250 is stored in the external cache module 230 . For example, the internal cache module 250 is Fifo, the external cache module 230 is SRAM, and the encryption algorithm in the encryption and decryption module 220 is the SM4 algorithm. When the information of 8 consecutive addresses is stored in the Fifo, the information in the Fifo is stored in the Sram.

(3)数据转换模块将外部缓存模块230中的信息转换为符合加解密算法位宽要求的数据后,在加解密模块220中根据初始密钥对转换后得到的数据进行加密,得到待写入密文。(3) After the data conversion module converts the information in the external cache module 230 into data that meets the bit width requirements of the encryption and decryption algorithm, the data obtained after conversion is encrypted in the encryption and decryption module 220 according to the initial key to obtain the data to be written ciphertext.

在一些实施例中,还可以对初始密钥进行迭代计算处理,得到迭代密钥。然后根据迭代密钥对转换后的数据进行加密,得到待写入密文。In some embodiments, an iterative calculation process may also be performed on the initial key to obtain an iterative key. Then, the converted data is encrypted according to the iterative key to obtain the ciphertext to be written.

(4)数据转换模块对待写入密文进行处理,得到数据位宽符合内存模块30存储位宽要求的待写入密文,接口模块260和命令控制模块240对处理后的待写入密文进行格式转换后,将其存储在内存模块30中。(4) The data conversion module processes the to-be-written ciphertext to obtain the to-be-written ciphertext whose data bit width meets the storage bit width requirement of the memory module 30. The interface module 260 and the command control module 240 process the processed to-be-written ciphertext After format conversion, it is stored in the memory module 30 .

需要说明的是,本申请中S10-S30以及S40-S50的具体工作过程可以参考上文任意实施例的说明,具体在此不再赘述。It should be noted that, for the specific working processes of S10-S30 and S40-S50 in this application, reference may be made to the description of any of the above embodiments, and details are not repeated here.

本申请实施例中对于安全防护方法实施例的描述和安全防护系统实施例的描述各有侧重点,安全防护方法和安全防护系统中各部分的内容可以互相参照。比如,对于安全防护方法实施例所涉及到的安全防护系统中各功能模块的具体实现、具体工作过程没有详细表述的地方,可以参见上文针对安全防护系统实施例的详细描述。The description of the embodiment of the security protection method and the description of the embodiment of the security protection system in the embodiments of the present application have their own emphasis, and the contents of each part in the security protection method and the security protection system can be referred to each other. For example, for the specific implementation and specific working process of each functional module in the security protection system involved in the security protection method embodiment, reference may be made to the above detailed description of the security protection system embodiment.

此外,为了更好实施本申请实施例中安全防护方法,在安全防护方法基础之上,本申请实施例还提供一种电子设备,参阅图6,图6示出了本申请实施例电子设备的一种结构示意图,具体的,本申请实施例提供的电子设备包括安全防护系统601,安全防护系统601用于实现如图4至图5对应任意实施例中安全防护方法的各步骤。In addition, in order to better implement the security protection method in the embodiment of the present application, on the basis of the security protection method, the embodiment of the present application further provides an electronic device. Referring to FIG. 6 , FIG. 6 shows the electronic device of the embodiment of the present application. A schematic diagram of the structure. Specifically, the electronic device provided by the embodiment of the present application includes a security protection system 601, and the security protection system 601 is used to implement each step of the security protection method in any of the embodiments corresponding to FIG. 4 to FIG. 5 .

示例性的,计算机程序可以被分割成一个或多个模块/单元,一个或者多个模块/单元由安全防护系统601执行,以完成本申请实施例。一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序处理器指令段,该处理器指令段用于描述计算机程序在计算机装置中的执行过程。Exemplarily, the computer program may be divided into one or more modules/units, and one or more modules/units are executed by the security protection system 601 to complete the embodiments of the present application. One or more modules/units may be a series of computer program processor instruction segments capable of performing a specified function, and the processor instruction segments are used to describe the execution of the computer program in a computer apparatus.

电子设备可包括,但不仅限于安全防护系统601。本领域技术人员可以理解,示意仅仅是电子设备的示例,并不构成对电子设备的限定,可以包括比图示更多的部件,或者组合某些部件,或者不同的部件,例如电子设备还可以包括输入输出设备、网络接入设备、总线等,安全防护系统601、输入输出设备以及网络接入设备等通过总线相连。The electronic device may include, but is not limited to, the security guard system 601 . Those skilled in the art can understand that the illustration is only an example of an electronic device, and does not constitute a limitation on the electronic device. It may include more components than the illustration, or combine some components, or different components. For example, the electronic device may also Including input and output devices, network access devices, buses, etc., the security protection system 601, input and output devices, and network access devices are connected through the bus.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的电子设备及其相应单元的具体工作过程,可以参考如图4至图5对应任意实施例中安全防护方法的说明,具体在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the electronic equipment and its corresponding units described above may refer to the description of the security protection method in any embodiment corresponding to FIG. 4 to FIG. 5 . , and details are not repeated here.

本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过处理器指令来完成,或通过处理器指令控制相关的硬件来完成,该处理器指令可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by processor instructions, or by controlling relevant hardware by processor instructions, and the processor instructions can be stored in a computer. readable storage medium, and loaded and executed by a processor.

为此,本申请实施例提供一种计算机可读存储介质,其中存储有多条指令,该指令能够被安全防护系统进行加载,以执行本申请如图4至图5对应任意实施例中安全防护方法中的步骤,具体操作可参考如图4至图5对应任意实施例中安全防护方法的说明,在此不再赘述。To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a security protection system to execute the security protection in any of the embodiments corresponding to FIG. 4 to FIG. 5 of the present application. For the steps and specific operations in the method, reference may be made to the description of the security protection method in any of the embodiments corresponding to FIG. 4 to FIG. 5 , and details are not repeated here.

由于该计算机可读存储介质中所存储的指令,可以执行本申请如图4至图5对应任意实施例中安全防护方法中的步骤,因此,可以实现本申请如图4至图5对应任意实施例中安全防护方法所能实现的有益效果,详见前面的说明,在此不再赘述。Since the instructions stored in the computer-readable storage medium can execute the steps in the security protection method in any of the embodiments corresponding to FIG. 4 to FIG. 5 of the present application, any implementation corresponding to FIG. 4 to FIG. 5 of the present application can be implemented. For the beneficial effects that can be achieved by the security protection method in the example, see the foregoing description for details, and will not be repeated here.

以上对本申请实施例所提供的一种安全防护系统、方法、电子设备及存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。A security protection system, method, electronic device, and storage medium provided by the embodiments of the present application have been described in detail above. The principles and implementations of the present application are described with specific examples. The descriptions of the above embodiments are only It is used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there will be changes in the specific embodiments and application scope. In summary, this specification The content should not be construed as a limitation on this application.

Claims (10)

1. A safety protection system is characterized by comprising a processor, a safety protection module and a memory module, wherein the processor is in communication connection with the safety protection module;
the processor is used for sending a reading command to the safety protection module;
the memory module is used for storing a ciphertext to be read;
the security protection module is used for generating and decrypting the ciphertext to be read according to an initial key to obtain a plaintext to be read, wherein the initial key is generated according to the equipment information of the processor;
the processor is further configured to obtain the plaintext to be read from the security protection module.
2. The security protection system according to claim 1, wherein the security protection module comprises a key generation module, an encryption/decryption module, an external cache module and a command control module, the key generation module, the encryption/decryption module, the command control module and the external cache are sequentially connected in a communication manner, and the command control module is respectively connected in a communication manner with the memory module and the processor;
the key generation module is used for acquiring the equipment information and generating the initial key when the equipment is powered on;
the encryption and decryption module is used for acquiring the ciphertext to be read and decrypting the ciphertext to be read according to the initial key to obtain the plaintext to be read;
the external cache module is used for storing the plaintext to be read;
and the command control module is used for acquiring the reading command, reading and returning the plaintext to be read in the external cache module to the processor according to the reading command.
3. The security protection system of claim 2, wherein the security protection module further comprises an internal cache module, and the internal cache module is in communication connection with the memory module and the encryption and decryption module respectively;
the internal cache module is used for acquiring and storing the ciphertext to be read from the memory module, and inputting the ciphertext to be read into the encryption and decryption module when the encryption and decryption module receives the initial key.
4. The safety protection system according to claim 2, wherein the safety protection module further comprises an interface module, the interface module is respectively in communication connection with the processor, the memory module and the command control module, the read command carries processor timing information, and the read command is input to the interface module by the processor;
the interface module is used for generating a reading operation request according to the processor time sequence information, wherein the reading operation request is used for requesting to read a plaintext to be read in the external cache module.
5. The security protection system of claim 2, wherein the encryption and decryption module is further configured to:
performing iterative computation on the initial key to obtain and store an iterative key;
and decrypting the ciphertext to be read according to the iteration key to obtain the plaintext to be read.
6. The security system of claim 2, wherein the processor is further configured to send a write command to the security module, the write command carrying a plaintext to be written;
the command control module is further used for acquiring the write command;
the external cache module is also used for storing a plaintext to be written carried by the command to be written;
the encryption and decryption module is further used for encrypting the plaintext to be written according to the initial key to obtain a ciphertext to be written;
the memory module is also used for storing the ciphertext to be written.
7. A security protection method is applied to a security protection system, wherein the security protection system comprises a memory module and a processor, and the method comprises the following steps:
acquiring an initial key according to the equipment information of the processor;
decrypting the ciphertext to be read according to the initial key to obtain the plaintext to be read, wherein the ciphertext to be read is stored in the memory module;
and sending the plaintext to be read to the processor.
8. The method of safeguarding according to claim 7, further comprising:
acquiring a plaintext to be written input by the processor, and encrypting the plaintext to be written according to the initial key to obtain a ciphertext to be written;
and storing the cipher text to be written into the memory module.
9. An electronic device comprising a security system that performs the security method of any of claims 7 to 8 when it calls a computer program in the memory.
10. A computer-readable storage medium, having stored thereon a computer program which is loaded by a processor for performing the steps of the security method of any of claims 7 to 8.
CN202110241277.3A 2021-03-04 2021-03-04 Security protection system, method, electronic device and storage medium Pending CN115017520A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110241277.3A CN115017520A (en) 2021-03-04 2021-03-04 Security protection system, method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110241277.3A CN115017520A (en) 2021-03-04 2021-03-04 Security protection system, method, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN115017520A true CN115017520A (en) 2022-09-06

Family

ID=83064222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110241277.3A Pending CN115017520A (en) 2021-03-04 2021-03-04 Security protection system, method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115017520A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103280238A (en) * 2013-06-27 2013-09-04 山东量子科学技术研究院有限公司 EMMC controller based on FPGA, and working method of eMMC controller
CN103559453A (en) * 2013-05-23 2014-02-05 深圳市中易通网络技术有限公司 Hardware encryption protection method and system for cellphone data
CN109716314A (en) * 2016-09-23 2019-05-03 Arm有限公司 For controlling device, Memory Controller, memory module and the method for data transmission
CN110874476A (en) * 2018-08-31 2020-03-10 阿里巴巴集团控股有限公司 Data processing system, method, storage medium and processor

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559453A (en) * 2013-05-23 2014-02-05 深圳市中易通网络技术有限公司 Hardware encryption protection method and system for cellphone data
CN103559453B (en) * 2013-05-23 2017-10-10 深圳市中易通安全芯科技有限公司 A kind of data in mobile phone hardware encryption protecting method and system
CN103280238A (en) * 2013-06-27 2013-09-04 山东量子科学技术研究院有限公司 EMMC controller based on FPGA, and working method of eMMC controller
CN109716314A (en) * 2016-09-23 2019-05-03 Arm有限公司 For controlling device, Memory Controller, memory module and the method for data transmission
CN110874476A (en) * 2018-08-31 2020-03-10 阿里巴巴集团控股有限公司 Data processing system, method, storage medium and processor

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
泰森·麦考利: "物联网风险管理与控制", vol. 2020, 31 May 2020, 机械工业出版社, pages: 287 *
许向阳: "x86汇编语言程序设计", vol. 2020, 31 July 2020, 华中科技大学出版社, pages: 18 *

Similar Documents

Publication Publication Date Title
KR102013841B1 (en) Method of managing key for secure storage of data, and and apparatus there-of
CN107612683B (en) An encryption and decryption method, apparatus, system, device and storage medium
US20190384938A1 (en) Storage apparatus and method for address scrambling
US9053346B2 (en) Low-overhead cryptographic method and apparatus for providing memory confidentiality, integrity and replay protection
US9405919B2 (en) Dynamic encryption keys for use with XTS encryption systems employing reduced-round ciphers
US20100246828A1 (en) Method and system of parallelized data decryption and key generation
JP7443433B2 (en) Secure communication from inside non-volatile memory devices
US11816228B2 (en) Metadata tweak for channel encryption differentiation
WO2008031109A2 (en) System and method for encrypting data
US11775652B2 (en) Platform security mechanism
CN113890728A (en) Key processing method, system, equipment and medium based on FPGA encryption card
US8751819B1 (en) Systems and methods for encoding data
WO2020118583A1 (en) Data processing method, circuit, terminal device storage medium
CN116594567A (en) Information management method, device and electronic device
CN116635853A (en) Memory systems and devices including instances that access memory and use authenticated stream ciphers to generate access codes
CN113536331B (en) Data security for memory and computing systems
CN115017520A (en) Security protection system, method, electronic device and storage medium
CN110837627A (en) Software copyright authentication method, system and equipment based on hard disk serial number
US20250225236A1 (en) Methods to improve security of multi-tenant memory modules
CN115134076A (en) Data processing method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载