[go: up one dir, main page]

CN118821243A - Data processing method, electronic device, storage medium and computer program product - Google Patents

Data processing method, electronic device, storage medium and computer program product Download PDF

Info

Publication number
CN118821243A
CN118821243A CN202411273363.2A CN202411273363A CN118821243A CN 118821243 A CN118821243 A CN 118821243A CN 202411273363 A CN202411273363 A CN 202411273363A CN 118821243 A CN118821243 A CN 118821243A
Authority
CN
China
Prior art keywords
data
key
ciphertext
user
encryption
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.)
Granted
Application number
CN202411273363.2A
Other languages
Chinese (zh)
Other versions
CN118821243B (en
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.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center 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 Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202411273363.2A priority Critical patent/CN118821243B/en
Publication of CN118821243A publication Critical patent/CN118821243A/en
Application granted granted Critical
Publication of CN118821243B publication Critical patent/CN118821243B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • G06F21/72Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information in cryptographic circuits
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
    • G06F21/80Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data in storage media based on magnetic or optical technology, e.g. disks with sectors

Landscapes

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

Abstract

本申请公开了一种数据处理方法、电子设备、存储介质及计算机程序产品,属于数据处理技术领域。数据处理方法应用于加密存储设备;包括:在加密存储设备上电时,生成第一密钥分量;获取加密存储设备存储的第二密钥分量;根据第一密钥分量和第二密钥分量运算生成主密钥,向加密存储设备的内存写入主密钥;采用主密钥对加密存储设备的敏感数据进行加密处理,得到敏感数据密文,向加密存储设备的硬件存储单元写入敏感数据密文;响应于敏感数据读取操作,采用主密钥对敏感数据密文进行解密处理,得到敏感数据,向内存写入敏感数据。本申请有效提升加密存储设备的敏感数据的存储安全性。

The present application discloses a data processing method, an electronic device, a storage medium and a computer program product, and belongs to the field of data processing technology. The data processing method is applied to an encrypted storage device; it includes: when the encrypted storage device is powered on, a first key component is generated; a second key component stored in the encrypted storage device is obtained; a master key is generated according to the first key component and the second key component, and the master key is written to the memory of the encrypted storage device; the sensitive data of the encrypted storage device is encrypted with the master key to obtain the sensitive data ciphertext, and the sensitive data ciphertext is written to the hardware storage unit of the encrypted storage device; in response to the sensitive data reading operation, the sensitive data ciphertext is decrypted with the master key to obtain the sensitive data, and the sensitive data is written to the memory. The present application effectively improves the storage security of sensitive data of the encrypted storage device.

Description

数据处理方法、电子设备、存储介质及计算机程序产品Data processing method, electronic device, storage medium and computer program product

技术领域Technical Field

本申请属于数据处理技术领域,具体涉及一种数据处理方法、电子设备、存储介质及计算机程序产品。The present application belongs to the field of data processing technology, and specifically relates to a data processing method, electronic equipment, storage medium and computer program product.

背景技术Background Art

随着数据安全需求的日益增长,人们对数据保护的关注度逐步提升,加密存储设备逐渐成为企业和个人保护数据安全的重要工具。其中,加密存储设备主要是通过对其存储数据进行加密存储,以实现数据保护。例如,加密存储设备包括加密固态硬盘(SolidState Disk,SSD)设备、加密芯片设备等具有加密功能的非易失性存储器设备。而敏感数据是加密存储设备的重要数据,其主要包括存储数据的加密密钥、设备访问用户的身份验证数据等。敏感数据对维护加密存储设备的安全性和功能性至关重要。As the demand for data security grows, people are paying more and more attention to data protection, and encrypted storage devices have gradually become an important tool for enterprises and individuals to protect data security. Among them, encrypted storage devices mainly implement data protection by encrypting the stored data. For example, encrypted storage devices include encrypted solid-state disk (SSD) devices, encrypted chip devices and other non-volatile memory devices with encryption functions. Sensitive data is important data of encrypted storage devices, which mainly includes encryption keys for stored data, authentication data of device access users, etc. Sensitive data is crucial to maintaining the security and functionality of encrypted storage devices.

目前,通常将敏感数据存储至加密存储设备的非易失性存储器上,以防止加密存储设备因异常断电等原因导致敏感数据丢失、损坏等。然而,加密存储设备的硬件单元可能存在暴力拆解,而导致硬件单元的存储内容泄露的问题。因而,存储于硬件单元的敏感数据具有泄露风险。显然,如何保障敏感数据的存储安全性,成为亟须解决的问题。At present, sensitive data is usually stored in the non-volatile memory of the encrypted storage device to prevent the loss or damage of sensitive data due to abnormal power failure of the encrypted storage device. However, the hardware unit of the encrypted storage device may be violently disassembled, resulting in the leakage of the storage content of the hardware unit. Therefore, the sensitive data stored in the hardware unit has the risk of leakage. Obviously, how to ensure the storage security of sensitive data has become an urgent problem to be solved.

发明内容Summary of the invention

本申请实施例的目的是提供一种数据处理方法、电子设备、存储介质及计算机程序产品,能够解决目前加密存储设备的敏感数据存在泄露风险的问题。The purpose of the embodiments of the present application is to provide a data processing method, an electronic device, a storage medium and a computer program product, which can solve the problem that sensitive data of current encrypted storage devices have the risk of leakage.

为了解决上述技术问题,本申请是这样实现的:In order to solve the above technical problems, this application is implemented as follows:

第一方面,本申请实施例提供了一种数据处理方法,应用于加密存储设备;所述方法包括:In a first aspect, an embodiment of the present application provides a data processing method, which is applied to an encrypted storage device; the method comprises:

在所述加密存储设备上电时,生成第一密钥分量;When the encryption storage device is powered on, generating a first key component;

获取所述加密存储设备存储的第二密钥分量;Obtaining a second key component stored in the encryption storage device;

根据所述第一密钥分量和所述第二密钥分量运算生成主密钥,向所述加密存储设备的内存写入所述主密钥;Generate a master key according to the first key component and the second key component, and write the master key into the memory of the encryption storage device;

采用所述主密钥对所述加密存储设备的敏感数据进行加密处理,得到敏感数据密文,向所述加密存储设备的硬件存储单元写入所述敏感数据密文;Using the master key to encrypt the sensitive data of the encryption storage device to obtain a ciphertext of the sensitive data, and writing the ciphertext of the sensitive data into a hardware storage unit of the encryption storage device;

响应于敏感数据读取操作,采用所述主密钥对所述敏感数据密文进行解密处理,得到所述敏感数据,向所述内存写入所述敏感数据。In response to a sensitive data read operation, the master key is used to decrypt the sensitive data ciphertext to obtain the sensitive data, and the sensitive data is written into the memory.

第二方面,本申请实施例提供了一种电子设备,所述电子设备包括:处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的数据处理方法。In a second aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the data processing method described in the first aspect.

第三方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现第一方面所述的数据处理方法。In a third aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the data processing method described in the first aspect is implemented.

第四方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的数据处理方法。In a fourth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the data processing method as described in the first aspect.

第五方面,本申请实施例提供了一种计算机程序产品,包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现如第一方面所述的数据处理方法。In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program/instructions, which, when executed by a processor, implements the data processing method as described in the first aspect.

本申请实施例中,加密存储设备可以在上电时生成第一密钥分量,并根据第一密钥分量和存储的第二密钥分量生成主密钥,进而采用主密钥对加密存储设备的敏感数据进行加密处理,得到敏感数据密文,向加密存储设备的硬件存储单元写入敏感数据密文。该技术方案中,主密钥存储于加密存储设备的内存。响应于敏感数据读取操作,可以采用内存中的主密钥对敏感数据密文进行解密处理,以得到敏感数据。由于用于生成主密钥的第一密钥分量是加密存储设备在每次上电时随机生成的,且因内存的断电自动销毁特性,内存中的主密钥也会在加密存储设备出现断电时被自动销毁。因此,主密钥具有较高的安全性,泄露风险较低,进而利用主密钥加密敏感数据,可以有效提升敏感数据的存储安全性。In an embodiment of the present application, the encryption storage device can generate a first key component when powered on, and generate a master key based on the first key component and the stored second key component, and then use the master key to encrypt the sensitive data of the encryption storage device to obtain the sensitive data ciphertext, and write the sensitive data ciphertext to the hardware storage unit of the encryption storage device. In this technical solution, the master key is stored in the memory of the encryption storage device. In response to the sensitive data read operation, the master key in the memory can be used to decrypt the sensitive data ciphertext to obtain the sensitive data. Since the first key component used to generate the master key is randomly generated by the encryption storage device each time it is powered on, and due to the power-off automatic destruction feature of the memory, the master key in the memory will also be automatically destroyed when the encryption storage device is powered off. Therefore, the master key has a higher security and a lower risk of leakage, and then using the master key to encrypt sensitive data can effectively improve the storage security of sensitive data.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是本申请实施例提供的一种数据处理方法的流程图;FIG1 is a flow chart of a data processing method provided in an embodiment of the present application;

图2是本申请实施例提供的一种密钥生成方法的原理图;FIG2 is a schematic diagram of a key generation method provided in an embodiment of the present application;

图3是本申请实施例提供的另一种数据处理方法的流程图;FIG3 is a flow chart of another data processing method provided in an embodiment of the present application;

图4是本申请实施例提供的又一种数据处理方法的流程图;FIG4 is a flow chart of another data processing method provided in an embodiment of the present application;

图5是本申请实施例提供的一种敏感数据的加密原理图;FIG5 is a schematic diagram of a sensitive data encryption principle provided in an embodiment of the present application;

图6是本申请实施例提供的再一种数据处理方法的流程图;FIG6 is a flow chart of another data processing method provided in an embodiment of the present application;

图7是本申请实施例提供的一种数据处理方法的原理图;FIG7 is a schematic diagram of a data processing method provided in an embodiment of the present application;

图8是本申请实施例提供的一种数据处理装置的框图;FIG8 is a block diagram of a data processing device provided in an embodiment of the present application;

图9是本申请提供的一种电子设备的框图。FIG. 9 is a block diagram of an electronic device provided by the present application.

具体实施方式DETAILED DESCRIPTION

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

随着数据安全需求的日益增长,人们对数据保护的关注度逐步提升,加密存储设备逐渐成为企业和个人保护数据安全的重要工具。其中,加密存储设备主要是通过对其存储数据进行加密存储,以实现数据保护。例如,加密存储设备包括加密固态硬盘(SolidState Disk,SSD)设备、加密芯片设备、U盘设备、密码卡设备等具有加密功能的非易失性存储器设备。As the demand for data security grows, people are paying more and more attention to data protection, and encrypted storage devices are becoming an important tool for enterprises and individuals to protect data security. Among them, encrypted storage devices mainly implement data protection by encrypting the stored data. For example, encrypted storage devices include encrypted solid-state disk (SSD) devices, encrypted chip devices, USB flash disk devices, password card devices and other non-volatile memory devices with encryption functions.

而敏感数据,又称安全参数,其是加密存储设备的重要数据,其主要包括存储数据的加密密钥、设备访问用户的身份验证数据等。敏感数据对维护加密存储设备的安全性和功能性至关重要。示例地,可信计算组织(Trusted Computing Group,TCG)协议定义了一套安全标准规范,包括基于对称加密算法(Advanced Encryption Standard,AES)的设备自加密、用户权限管理、开机前身份验证等,这些措施可以有效保护企业敏感数据不被泄露,并建立完善的安全认证体系。对于加密SSD设备,其敏感数据包括:TCG的安全提供者(Security Provider,SP)表。SP表包含有关加密密钥、访问控制策略、身份验证机制、数据恢复等的信息,其是加密SSD设备的加密框架中的关键组成部分,其保存和管理对维护加密SSD设备的安全性和功能性至关重要。Sensitive data, also known as security parameters, is important data for encrypted storage devices, which mainly include encryption keys for stored data, authentication data of device access users, etc. Sensitive data is crucial to maintaining the security and functionality of encrypted storage devices. For example, the Trusted Computing Group (TCG) protocol defines a set of security standards and specifications, including device self-encryption based on the Advanced Encryption Standard (AES), user rights management, and pre-boot authentication. These measures can effectively protect sensitive enterprise data from being leaked and establish a complete security authentication system. For encrypted SSD devices, their sensitive data include: TCG's Security Provider (SP) table. The SP table contains information about encryption keys, access control policies, authentication mechanisms, data recovery, etc. It is a key component in the encryption framework of encrypted SSD devices, and its preservation and management are crucial to maintaining the security and functionality of encrypted SSD devices.

目前,通常将敏感数据存储至加密存储设备的非易失性存储器上,以防止加密存储设备因异常断电等原因导致敏感数据丢失、损坏等。然而,加密存储设备的硬件单元可能存在暴力拆解,而导致硬件单元的存储内容泄露的问题。因而,存储于硬件单元的敏感数据具有泄露风险。显然,如何保障敏感数据的存储安全性,成为亟须解决的问题。At present, sensitive data is usually stored in the non-volatile memory of the encrypted storage device to prevent the loss or damage of sensitive data due to abnormal power failure of the encrypted storage device. However, the hardware unit of the encrypted storage device may be violently disassembled, resulting in the leakage of the storage content of the hardware unit. Therefore, the sensitive data stored in the hardware unit has the risk of leakage. Obviously, how to ensure the storage security of sensitive data has become an urgent problem to be solved.

为了便于更好地理解本申请技术方案,下述先对本申请实施例提供的加密存储设备进行说明。本申请实施例提供的加密存储设备包括:处理器、内存和至少一个硬件存储单元。硬件存储单元为非易失性存储器。例如,SSD、U盘、密码卡或密码芯片等。其中,处理器与内存和硬件存储单元连接。处理器可以用于读取硬件存储单元中存储的存储数据密文,并对存储数据密文进行解密处理,得到存储数据。处理器也可以用于对待写入的存储数据进行加密处理,得到待写入的存储数据密文,并将该存储数据密文写入硬件存储单元等。并且,处理器还可以用于对加密存储设备的敏感数据进行加解密处理。In order to facilitate a better understanding of the technical solution of the present application, the following first describes the encrypted storage device provided in the embodiment of the present application. The encrypted storage device provided in the embodiment of the present application includes: a processor, a memory, and at least one hardware storage unit. The hardware storage unit is a non-volatile memory. For example, an SSD, a USB flash drive, a password card or a password chip, etc. Among them, the processor is connected to the memory and the hardware storage unit. The processor can be used to read the storage data ciphertext stored in the hardware storage unit, and decrypt the storage data ciphertext to obtain the storage data. The processor can also be used to encrypt the storage data to be written, obtain the storage data ciphertext to be written, and write the storage data ciphertext to the hardware storage unit, etc. In addition, the processor can also be used to encrypt and decrypt sensitive data of the encrypted storage device.

可选地,加密存储设备可以包括数据加解密模块。数据加解密模块可以包括多个运算单元。每个运算单元用于执行不同的加解密算法。在一些实施例中,数据加解密模块包括第一运算单元和第二运算单元。第一运算单元用于执行分组加密算法。第二运算单元用于执行哈希算法。这样,处理器可以同时调用不同的运算单元,以同时对不同的数据进行加解密,以实现多个数据加解密的并行运算,提升加解密的运算效率。Optionally, the encrypted storage device may include a data encryption and decryption module. The data encryption and decryption module may include multiple operation units. Each operation unit is used to execute different encryption and decryption algorithms. In some embodiments, the data encryption and decryption module includes a first operation unit and a second operation unit. The first operation unit is used to execute a block encryption algorithm. The second operation unit is used to execute a hash algorithm. In this way, the processor can call different operation units at the same time to encrypt and decrypt different data at the same time, so as to realize parallel operation of multiple data encryption and decryption, and improve the operation efficiency of encryption and decryption.

请参考图1,其示出了本申请实施例提供的一种数据处理方法的流程图。数据处理方法可以应用于本申请实施例提供的加密存储设备。可选地,数据处理方法可以由加密存储设备中的处理器执行,下述以处理器执行为例说明。如图1所示,数据处理方法包括:Please refer to FIG. 1, which shows a flow chart of a data processing method provided in an embodiment of the present application. The data processing method can be applied to the encryption storage device provided in an embodiment of the present application. Optionally, the data processing method can be executed by a processor in the encryption storage device, and the following description takes the execution of the processor as an example. As shown in FIG. 1, the data processing method includes:

步骤101、在加密存储设备上电时,生成第一密钥分量。Step 101: When the encryption storage device is powered on, a first key component is generated.

本申请实施例中,在加密存储设备上电时,处理器可以随机生成第一密钥分量。可选地,处理器可以在加密存储设备上电时,调用真随机数生成器(True Random NumberGenerator,TRNG)随机生成一个随机数,得到第一密钥分量。In an embodiment of the present application, when the encrypted storage device is powered on, the processor may randomly generate a first key component. Optionally, when the encrypted storage device is powered on, the processor may call a true random number generator (TRNG) to randomly generate a random number to obtain the first key component.

步骤102、获取加密存储设备存储的第二密钥分量。Step 102: Obtain a second key component stored in an encryption storage device.

本申请实施例中,加密存储设备的硬件存储单元中存储有第二密钥分量。可选地,第二密钥分量可以是加密存储设备出厂时写入的固定数据。In the embodiment of the present application, the hardware storage unit of the encryption storage device stores the second key component. Optionally, the second key component may be fixed data written into the encryption storage device when it leaves the factory.

步骤103、根据第一密钥分量和第二密钥分量运算生成主密钥,向加密存储设备的内存写入主密钥。Step 103: Generate a master key based on the first key component and the second key component, and write the master key into the memory of the encryption storage device.

可选地,处理器可以采用目标密钥生成算法,根据第一密钥分量和第二密钥分量生成主密钥,以向加密存储设备的内存写入主密钥。写入的内存中的主密钥具有不可导出,断电自动销毁等特性。其中,目标密钥生成算法可以为HKDF算法、异或算法等。示例地,处理器可以对第一密钥分量和第二密钥分量进行异或运算处理,生成主密钥。Optionally, the processor may use a target key generation algorithm to generate a master key according to the first key component and the second key component, so as to write the master key to the memory of the encrypted storage device. The master key written into the memory has the characteristics of being non-exportable and automatically destroyed when the power is turned off. Among them, the target key generation algorithm may be an HKDF algorithm, an XOR algorithm, etc. For example, the processor may perform an XOR operation on the first key component and the second key component to generate the master key.

示例地,如图2所示,第一密钥分量是在加密存储设备上电时,调用TRNG随机生成的随机数。第二密钥分量是加密存储设备出厂内置的数据。主密钥是对第一密钥分量和第二密钥分量进行异或运算处理生成的数据。For example, as shown in FIG2 , the first key component is a random number randomly generated by calling TRNG when the encrypted storage device is powered on. The second key component is data built into the encrypted storage device at the factory. The master key is data generated by performing an XOR operation on the first key component and the second key component.

步骤104、采用主密钥对加密存储设备的敏感数据进行加密处理,得到敏感数据密文,向加密存储设备的硬件存储单元写入敏感数据密文。Step 104: Use the master key to encrypt the sensitive data of the encryption storage device to obtain the sensitive data ciphertext, and write the sensitive data ciphertext into the hardware storage unit of the encryption storage device.

可选地,处理器可以利用分组加密算法,采用主密钥对加密存储设备的敏感数据进行加密处理,得到敏感数据密文。示例地,分组加密算法可以为SM1、SM4或高级加密标准‌(Advanced Encryption Standard,AES)算法等。Optionally, the processor may use a block encryption algorithm and a master key to encrypt the sensitive data of the encryption storage device to obtain a ciphertext of the sensitive data. For example, the block encryption algorithm may be SM1, SM4, or an Advanced Encryption Standard (AES) algorithm.

步骤105、响应于敏感数据读取操作,采用主密钥对敏感数据密文进行解密处理,得到敏感数据,向内存写入敏感数据。Step 105: In response to the sensitive data read operation, the master key is used to decrypt the sensitive data ciphertext to obtain the sensitive data, and the sensitive data is written into the memory.

其中,敏感数据读取操作用于读取加密存储设备的硬件存储单元中的敏感数据密文。可选地,处理器可以在加密存储设备上电时,生成并响应于敏感数据读取操作,采用主密钥对敏感数据密文进行解密处理得到敏感数据,向内存写入敏感数据。或者,处理器可以在初次接收到用户的数据读写请求时,生成并响应于敏感数据读取操作,采用主密钥对敏感数据密文进行解密处理得到敏感数据,向内存写入敏感数据,以使处理器可以根据敏感数据,执行数据读写请求指示的数据读取处理。The sensitive data read operation is used to read the sensitive data ciphertext in the hardware storage unit of the encrypted storage device. Optionally, the processor can generate and respond to the sensitive data read operation when the encrypted storage device is powered on, use the master key to decrypt the sensitive data ciphertext to obtain sensitive data, and write the sensitive data to the memory. Alternatively, the processor can generate and respond to the sensitive data read operation when the user's data read and write request is received for the first time, use the master key to decrypt the sensitive data ciphertext to obtain sensitive data, and write the sensitive data to the memory, so that the processor can perform the data read processing indicated by the data read and write request according to the sensitive data.

本申请一些实施例中,加密存储设备可以包括第一硬件单元和第二硬件单元。其中,第二密钥分量存储于第一硬件单元。处理器可以在生成第一密钥分量之后,采用第二密钥分量对第一密钥分量进行加密处理,得到第一密钥分量密文,向第二硬件单元存储第一密钥分量密文,以对第一密钥分量和第二密钥分量进行分散式存储,避免二者同时泄露,降低主密钥的泄露风险,保障主密钥的生成、存储和使用安全性。示例地,第一硬件单元为NAND,第二硬件单元为NOR Flash。In some embodiments of the present application, the encryption storage device may include a first hardware unit and a second hardware unit. The second key component is stored in the first hardware unit. After generating the first key component, the processor may use the second key component to encrypt the first key component to obtain the first key component ciphertext, and store the first key component ciphertext in the second hardware unit to store the first key component and the second key component in a distributed manner, so as to avoid leakage of both at the same time, reduce the risk of leakage of the master key, and ensure the security of generation, storage and use of the master key. By way of example, the first hardware unit is NAND, and the second hardware unit is NOR Flash.

本申请实施例中,加密存储设备可以在上电时生成第一密钥分量,并根据第一密钥分量和存储的第二密钥分量生成主密钥,进而采用主密钥对加密存储设备的敏感数据进行加密处理,得到敏感数据密文,向加密存储设备的硬件存储单元写入敏感数据密文。该技术方案中,主密钥存储于加密存储设备的内存。响应于敏感数据读取操作,可以采用内存中的主密钥对敏感数据密文进行解密处理,以得到敏感数据。由于用于生成主密钥的第一密钥分量是加密存储设备在每次上电时随机生成的,且因内存的断电自动销毁特性,内存中的主密钥也会在加密存储设备出现断电时被自动销毁。因此,主密钥具有较高的安全性,泄露风险较低,进而利用主密钥加密敏感数据,可以有效提升敏感数据的存储安全性。In an embodiment of the present application, the encryption storage device can generate a first key component when powered on, and generate a master key based on the first key component and the stored second key component, and then use the master key to encrypt the sensitive data of the encryption storage device to obtain the sensitive data ciphertext, and write the sensitive data ciphertext to the hardware storage unit of the encryption storage device. In this technical solution, the master key is stored in the memory of the encryption storage device. In response to the sensitive data read operation, the master key in the memory can be used to decrypt the sensitive data ciphertext to obtain the sensitive data. Since the first key component used to generate the master key is randomly generated by the encryption storage device each time it is powered on, and due to the power-off automatic destruction feature of the memory, the master key in the memory will also be automatically destroyed when the encryption storage device is powered off. Therefore, the master key has a higher security and a lower risk of leakage, and then using the master key to encrypt sensitive data can effectively improve the storage security of sensitive data.

本申请一些实施例中,加密存储设备的敏感数据包括:数据加密密钥和密钥加密密钥。其中,数据加密密钥用于对加密存储设备的存储数据进行加密。密钥加密密钥是根据加密存储设备的录入用户的用户凭证数据生成的,其与录入用户对应。密钥加密密钥用于加密数据加密密钥。并且,密钥加密密钥用于被主密钥加密存储。In some embodiments of the present application, the sensitive data of the encrypted storage device includes: a data encryption key and a key encryption key. Among them, the data encryption key is used to encrypt the storage data of the encrypted storage device. The key encryption key is generated according to the user credential data of the user entering the encrypted storage device, which corresponds to the entering user. The key encryption key is used to encrypt the data encryption key. And, the key encryption key is used to be encrypted and stored by the master key.

其中,录入用户可以指的是加密存储设备的允许访问用户(即授权访问用户)。例如,录入用户可以是加密存储设备的管理用户录入的允许访问该加密存储设备的用户。管理用户可以为超级管理员或由超级管理员授权的一般管理员等。用户凭证数据包括以下至少一项:用户账号的密码、用户的个人识别码(Personal identification number,PIN)、用户录入的生物识别信息。这样显然,加密存储设备的访问用户必须提供正确的用户凭证才可以生成准确的密钥加密密钥,进而解密得到数据加密密钥,以采用数据加密密钥解密存储数据,访问数据。通过密钥加密密钥加密数据加密密钥,可以确保只有授权的录入用户才能访问敏感数据,进而访问硬件存储单元的存储数据。Among them, the entered user may refer to a user who is allowed to access the encrypted storage device (i.e., an authorized access user). For example, the entered user may be a user who is allowed to access the encrypted storage device and is entered by the management user of the encrypted storage device. The management user may be a super administrator or a general administrator authorized by the super administrator, etc. The user credential data includes at least one of the following: the password of the user account, the user's personal identification number (PIN), and the biometric information entered by the user. Obviously, the user who accesses the encrypted storage device must provide the correct user credentials to generate an accurate key encryption key, and then decrypt the data encryption key, so as to use the data encryption key to decrypt the stored data and access the data. Encrypting the data encryption key by the key encryption key can ensure that only authorized entered users can access sensitive data, and then access the stored data of the hardware storage unit.

可选地,如图2所示,数据加密密钥可以是调用TRNG生成的随机数。密钥加密密钥是采用密钥派生算法,根据用户的用户凭证数据生成的密钥加密密钥。可选地,加密存储设备的硬件存储单元中,不同的存储地址段的存储数据可以采用不同的数据加密密钥进行加密。这样,对划分的每个存储地址段,调用TRNG生成不同的随机数,得到每个存储地址段的数据加密密钥。Optionally, as shown in FIG2 , the data encryption key may be a random number generated by calling TRNG. The key encryption key is a key encryption key generated according to the user credential data of the user using a key derivation algorithm. Optionally, in the hardware storage unit of the encryption storage device, the storage data of different storage address segments may be encrypted using different data encryption keys. In this way, for each divided storage address segment, TRNG is called to generate a different random number to obtain the data encryption key of each storage address segment.

可选地,敏感数据密文包括数据密钥密文和加密密钥密文。内存中的敏感数据包括:数据密钥密文以及采用主密钥对加密密钥密文解密后的密钥加密密钥。相应可选地,数据处理方法还包括:处理器根据加密存储设备的录入用户的用户凭证数据进行密钥派生处理,得到录入用户的密钥加密密钥。处理器随机生成数据加密密钥。Optionally, the sensitive data ciphertext includes a data key ciphertext and an encryption key ciphertext. The sensitive data in the memory includes: a data key ciphertext and a key encryption key after decrypting the encryption key ciphertext using a master key. Correspondingly, optionally, the data processing method further includes: the processor performs key derivation processing based on user credential data of an input user of the encrypted storage device to obtain a key encryption key of the input user. The processor randomly generates a data encryption key.

基于此,处理器采用主密钥对加密存储设备的敏感数据进行加密处理,得到敏感数据密文的过程可以包括:处理器采用密钥加密密钥对数据加密密钥进行加密处理得到数据密钥密文。处理器采用主密钥对密钥加密密钥进行加密处理得到加密密钥密文,生成敏感数据密文。Based on this, the processor uses the master key to encrypt the sensitive data of the encrypted storage device to obtain the sensitive data ciphertext, which may include: the processor uses the key encryption key to encrypt the data encryption key to obtain the data key ciphertext. The processor uses the master key to encrypt the key encryption key to obtain the encryption key ciphertext, and generates the sensitive data ciphertext.

相应的,处理器采用主密钥对敏感数据密文进行解密处理,得到敏感数据的过程可以包括:处理器采用主密钥对加密密钥密文进行解密处理得到密钥加密密钥,生成并向内存写入敏感数据。该敏感数据包括:数据密钥密文以及密钥加密密钥。基于此,如图3所示,数据处理方法还包括:Accordingly, the processor uses the master key to decrypt the sensitive data ciphertext, and the process of obtaining the sensitive data may include: the processor uses the master key to decrypt the encryption key ciphertext to obtain the key encryption key, and generates and writes the sensitive data to the memory. The sensitive data includes: the data key ciphertext and the key encryption key. Based on this, as shown in FIG3, the data processing method also includes:

步骤301、响应于第一用户触发的数据读写请求,获取数据读写请求包括的第一用户凭证数据。Step 301: In response to a data read/write request triggered by a first user, first user credential data included in the data read/write request is obtained.

其中,第一用户在想要对加密存储设备读取或写入数据的情况下,会触发数据读写请求。该数据读写请求可以包括第一用户的第一用户凭证数据,以及所需访问的硬件存储单元的目标地址等。其中,目标地址可以为待写入数据的写入地址,或者,目标地址可以为待读取数据的数据地址。When the first user wants to read or write data to the encrypted storage device, a data read/write request is triggered. The data read/write request may include the first user credential data of the first user and the target address of the hardware storage unit to be accessed. The target address may be the write address of the data to be written, or the target address may be the data address of the data to be read.

步骤302、对第一用户凭证数据进行密钥派生处理,得到第一用户的密钥加密密钥。Step 302: Perform key derivation processing on the first user's credential data to obtain a key encryption key of the first user.

可选地,处理器可以调用密钥派生算法,对第一用户凭证数据进行密钥派生处理,得到第一用户的密钥加密密钥。其中,密钥派生算法可以为PBKDF2、‌‌Scrypt,或者‌‌HMAC-based PRF等。Optionally, the processor may call a key derivation algorithm to perform key derivation processing on the first user's credential data to obtain a key encryption key of the first user. The key derivation algorithm may be PBKDF2, Scrypt, or HMAC-based PRF, etc.

步骤303、在录入用户的密钥加密密钥中,存在第一用户的密钥加密密钥的情况下,采用第一用户的密钥加密密钥对数据密钥密文进行解密处理,得到数据加密密钥,采用数据加密密钥执行数据读写请求指示的数据读取处理。Step 303: If there is a first user's key encryption key in the key encryption key of the input user, the data key ciphertext is decrypted using the first user's key encryption key to obtain a data encryption key, and the data encryption key is used to execute the data reading process indicated by the data read/write request.

本申请实施例中,处理器在得到第一用户的密钥加密密钥之后,可以读取内存中的敏感数据。比较该敏感数据内录入用户的密钥加密密钥中,是否存在第一用户的密钥加密密钥。在录入用户的密钥加密密钥中,不存在第一用户的密钥加密密钥的情况下,表明第一用户不被允许访问加密存储设备。处理器可以返回提示信息。在录入用户的密钥加密密钥中,存在第一用户的密钥加密密钥的情况下,表明第一用户被允许访问加密存储设备。处理器可以从内存中的敏感数据内读取数据密钥密文,采用第一用户的密钥加密密钥对数据密钥密文进行解密处理,得到数据加密密钥,采用数据加密密钥执行数据读写请求指示的数据读取处理。这样,敏感数据可以用于对访问加密存储设备的用户进行身份验证,提升加密存储设备的访问安全性。并且,采用数据加密密钥加密存储数据,密钥加密密钥加密数据加密密钥,以及主密钥加密密钥加密密钥的三级密钥机制,通过较高层级的密钥用于加密或签名较低层级的密钥,形成一个密钥的层级链。这种三级密钥机制可以灵活地管理密钥,同时保持高度的安全性和访问控制。In an embodiment of the present application, after obtaining the key encryption key of the first user, the processor can read the sensitive data in the memory. Compare whether there is a key encryption key of the first user in the key encryption key of the input user in the sensitive data. In the case where the key encryption key of the first user does not exist in the key encryption key of the input user, it indicates that the first user is not allowed to access the encrypted storage device. The processor can return a prompt message. In the case where the key encryption key of the first user exists in the key encryption key of the input user, it indicates that the first user is allowed to access the encrypted storage device. The processor can read the data key ciphertext from the sensitive data in the memory, use the key encryption key of the first user to decrypt the data key ciphertext, obtain the data encryption key, and use the data encryption key to perform the data read processing indicated by the data read and write request. In this way, the sensitive data can be used to authenticate the user accessing the encrypted storage device and improve the access security of the encrypted storage device. In addition, a three-level key mechanism of using a data encryption key to encrypt the stored data, a key encryption key to encrypt the data encryption key, and a master key encryption key encryption key is used to encrypt or sign the lower-level key through a higher-level key to form a hierarchical chain of keys. This three-level key mechanism allows for flexible key management while maintaining a high level of security and access control.

进一步可选地,加密存储设备的硬件存储单元中,不同的存储地址段的存储数据可以采用不同的数据加密密钥进行加密。基于此,在步骤303中,处理器在录入用户的密钥加密密钥中,存在第一用户的密钥加密密钥的情况下,可以获取数据读写请求中访问的目标地址,获取目标地址对应的数据密钥密文。进而,采用第一用户的密钥加密密钥对数据密钥密文进行解密处理,得到数据加密密钥,采用数据加密密钥执行数据读写请求指示的数据读取处理。Further optionally, in the hardware storage unit of the encrypted storage device, the stored data in different storage address segments can be encrypted using different data encryption keys. Based on this, in step 303, when the processor enters the key encryption key of the user and there is a key encryption key of the first user, it can obtain the target address accessed in the data read/write request and obtain the data key ciphertext corresponding to the target address. Then, the data key ciphertext is decrypted using the key encryption key of the first user to obtain the data encryption key, and the data encryption key is used to perform the data reading process indicated by the data read/write request.

在一种可选地实现方式中,加密存储设备的录入用户也具有访问限制。例如,管理员用户可以访问所有硬件存储单元。而有的用户仅能访问部分的硬件存储单元。其中,每个录入用户可访问的硬件存储单元的存储地址段可以是管理用户自定义设置的。或者,也可以是根据设定的访问策略自动生成的。In an optional implementation, the logged-in user of the encrypted storage device also has access restrictions. For example, an administrator user can access all hardware storage units. Some users can only access some hardware storage units. Among them, the storage address segment of the hardware storage unit accessible to each logged-in user can be a custom setting of the management user. Alternatively, it can also be automatically generated according to the set access policy.

加密存储设备的敏感数据可以包括多个数据加密密钥。每个数据加密密钥用于对硬件存储单元中不同的存储地址段的存储数据进行加密。相应地,敏感数据密文包括多个数据密钥密文。内存中的敏感数据包括多个数据密钥密文。The sensitive data of the encrypted storage device may include multiple data encryption keys. Each data encryption key is used to encrypt the storage data of different storage address segments in the hardware storage unit. Accordingly, the sensitive data ciphertext includes multiple data key ciphertexts. The sensitive data in the memory includes multiple data key ciphertexts.

在一种可选地情况下,每个存储地址段的数据加密密钥可以是采用多个目标密钥加密密钥,对同一数据密钥密文进行解密处理得到。即,多个目标加密密钥对同一存储地址段的数据加密密钥加密得到的数据密钥密文相同。目标密钥加密密钥是允许访问存储地址段的录入用户的密钥加密密钥。这样,敏感数据密文包括硬件存储单元中各个存储地址段的数据密钥密文。相应地,内存中的敏感数据包括各个存储地址段的数据密钥密文。In an optional case, the data encryption key of each storage address segment can be obtained by decrypting the same data key ciphertext using multiple target key encryption keys. That is, the data key ciphertexts obtained by encrypting the data encryption key of the same storage address segment with multiple target encryption keys are the same. The target key encryption key is the key encryption key of the input user who is allowed to access the storage address segment. In this way, the sensitive data ciphertext includes the data key ciphertext of each storage address segment in the hardware storage unit. Correspondingly, the sensitive data in the memory includes the data key ciphertext of each storage address segment.

在另一种可选地情况下,多个目标加密密钥对同一存储地址段的数据加密密钥加密得到的数据密钥密文不同。这样,敏感数据密文包括硬件存储单元中各个存储地址段的至少一个数据密钥密文。相应地,内存中的敏感数据包括各个存储地址段的至少一个数据密钥密文。其中,在一个存储地址段允许访问的录入用户为多个的情况下,该存储地址段对应有多个数据密钥密文。如图4所示,数据处理方法还包括:In another optional case, the data key ciphertexts obtained by encrypting the data encryption key of the same storage address segment with multiple target encryption keys are different. In this way, the sensitive data ciphertext includes at least one data key ciphertext for each storage address segment in the hardware storage unit. Correspondingly, the sensitive data in the memory includes at least one data key ciphertext for each storage address segment. Among them, when there are multiple input users allowed to access a storage address segment, the storage address segment corresponds to multiple data key ciphertexts. As shown in Figure 4, the data processing method also includes:

步骤401、响应于第一用户触发的数据读写请求,获取数据读写请求包括的第一用户凭证数据。Step 401: In response to a data read/write request triggered by a first user, first user credential data included in the data read/write request is obtained.

该步骤的解释和实现方式可以参考前述步骤301,在此不做赘述。The explanation and implementation of this step can refer to the aforementioned step 301 and will not be described in detail here.

步骤402、对第一用户凭证数据进行密钥派生处理,得到第一用户的密钥加密密钥。Step 402: Perform key derivation processing on the first user's credential data to obtain a key encryption key of the first user.

该步骤的解释和实现方式可以参考前述步骤302,在此不做赘述。The explanation and implementation of this step can refer to the aforementioned step 302 and will not be elaborated here.

步骤403、在录入用户的密钥加密密钥中,存在第一用户的密钥加密密钥的情况下,获取第一用户可访问的第一地址段。Step 403: If the key encryption key of the first user exists in the key encryption key of the input user, obtain a first address segment accessible to the first user.

该步骤的解释和实现方式可以参考前述步骤303,在此不做赘述。需要说明的是,加密存储设备的录入用户具有访问限制。处理器可以获取第一用户可访问的第一地址段,以判断第一地址段是否包括数据读写请求指示访问的目标地址。在第一地址段不包括数据读写请求指示访问的目标地址的情况下,表明第一用户无权访问目标地址,处理器可以返回提示信息。在第一地址段包括数据读写请求指示访问的目标地址的情况下,表明第一用户有权访问目标地址,则可以执行下述步骤404。The explanation and implementation of this step can refer to the aforementioned step 303 and will not be described in detail here. It should be noted that the registered users of the encrypted storage device have access restrictions. The processor can obtain the first address segment accessible to the first user to determine whether the first address segment includes the target address that the data read and write request indicates to access. In the case where the first address segment does not include the target address that the data read and write request indicates to access, it indicates that the first user has no right to access the target address, and the processor can return a prompt message. In the case where the first address segment includes the target address that the data read and write request indicates to access, it indicates that the first user has the right to access the target address, and the following step 404 can be executed.

可选地,处理器可以存储有硬件存储单元中录入用户允许访问的存储地址段,以便于处理器获取第一用户可访问的第一地址段。该第一地址段即为第一用户允许访问的存储地址段。Optionally, the processor may store the storage address segment that the user is allowed to access in the hardware storage unit, so that the processor can obtain the first address segment that is accessible to the first user. The first address segment is the storage address segment that the first user is allowed to access.

步骤404、在第一地址段包括数据读写请求指示访问的目标地址的情况下,读取目标地址所在的第一地址段的数据密钥密文。Step 404: When the first address segment includes a target address to be accessed by the data read/write request, read the data key ciphertext of the first address segment where the target address is located.

本申请实施例中,在第一地址段包括数据读写请求指示访问的目标地址的情况下,表明第一用户有权访问目标地址。处理器读取目标地址所在的第一地址段的数据密钥密文。In the embodiment of the present application, when the first address segment includes the target address to be accessed by the data read/write request, it indicates that the first user has the right to access the target address. The processor reads the data key ciphertext of the first address segment where the target address is located.

在一种可选地实现方式中,内存中敏感数据包括:硬件存储单元中各存储地址段,以及各存储地址段对应的数据密钥密文。处理器从敏感数据中读取目标地址所在的第一地址段的数据密钥密文。In an optional implementation, the sensitive data in the memory includes: each storage address segment in the hardware storage unit, and the data key ciphertext corresponding to each storage address segment. The processor reads the data key ciphertext of the first address segment where the target address is located from the sensitive data.

在另一种可选地实现方式中,内存中敏感数据包括:硬件存储单元中各存储地址段、录入用户以及数据密钥密文的对应关系。该对应关系中,录入用户允许访问对应的存储地址段,且录入用户对应的数据密钥密文是:采用录入用户的密钥加密密钥对该存储地址段的数据加密密钥进行加密处理后得到的。处理器可以从敏感数据中读取与第一地址段,以及第一用户对应的数据密钥密文。In another optional implementation, the sensitive data in the memory includes: the correspondence between each storage address segment in the hardware storage unit, the input user, and the data key ciphertext. In the correspondence, the input user is allowed to access the corresponding storage address segment, and the data key ciphertext corresponding to the input user is obtained by encrypting the data encryption key of the storage address segment using the key encryption key of the input user. The processor can read the data key ciphertext corresponding to the first address segment and the first user from the sensitive data.

步骤405、采用第一用户的密钥加密密钥对数据密钥密文进行解密处理,得到第一地址段的数据加密密钥。Step 405: Use the key encryption key of the first user to decrypt the data key ciphertext to obtain the data encryption key of the first address segment.

步骤406、采用数据加密密钥执行数据读写请求指示的数据读取处理。Step 406: Use the data encryption key to execute the data read processing indicated by the data read/write request.

本申请一些实施例中,如前所述,加密存储设备的录入用户具有访问限制。加密存储设备的敏感信息包括权限控制数据。该权限控制数据至少指示录入用户可访问的存储地址段。相应地,敏感数据密文还包括:权限控制数据密文。该权限控制数据密文是采用主密钥对权限控制数据进行加密处理后得到的密文数据。内存中的敏感数据还包括权限控制数据。In some embodiments of the present application, as described above, the logged-in user of the encrypted storage device has access restrictions. The sensitive information of the encrypted storage device includes permission control data. The permission control data at least indicates the storage address segment accessible to the logged-in user. Accordingly, the sensitive data ciphertext also includes: permission control data ciphertext. The permission control data ciphertext is the ciphertext data obtained by encrypting the permission control data using the master key. The sensitive data in the memory also includes permission control data.

其中,权限控制数据用于负责管理不同用户或进程,对加密存储设备上数据的访问权限。加密存储设备可以根据权限控制数据,通过用户身份验证、定义访问控制策略和访问权限等方法,确保只有授权录入用户才能访问加密存储设备上的数据。例如,指定用户或指定用户组可以访问特定的数据,以及在指定条件下可以访问特定的数据。管理员用户可以拥有对加密存储设备上整个数据的完全访问权限和管理系统设置能力。相对地,普通用户可以只有读取或写入部分数据的权限。权限控制数据用于指示不同的录入用户的访问权限和身份验证信息,其经主密钥加密后存储于硬件存储单元。Among them, the permission control data is used to manage the access rights of different users or processes to the data on the encrypted storage device. The encrypted storage device can ensure that only authorized users can access the data on the encrypted storage device through user identity authentication, definition of access control policies and access rights, etc. according to the permission control data. For example, a specified user or a specified user group can access specific data, and can access specific data under specified conditions. The administrator user can have full access rights to the entire data on the encrypted storage device and the ability to manage system settings. In contrast, ordinary users can only have the authority to read or write part of the data. The permission control data is used to indicate the access rights and authentication information of different input users, which is encrypted by the master key and stored in the hardware storage unit.

可选地,步骤403获取第一用户可访问的第一地址段的过程包括:根据权限控制数据,确定第一用户可访问的第一地址段。其中,处理器可以读取内存中敏感数据内的权限控制数据,确定第一用户可访问的第一地址段。Optionally, the process of obtaining the first address segment accessible to the first user in step 403 includes: determining the first address segment accessible to the first user according to the permission control data. The processor may read the permission control data in the sensitive data in the memory to determine the first address segment accessible to the first user.

在一种可选地实现方式中,权限控制数据包括:密钥加密密钥和存储地址段的对应关系。处理器根据权限控制数据,确定第一用户可访问的第一地址段的过程可以包括:根据密钥加密密钥和存储地址段的对应关系,确定与第一用户的密钥加密密钥对应的存储地址段,得到第一地址段。In an optional implementation, the permission control data includes: a correspondence between a key encryption key and a storage address segment. The process of the processor determining the first address segment accessible to the first user according to the permission control data may include: determining the storage address segment corresponding to the key encryption key of the first user according to the correspondence between the key encryption key and the storage address segment, and obtaining the first address segment.

在另一种可选地实现方式中,权限控制数据包括:密钥加密密钥、数据密钥密文和存储地址段的对应关系。其中,密钥加密密钥用于对对应的数据密钥密文加解密。数据密钥密文解密后的数据加密密钥用于对对应的存储地址段的存储数据加解密。基于此,处理器根据权限控制数据,确定第一用户可访问的第一地址段的过程可以包括:根据密钥加密密钥、数据密钥密文和存储地址段的对应关系,确定与第一用户的密钥加密密钥对应的存储地址段,得到第一地址段。相应地,步骤404读取目标地址所在的第一地址段的数据密钥密文的过程可以包括:根据密钥加密密钥、数据密钥密文和存储地址段的对应关系,确定与第一用户的密钥加密密钥对应的数据密钥密文。In another optional implementation, the permission control data includes: a correspondence between a key encryption key, a data key ciphertext, and a storage address segment. Among them, the key encryption key is used to encrypt and decrypt the corresponding data key ciphertext. The data encryption key after decryption of the data key ciphertext is used to encrypt and decrypt the storage data of the corresponding storage address segment. Based on this, the processor determines the first address segment accessible to the first user according to the permission control data, which may include: determining the storage address segment corresponding to the key encryption key of the first user according to the correspondence between the key encryption key, the data key ciphertext, and the storage address segment, and obtaining the first address segment. Accordingly, the process of reading the data key ciphertext of the first address segment where the target address is located in step 404 may include: determining the data key ciphertext corresponding to the key encryption key of the first user according to the correspondence between the key encryption key, the data key ciphertext, and the storage address segment.

本申请一些实施例中,如前所述,加密存储设备的硬件存储单元中,不同的存储地址段的存储数据可以采用不同的数据加密密钥进行加密。加密存储设备的敏感信息包括访问范围数据。该访问范围数据至少指示加密存储设备的硬件存储单元的分段访问情况。分段访问情况指示硬件存储单元的存储数据段的划分情况。相应地,敏感数据密文还包括:访问范围数据密文。该访问范围数据密文是采用主密钥对访问范围数据进行加密处理后得到的密文数据。内存中的敏感数据还包括访问范围数据。In some embodiments of the present application, as described above, in the hardware storage unit of the encrypted storage device, the storage data of different storage address segments can be encrypted using different data encryption keys. The sensitive information of the encrypted storage device includes access range data. The access range data at least indicates the segmented access status of the hardware storage unit of the encrypted storage device. The segmented access status indicates the division status of the storage data segments of the hardware storage unit. Correspondingly, the sensitive data ciphertext also includes: access range data ciphertext. The access range data ciphertext is the ciphertext data obtained after encrypting the access range data using the master key. The sensitive data in the memory also includes access range data.

在录入用户存在访问权限的情况下,访问范围数据还用于至少指示加密存储设备的硬件存储单元中存储地址段对应的访问用户。或者,访问范围数据还用于至少指示每个存储地址段的访问用户类别。In the case that the input user has access rights, the access range data is also used to at least indicate the access user corresponding to the storage address segment in the hardware storage unit of the encryption storage device. Alternatively, the access range data is also used to at least indicate the access user category of each storage address segment.

在录入用户的访问权限相同,或者,多个目标加密密钥对同一存储地址段的数据加密密钥加密得到的数据密钥密文相同的情况下,敏感数据密文包括硬件存储单元中各个存储地址段的数据密钥密文。相应地,内存中的敏感数据包括各个存储地址段的数据密钥密文。When the access rights of the input users are the same, or when the data key ciphertexts obtained by encrypting the data encryption key of the same storage address segment with multiple target encryption keys are the same, the sensitive data ciphertext includes the data key ciphertexts of each storage address segment in the hardware storage unit. Accordingly, the sensitive data in the memory includes the data key ciphertexts of each storage address segment.

在多个目标加密密钥对同一存储地址段的数据加密密钥加密得到的数据密钥密文不同的情况下,敏感数据密文包括硬件存储单元中各个存储地址段的至少一个数据密钥密文。相应地,内存中的敏感数据包括各个存储地址段的至少一个数据密钥密文。其中,在一个存储地址段允许访问的录入用户为多个的情况下,该存储地址段对应有多个数据密钥密文。In the case where the data key ciphertexts obtained by encrypting the data encryption key of the same storage address segment with multiple target encryption keys are different, the sensitive data ciphertext includes at least one data key ciphertext for each storage address segment in the hardware storage unit. Correspondingly, the sensitive data in the memory includes at least one data key ciphertext for each storage address segment. Among them, in the case where there are multiple input users who are allowed to access a storage address segment, there are multiple data key ciphertexts corresponding to the storage address segment.

其中,访问范围数据用于负责定义和控制对加密存储设备上特定数据段的访问权限。通过划分硬件存储单元上各存储数据段的范围,并通过分配数据加密密钥、基于用户的身份验证和授权状态提供锁定和解锁锁定范围等方法,允许对加密存储设备上的数据进行细粒度的访问控制,降低数据泄露风险。访问范围数据用于指示特定存储数据段的访问权限和访问策略,其经主密钥加密后生成访问范围数据密文。Among them, the access range data is responsible for defining and controlling the access rights to specific data segments on the encrypted storage device. By dividing the range of each storage data segment on the hardware storage unit, and by allocating data encryption keys, and providing locking and unlocking lock ranges based on user authentication and authorization status, fine-grained access control is allowed for data on the encrypted storage device to reduce the risk of data leakage. The access range data is used to indicate the access rights and access policies of a specific storage data segment, which is encrypted by the master key to generate the access range data ciphertext.

可选地,步骤403获取第一用户可访问的第一地址段的过程包括:根据访问范围数据,确定第一用户可访问的第一地址段。其中,处理器可以读取内存中敏感数据内的访问范围数据,确定第一用户可访问的第一地址段。Optionally, the process of obtaining the first address segment accessible to the first user in step 403 includes: determining the first address segment accessible to the first user according to the access range data. The processor may read the access range data in the sensitive data in the memory to determine the first address segment accessible to the first user.

在一种可选地实现方式中,访问范围数据包括:密钥加密密钥、数据密钥密文和存储地址段的对应关系。密钥加密密钥用于对对应的数据密钥密文加解密。数据密钥密文解密后的数据加密密钥用于对对应的存储地址段的存储数据加解密。基于此,处理器根据访问范围数据,确定第一用户可访问的第一地址段的过程可以,包括:根据密钥加密密钥、数据密钥密文和存储地址段的对应关系,确定与第一用户的密钥加密密钥对应的存储地址段,得到第一地址段。相应地,步骤404读取目标地址所在的第一地址段的数据密钥密文的过程可以包括:根据密钥加密密钥、数据密钥密文和存储地址段的对应关系,确定与第一用户的密钥加密密钥对应的数据密钥密文。In an optional implementation, the access range data includes: a correspondence between a key encryption key, a data key ciphertext, and a storage address segment. The key encryption key is used to encrypt and decrypt the corresponding data key ciphertext. The data encryption key after decryption of the data key ciphertext is used to encrypt and decrypt the storage data of the corresponding storage address segment. Based on this, the process of the processor determining the first address segment accessible to the first user based on the access range data may include: determining the storage address segment corresponding to the key encryption key of the first user based on the correspondence between the key encryption key, the data key ciphertext, and the storage address segment, and obtaining the first address segment. Accordingly, the process of step 404 reading the data key ciphertext of the first address segment where the target address is located may include: determining the data key ciphertext corresponding to the key encryption key of the first user based on the correspondence between the key encryption key, the data key ciphertext, and the storage address segment.

在另一种可选地实现方式中,访问范围数据包括:数据密钥密文和存储地址段的对应关系。步骤404读取目标地址所在的第一地址段的数据密钥密文的过程可以包括:根据数据密钥密文和存储地址段的对应关系,确定与第一地址段对应的数据密钥密文。In another optional implementation, the access range data includes: a correspondence between a data key ciphertext and a storage address segment. The process of reading the data key ciphertext of the first address segment where the target address is located in step 404 may include: determining the data key ciphertext corresponding to the first address segment according to the correspondence between the data key ciphertext and the storage address segment.

在一些实施例中,访问范围数据的生成过程可以包括下述步骤011至步骤017。In some embodiments, the process of generating access range data may include the following steps 011 to 017 .

在步骤011中,获取加密存储设备的硬件存储单元的访问范围信息。访问范围信息指示硬件存储单元的分段访问情况。In step 011, the access range information of the hardware storage unit of the encryption storage device is obtained. The access range information indicates the segmented access status of the hardware storage unit.

可选地,访问范围信息可以是根据设定的访问范围控制策略生成的。或者,硬件存储单元的分段访问情况也可以是管理用户自定义设置的。处理器可以响应于管理用户的访问范围录入操作,获取管理用户录入的硬件存储单元的访问范围信息。Optionally, the access range information may be generated according to a set access range control policy. Alternatively, the segmented access status of the hardware storage unit may also be a custom setting of the management user. The processor may obtain the access range information of the hardware storage unit entered by the management user in response to the access range entry operation of the management user.

在步骤012中,根据访问范围信息,确定硬件存储单元的多个存储地址段。In step 012, multiple storage address segments of the hardware storage unit are determined based on the access range information.

示例地,假设加密存储设备包括第一硬件存储单元、第二硬件存储单元和第三硬件存储单元。若加密存储设备按照硬件存储单元划分,则处理器确定的多个存储地址段包括第一存储地址段、第二存储地址段和第三存储地址段。第一存储地址段为第一硬件存储单元的存储地址段。第二存储地址段为第二硬件存储单元的存储地址段。第三存储地址段为第三硬件存储单元的存储地址段。For example, it is assumed that the encryption storage device includes a first hardware storage unit, a second hardware storage unit, and a third hardware storage unit. If the encryption storage device is divided according to the hardware storage unit, the multiple storage address segments determined by the processor include a first storage address segment, a second storage address segment, and a third storage address segment. The first storage address segment is a storage address segment of the first hardware storage unit. The second storage address segment is a storage address segment of the second hardware storage unit. The third storage address segment is a storage address segment of the third hardware storage unit.

在步骤013中,生成每个存储地址段不同的数据加密密钥。In step 013, a different data encryption key is generated for each storage address segment.

其中,处理器可以生成每个存储地址段不同的数据加密密钥,得到访问范围信息。可选地,处理器可以为每个存储地址段随机生成一个不同的随机数,得到每个存储地址段的数据加密密钥。The processor may generate a different data encryption key for each storage address segment to obtain the access range information. Alternatively, the processor may randomly generate a different random number for each storage address segment to obtain the data encryption key for each storage address segment.

在步骤014中,针对每个存储地址段,采用对应的数据加密密钥对存储地址段的存储数据进行加密处理,生成存储数据密文,向存储地址段对应的硬件存储空间写入存储数据密文。In step 014, for each storage address segment, the storage data of the storage address segment is encrypted using the corresponding data encryption key to generate storage data ciphertext, and the storage data ciphertext is written to the hardware storage space corresponding to the storage address segment.

可选地,处理器可以响应于数据写入操作,获取数据写入操作的数据写入地址。采用数据写入地址所在的存储地址段的数据加密密钥,对待写入数据进行加密处理生成存储数据密文,向数据写入地址写入该存储数据密文。Optionally, the processor may obtain a data write address of the data write operation in response to the data write operation, encrypt the data to be written using the data encryption key of the storage address segment where the data write address is located to generate storage data ciphertext, and write the storage data ciphertext to the data write address.

进一步可选地,访问范围信息还指示每个存储地址段的访问用户类别。可选地,管理用户还可以定义每个存储地址段可访问的录入用户或录入用户组。访问范围数据的生成过程还包括:Further optionally, the access range information also indicates the access user category of each storage address segment. Optionally, the management user can also define the entry user or entry user group that can access each storage address segment. The generation process of the access range data also includes:

在步骤015中,针对每个存储地址段,获取存储地址段的访问用户类别的每个目标录入用户的密钥加密密钥。In step 015, for each storage address segment, a key encryption key of each target entry user of the access user category of the storage address segment is obtained.

可选地,针对每个存储地址段,处理器可以从访问范围信息中,确定每个存储地址段的访问用户类别。进而确定该访问用户类别中的每个录入用户,得到目标录入用户,获取每个目标录入用户的密钥加密密钥。Optionally, for each storage address segment, the processor may determine the access user category of each storage address segment from the access range information, and then determine each input user in the access user category, obtain the target input user, and obtain the key encryption key of each target input user.

在步骤016中,采用每个目标录入用户的密钥加密密钥,分别对存储地址段对应的数据加密密钥进行加密处理,得到存储地址段对应的数据密钥密文。In step 016, the key encryption key of each target input user is used to encrypt the data encryption key corresponding to the storage address segment to obtain the data key ciphertext corresponding to the storage address segment.

本申请实施例中,处理器可以针对每个存储数据段,采用该存储数据段的每个目标录入用户的密钥加密密钥,分别对该存储地址段对应的数据加密密钥进行加密处理,得到该存储地址段对应的数据密钥密文。In an embodiment of the present application, the processor can, for each storage data segment, use the key encryption key of each target entry user of the storage data segment to encrypt the data encryption key corresponding to the storage address segment to obtain the data key ciphertext corresponding to the storage address segment.

其中,在多个目标加密密钥对同一存储地址段的数据加密密钥加密得到的数据密钥密文相同的情况下,处理器可以得到存储地址段对应的一个数据密钥密文。在多个目标加密密钥对同一存储地址段的数据加密密钥加密得到的数据密钥密文不同的情况下,若存储数据段的目标录入用户的数量为多个,则处理器可以得到存储地址段对应的多个数据密钥密文。Among them, when the data key ciphertexts obtained by encrypting the data encryption key of the same storage address segment with multiple target encryption keys are the same, the processor can obtain a data key ciphertext corresponding to the storage address segment. When the data key ciphertexts obtained by encrypting the data encryption key of the same storage address segment with multiple target encryption keys are different, if the number of target input users of the storage data segment is multiple, the processor can obtain multiple data key ciphertexts corresponding to the storage address segment.

在步骤017中,根据存储地址段,对应的数据密钥密文以及目标录入用户的密钥加密密钥,生成访问范围数据。In step 017, access range data is generated according to the storage address segment, the corresponding data key ciphertext and the key encryption key of the target entry user.

本申请实施例中,处理器可以根据单个存储地址段对应的每个目标录入用户的密钥加密密钥,以及每个目标录入用户的数据密钥密文,确定单个存储地址段、数据密钥密文以及密钥加密密钥的对应关系,进而得到每个存储地址段、数据密钥密文以及密钥加密密钥的对应关系。In an embodiment of the present application, the processor can determine the correspondence between a single storage address segment, the data key ciphertext, and the key encryption key based on the key encryption key of each target entry user corresponding to a single storage address segment, and the data key ciphertext of each target entry user, and then obtain the correspondence between each storage address segment, the data key ciphertext, and the key encryption key.

示例地,假设硬件存储单元包括第一存储地址段和第二存储地址段。存在两个目标录入用户允许访问第一存储地址。该两个目标录入用户的密钥加密密钥依次为:密钥加密密钥A11和密钥加密密钥A12。采用密钥加密密钥A11第一存储地址的数据加密密钥进行加密处理,得到数据密钥密文B11。采用密钥加密密钥A12第一存储地址的数据加密密钥进行加密处理,得到数据密钥密文B12。For example, it is assumed that the hardware storage unit includes a first storage address segment and a second storage address segment. There are two target entry users who are allowed to access the first storage address. The key encryption keys of the two target entry users are: key encryption key A11 and key encryption key A12. The data encryption key of the first storage address of key encryption key A11 is used for encryption processing to obtain data key ciphertext B11. The data encryption key of the first storage address of key encryption key A12 is used for encryption processing to obtain data key ciphertext B12.

存在两个目标录入用户允许访问第一存储地址。该两个目标录入用户的密钥加密密钥依次为:密钥加密密钥A21和密钥加密密钥A22。采用密钥加密密钥A21第一存储地址的数据加密密钥进行加密处理,得到数据密钥密文B21。采用密钥加密密钥A22第一存储地址的数据加密密钥进行加密处理,得到数据密钥密文B22。There are two target entry users who are allowed to access the first storage address. The key encryption keys of the two target entry users are: key encryption key A21 and key encryption key A22. The data encryption key of the first storage address of key encryption key A21 is used for encryption processing to obtain data key ciphertext B21. The data encryption key of the first storage address of key encryption key A22 is used for encryption processing to obtain data key ciphertext B22.

处理器生成的访问范围数据为:第一存储地址-密钥加密密钥A11-数据密钥密文B11、第一存储地址-密钥加密密钥A12-数据密钥密文B12、第二存储地址-密钥加密密钥A21-数据密钥密文B21,以及第二存储地址-密钥加密密钥A22-数据密钥密文B22。The access range data generated by the processor is: first storage address-key encryption key A11-data key ciphertext B11, first storage address-key encryption key A12-data key ciphertext B12, second storage address-key encryption key A21-data key ciphertext B21, and second storage address-key encryption key A22-data key ciphertext B22.

在一些实施例中,权限控制数据的生成过程包括下述步骤021至步骤025。In some embodiments, the process of generating the permission control data includes the following steps 021 to 025.

在步骤021中,获取第二用户的用户凭证数据和权限控制信息。权限控制信息指示第二用户可访问的第二地址段。In step 021, user credential data and permission control information of a second user are obtained. The permission control information indicates a second address segment accessible to the second user.

可选地,第二用户可以为待录入用户。管理用户允许第二用户访问加密存储设备。处理器可以响应于管理用户的权限录入操作,获取管理用户录入的第二用户的用户凭证数据和权限控制信息。Optionally, the second user may be a user to be entered. The management user allows the second user to access the encrypted storage device. The processor may obtain the user credential data and permission control information of the second user entered by the management user in response to the permission entry operation of the management user.

在步骤022中,对第二用户的用户凭证数据进行密钥派生处理,得到第二用户的密钥加密密钥。In step 022, key derivation processing is performed on the user credential data of the second user to obtain a key encryption key of the second user.

在步骤023中,获取第二地址段对应的数据加密密钥。In step 023, the data encryption key corresponding to the second address segment is obtained.

在步骤024中,采用第二用户的密钥加密密钥,对第二地址段的数据加密密钥进行加密处理,得到第二地址段对应的数据密钥密文。In step 024, the data encryption key of the second address segment is encrypted using the key encryption key of the second user to obtain the data key ciphertext corresponding to the second address segment.

在步骤025中,生成权限控制数据。In step 025, authority control data is generated.

可选地,根据第二用户的密钥加密密钥、第二地址段,以及第二地址段的数据密钥密文,生成权限控制数据。该权限控制数据包括:第二用户的密钥加密密钥、第二地址段和数据密钥密文。Optionally, the permission control data is generated according to the second user's key encryption key, the second address segment, and the data key ciphertext of the second address segment. The permission control data includes: the second user's key encryption key, the second address segment, and the data key ciphertext.

需要说明的是,在一些实施例中,在多个目标加密密钥对同一存储地址段的数据加密密钥加密得到的数据密钥密文相同的情况下,权限控制数据的生成过程可以包括:获取第二用户的用户凭证数据和权限控制信息。权限控制信息指示第二用户可访问的第二地址段。对第二用户的用户凭证数据进行密钥派生处理,得到第二用户的密钥加密密钥。获取第二地址段对应的数据密钥密文。生成权限控制数据,该权限控制数据包括:第二用户的密钥加密密钥、第二地址段和数据密钥密文。其中,处理器可以从访问范围数据中获取第二地址段对应的数据密钥密文。It should be noted that, in some embodiments, when the data key ciphertext obtained by encrypting the data encryption key of the same storage address segment with multiple target encryption keys is the same, the process of generating the permission control data may include: obtaining the user credential data and permission control information of the second user. The permission control information indicates the second address segment accessible to the second user. Perform key derivation processing on the user credential data of the second user to obtain the key encryption key of the second user. Obtain the data key ciphertext corresponding to the second address segment. Generate permission control data, which includes: the key encryption key of the second user, the second address segment and the data key ciphertext. Among them, the processor can obtain the data key ciphertext corresponding to the second address segment from the access range data.

本申请一些实施例中,加密存储设备的敏感数据包括多个数据段。相应地,敏感数据密文包括多个数据密文段。示例地,如图5所示,加密存储设备的敏感数据包括密钥管理数据段、权限控制数据段和访问范围数据段。其中,密钥管理数据段包括:密钥加密密钥和数据加密密钥。权限控制数据段包括权限控制数据。访问范围数据段包括访问范围数据。In some embodiments of the present application, the sensitive data of the encrypted storage device includes multiple data segments. Correspondingly, the sensitive data ciphertext includes multiple data ciphertext segments. By way of example, as shown in FIG5 , the sensitive data of the encrypted storage device includes a key management data segment, a permission control data segment, and an access range data segment. Among them, the key management data segment includes: a key encryption key and a data encryption key. The permission control data segment includes permission control data. The access range data segment includes access range data.

相应地,敏感数据密文包括密钥管理数据段、权限控制数据段和访问范围数据段。其中,密钥管理数据段包括:采用主密钥对密钥加密密钥加密后的密钥加密密文,以及采用密钥加密密钥对数据加密密钥加密后的数据加密密文。权限控制数据段包括:采用主密钥对权限控制数据加密后的权限控制数据密文。访问范围数据段包括:采用主密钥对访问范围数据加密后的访问范围数据密文。当然,加密存储设备的敏感数据还包括其他安全信息数据段。相应地,敏感数据密文还包括其他安全信息数据段,该其他安全信息数据段包括:采用主密钥对敏感数据中其他安全信息数据段内的数据加密后的密文。Correspondingly, the sensitive data ciphertext includes a key management data segment, an authority control data segment, and an access range data segment. Among them, the key management data segment includes: a key-encrypted ciphertext encrypted by using a master key to encrypt a key encryption key, and a data-encrypted ciphertext encrypted by using a key encryption key to encrypt a data encryption key. The authority control data segment includes: an authority control data ciphertext encrypted by using a master key to encrypt authority control data. The access range data segment includes: an access range data ciphertext encrypted by using a master key to encrypt access range data. Of course, the sensitive data of the encrypted storage device also includes other security information data segments. Correspondingly, the sensitive data ciphertext also includes other security information data segments, and the other security information data segments include: a ciphertext encrypted by using a master key to encrypt data in other security information data segments in the sensitive data.

相应地,内存中的敏感数据包括密钥管理数据段、权限控制数据段和访问范围数据段。其中,密钥管理数据段包括:密钥加密密钥以及数据加密密文。权限控制数据段包括:权限控制数据。访问范围数据段包括:访问范围数据。Correspondingly, the sensitive data in the memory includes a key management data segment, an authority control data segment, and an access range data segment. Among them, the key management data segment includes: key encryption key and data encryption ciphertext. The authority control data segment includes: authority control data. The access range data segment includes: access range data.

进一步可选地,敏感数据密文的每个数据密文段不仅包括敏感子数据密文,还包括敏感子数据密文解密后的数据的目标散列值。相应地,内存中的敏感数据包括:与多个数据密文段一一对应的数据段,每个数据段包括敏感子数据密文对应的敏感子数据。基于此,如图6所示,数据处理方法还包括:Further optionally, each data ciphertext segment of the sensitive data ciphertext includes not only the sensitive sub-data ciphertext, but also the target hash value of the data after the sensitive sub-data ciphertext is decrypted. Accordingly, the sensitive data in the memory includes: data segments corresponding to multiple data ciphertext segments one by one, and each data segment includes sensitive sub-data corresponding to the sensitive sub-data ciphertext. Based on this, as shown in FIG6 , the data processing method further includes:

步骤601、响应于错误数据定位操作,获取内存的敏感数据。Step 601: In response to an error data location operation, sensitive data in the memory is obtained.

本申请实施例中,错误数据定位操作用于对内存中敏感数据进行错误查找定位。可选地,错误数据定位操作可以由处理器在目标情况自动触发。或者,错误数据定位操作也可以是由管理用户手动触发的。目标情况可以为数据读写异常情况。In an embodiment of the present application, the error data location operation is used to locate errors in sensitive data in the memory. Optionally, the error data location operation can be automatically triggered by the processor in a target situation. Alternatively, the error data location operation can also be manually triggered by a management user. The target situation can be a data read and write abnormal situation.

步骤602、针对敏感数据中每个数据段,根据数据段中的敏感子数据,计算对应的敏感子数据密文对应的散列值,得到当前散列值。Step 602: For each data segment in the sensitive data, calculate the hash value corresponding to the ciphertext of the corresponding sensitive sub-data according to the sensitive sub-data in the data segment to obtain the current hash value.

可选地,处理器可以采用哈希算法,根据数据段中的敏感子数据,计算对应的敏感子数据密文对应的散列值,得到当前散列值。Optionally, the processor may use a hash algorithm to calculate a hash value corresponding to a ciphertext of the corresponding sensitive sub-data according to the sensitive sub-data in the data segment to obtain a current hash value.

步骤603、对目标散列值和当前散列值进行比较,确定比较结果指示不相等的当前散列值对应的敏感子数据有误。Step 603: Compare the target hash value and the current hash value, and determine that the comparison result indicates that the sensitive sub-data corresponding to the unequal current hash value is incorrect.

其中,获取敏感数据密文中每个数据密文段的目标散列值。针对敏感数据中每个数据段,比较该数据段对应的数据密文段的目标散列值,与该数据段的当前散列值是否一致。若一致,则确定该数据段的数据无误。若不一致,则该数据段内的敏感子数据有误。Among them, the target hash value of each data ciphertext segment in the sensitive data ciphertext is obtained. For each data segment in the sensitive data, the target hash value of the data ciphertext segment corresponding to the data segment is compared with the current hash value of the data segment to see if they are consistent. If they are consistent, it is determined that the data of the data segment is correct. If they are inconsistent, the sensitive sub-data in the data segment is incorrect.

示例地,敏感数据密文包括:密钥管理数据段、权限控制数据段和访问范围数据段。其中,密钥管理数据段包括:采用主密钥对密钥加密密钥加密后的密钥加密密文、采用密钥加密密钥对数据加密密钥加密后的数据加密密文,以及第一散列值。第一散列值为数据加密密钥和密钥加密密钥的散列值。权限控制数据段包括:采用主密钥对权限控制数据加密后的权限控制数据密文,以及第二散列值。第二散列值为权限控制数据的散列值。访问范围数据段包括:采用主密钥对访问范围数据加密后的访问范围数据密文,以及第三散列值。第三散列值为访问范围数据的散列值。By way of example, the sensitive data ciphertext includes: a key management data segment, a permission control data segment, and an access range data segment. Among them, the key management data segment includes: a key-encrypted ciphertext encrypted by a master key to a key encryption key, a data-encrypted ciphertext encrypted by a key encryption key to a data encryption key, and a first hash value. The first hash value is a hash value of the data encryption key and the key encryption key. The permission control data segment includes: a permission control data ciphertext encrypted by a master key to permission control data, and a second hash value. The second hash value is a hash value of the permission control data. The access range data segment includes: a access range data ciphertext encrypted by a master key to access range data, and a third hash value. The third hash value is a hash value of the access range data.

处理器执行步骤602至步骤603针对每个数据段,根据数据段中的敏感子数据,计算对应的敏感子数据密文对应的散列值,得到当前散列值,对目标散列值和当前散列值进行比较,确定比较结果指示不相等的当前散列值对应的敏感子数据有误的过程可以包括,包括:The process in which the processor executes steps 602 to 603, for each data segment, calculates a hash value corresponding to the ciphertext of the corresponding sensitive sub-data according to the sensitive sub-data in the data segment, obtains a current hash value, compares the target hash value with the current hash value, and determines that the sensitive sub-data corresponding to the current hash value that is not equal to the comparison result is incorrect may include:

采用密钥加密密钥对敏感数据中的数据密钥密文进行解密处理,得到数据加密密钥;计算敏感数据中数据加密密钥和密钥加密密钥的散列值,得到第四散列值;计算敏感数据中权限控制数据的散列值,得到第五散列值;计算敏感数据中访问范围数据的散列值,得到第六散列值;对第一散列值和第四散列值,第二散列值和第五散列值,第三散列值和第六散列值进行比较,确定敏感数据中,比较结果指示不相等的散列值对应的数据有误。Decrypting the data key ciphertext in the sensitive data using a key encryption key to obtain the data encryption key; calculating hash values of the data encryption key and the key encryption key in the sensitive data to obtain a fourth hash value; calculating the hash value of the permission control data in the sensitive data to obtain a fifth hash value; calculating the hash value of the access range data in the sensitive data to obtain a sixth hash value; comparing the first hash value and the fourth hash value, the second hash value and the fifth hash value, and the third hash value and the sixth hash value to determine that in the sensitive data, the data corresponding to the hash values that are not equal as indicated by the comparison result are incorrect.

这样,在加密存储设备出现运行异常,使内存中的敏感信息遭到破坏时,加密存储设备可以通过先计算内存中各个数据段的散列值,进而通过将计算的散列值与硬件存储单元内敏感数据密文中存储的目标散列值相比,以快速内存中确定散列值不等的数据段存在数据异常,实现对错误数据段的快速定位,进而可以利用主密钥再次对硬件存储单元中的敏感数据密文进行解密,以重新获取敏感数据存储于内存,实现内存中敏感数据的快速恢复。In this way, when the encrypted storage device malfunctions and causes sensitive information in the memory to be destroyed, the encrypted storage device can first calculate the hash value of each data segment in the memory, and then compare the calculated hash value with the target hash value stored in the sensitive data ciphertext in the hardware storage unit to quickly determine in the memory that there is a data anomaly in the data segments with unequal hash values, thereby quickly locating the erroneous data segments, and then use the master key to decrypt the sensitive data ciphertext in the hardware storage unit again to regain the sensitive data and store it in the memory, thereby realizing rapid recovery of the sensitive data in the memory.

本申请一些实施例中,访问范围数据密文是采用分组加密算法,利用主密钥对访问范围数据进行加密后的数据。权限控制数据密文是采用分组加密算法,利用主密钥对权限控制数据进行加密后的数据。数据密钥密文是采用分组加密算法,利用密钥加密密钥对数据加密密钥进行加密后的数据。加密密钥密文是采用分组加密算法,利用主密钥对密钥加密密钥进行加密后的数据。敏感子数据密文对应的散列值是采用哈希算法,根据敏感数据中对应的敏感子数据计算得到的数据。其中,分组加密算法包括SM1、SM4或AES。哈希算法包括SM3和SHA-3。In some embodiments of the present application, the access range data ciphertext is data obtained by encrypting the access range data using a block encryption algorithm and a master key. The permission control data ciphertext is data obtained by encrypting the permission control data using a block encryption algorithm and a master key. The data key ciphertext is data obtained by encrypting the data encryption key using a block encryption algorithm and a key encryption key. The encryption key ciphertext is data obtained by encrypting the key encryption key using a block encryption algorithm and a master key. The hash value corresponding to the sensitive sub-data ciphertext is data calculated using a hash algorithm based on the corresponding sensitive sub-data in the sensitive data. Among them, the block encryption algorithm includes SM1, SM4 or AES. The hash algorithm includes SM3 and SHA-3.

可选地,加密存储设备包括数据加解密模块。数据加解密模块包括第一运算单元和第二运算单元。第一运算单元用于执行分组加密算法。第二运算单元用于执行哈希算法。基于此,访问范围数据密文、权限控制数据密文、数据密钥密文、加密密钥密文均是通过调用第一运算单元得到的数据;敏感子数据密文对应的散列值是通过调用第二运算单元得到的数据。Optionally, the encryption storage device includes a data encryption and decryption module. The data encryption and decryption module includes a first operation unit and a second operation unit. The first operation unit is used to execute a block encryption algorithm. The second operation unit is used to execute a hash algorithm. Based on this, the access range data ciphertext, the authority control data ciphertext, the data key ciphertext, and the encryption key ciphertext are all data obtained by calling the first operation unit; the hash value corresponding to the sensitive sub-data ciphertext is data obtained by calling the second operation unit.

示例地,以加密存储设备的敏感数据为SP表为例。如图7所示,加密存储设备的SP表包括:密钥管理数据段、权限控制数据段、访问范围数据段、管理接口数据段和其他数据段。For example, the sensitive data of the encrypted storage device is taken as an SP table. As shown in Fig. 7, the SP table of the encrypted storage device includes: a key management data segment, a permission control data segment, an access range data segment, a management interface data segment and other data segments.

其中,密钥管理数据段包括:密钥加密密钥和数据加密密钥。权限控制数据段包括权限控制数据。访问范围数据段包括访问范围数据。管理接口数据段包括管理接口数据。其他数据段包括SP其他数据。Among them, the key management data segment includes: key encryption key and data encryption key. The authority control data segment includes authority control data. The access range data segment includes access range data. The management interface data segment includes management interface data. The other data segment includes SP other data.

硬件存储单元中的SP表(敏感数据密文)包括:密钥管理数据段、权限控制数据段、访问范围数据段、管理接口数据段和其他数据段。The SP table (sensitive data ciphertext) in the hardware storage unit includes: key management data segment, permission control data segment, access scope data segment, management interface data segment and other data segments.

其中,密钥管理数据段包括:调用第一运算单元采用主密钥对密钥加密密钥加密后的密钥加密密文、调用第一运算单元采用密钥加密密钥对数据加密密钥加密后的数据加密密文,以及密钥管理散列值(即第一散列值)。第一散列值为调用第二运算单元计算的数据加密密钥和密钥加密密钥的散列值。权限控制数据段包括:调用第一运算单元采用主密钥对权限控制数据加密后的权限控制数据密文,以及权限控制散列值(即第二散列值)。第二散列值为调用第二运算单元计算的权限控制数据的散列值。访问范围数据段包括:调用第一运算单元采用主密钥对访问范围数据加密后的访问范围数据密文,以及访问范围散列值(即第三散列值)。第三散列值为调用第二运算单元计算的访问范围数据的散列值。管理接口数据段包括:调用第一运算单元采用主密钥对接口数据加密后的接口数据密文,以及管理接口散列值。管理接口散列值为调用第二运算单元计算的管理接口数据的散列值。其他数据段包括:调用第一运算单元采用主密钥对SP其他数据加密后的其他数据密文,以及其他数据散列值。其他数据散列值为调用第二运算单元计算的SP其他数据的散列值。Among them, the key management data segment includes: the key encryption ciphertext after calling the first operation unit to encrypt the key encryption key with the master key, the data encryption ciphertext after calling the first operation unit to encrypt the data encryption key with the key encryption key, and the key management hash value (i.e., the first hash value). The first hash value is the hash value of the data encryption key and the key encryption key calculated by calling the second operation unit. The authority control data segment includes: the authority control data ciphertext after calling the first operation unit to encrypt the authority control data with the master key, and the authority control hash value (i.e., the second hash value). The second hash value is the hash value of the authority control data calculated by calling the second operation unit. The access range data segment includes: the access range data ciphertext after calling the first operation unit to encrypt the access range data with the master key, and the access range hash value (i.e., the third hash value). The third hash value is the hash value of the access range data calculated by calling the second operation unit. The management interface data segment includes: the interface data ciphertext after calling the first operation unit to encrypt the interface data with the master key, and the management interface hash value. The management interface hash value is the hash value of the management interface data calculated by calling the second operation unit. The other data segment includes: the ciphertext of other data encrypted by calling the first operation unit using the master key to encrypt the other data of SP, and the hash value of other data. The hash value of other data is the hash value of the other data of SP calculated by calling the second operation unit.

内存中的敏感数据包括:密钥管理数据段、权限控制数据段、访问范围数据段、管理接口数据段和其他数据段。其中,密钥管理数据段包括:数据加密密文,以及调用第一运算单元采用主密钥对密钥加密密文解密后的密钥加密密钥。权限控制数据段包括调用第一运算单元采用主密钥对权限控制数据密文解密后的权限控制数据。访问范围数据段包括调用第一运算单元采用主密钥对访问范围数据密文解密后的访问范围数据。管理接口数据段包括调用第一运算单元采用主密钥对接口数据密文解密后的接口数据。其他数据段包括调用第一运算单元采用主密钥对其他数据密文解密后的SP表其他数据。The sensitive data in the memory include: key management data segment, permission control data segment, access range data segment, management interface data segment and other data segments. Among them, the key management data segment includes: data encryption ciphertext, and the key encryption key after calling the first operation unit to use the master key to decrypt the key encryption ciphertext. The permission control data segment includes the permission control data after calling the first operation unit to use the master key to decrypt the permission control data ciphertext. The access range data segment includes the access range data after calling the first operation unit to use the master key to decrypt the access range data ciphertext. The management interface data segment includes the interface data after calling the first operation unit to use the master key to decrypt the interface data ciphertext. Other data segments include other data in the SP table after calling the first operation unit to use the master key to decrypt other data ciphertexts.

这样,通过将各类加解密算法(诸如SM3/SM4)集成于一个数据加解密模块,使得加密存储设备的敏感数据可以通过一次传输至数据加解密模块,即可同时执行各类加解密运算。并且,处理器可以同时调用不同的运算单元,以同时对不同的数据进行加解密,以实现多个数据加解密的并行运算,提升加解密的运算效率。In this way, by integrating various encryption and decryption algorithms (such as SM3/SM4) into a data encryption and decryption module, the sensitive data of the encrypted storage device can be transmitted to the data encryption and decryption module once, and various encryption and decryption operations can be performed simultaneously. In addition, the processor can call different operation units at the same time to encrypt and decrypt different data at the same time, so as to realize the parallel operation of multiple data encryption and decryption, and improve the operation efficiency of encryption and decryption.

本申请实施例中,加密存储设备可以在上电时生成第一密钥分量,并根据第一密钥分量和存储的第二密钥分量生成主密钥,进而采用主密钥对加密存储设备的敏感数据进行加密处理,得到敏感数据密文,向加密存储设备的硬件存储单元写入敏感数据密文。该技术方案中,主密钥存储于加密存储设备的内存。响应于敏感数据读取操作,可以采用内存中的主密钥对敏感数据密文进行解密处理,以得到敏感数据。由于用于生成主密钥的第一密钥分量是加密存储设备在每次上电时随机生成的,且因内存的断电自动销毁特性,内存中的主密钥也会在加密存储设备出现断电时被自动销毁。因此,主密钥具有较高的安全性,泄露风险较低,进而利用主密钥加密敏感数据,可以有效提升敏感数据的存储安全性。In an embodiment of the present application, the encryption storage device can generate a first key component when powered on, and generate a master key based on the first key component and the stored second key component, and then use the master key to encrypt the sensitive data of the encryption storage device to obtain the sensitive data ciphertext, and write the sensitive data ciphertext to the hardware storage unit of the encryption storage device. In this technical solution, the master key is stored in the memory of the encryption storage device. In response to the sensitive data read operation, the master key in the memory can be used to decrypt the sensitive data ciphertext to obtain the sensitive data. Since the first key component used to generate the master key is randomly generated by the encryption storage device each time it is powered on, and due to the power-off automatic destruction feature of the memory, the master key in the memory will also be automatically destroyed when the encryption storage device is powered off. Therefore, the master key has a higher security and a lower risk of leakage, and then using the master key to encrypt sensitive data can effectively improve the storage security of sensitive data.

并且,本申请实施例中采用三级密钥机制,将加密存储设备的密钥分为主密钥、密钥加密密钥和数据加密密钥三层,且每一层的密钥都有特定的用途和访问控制。这种分层方式提供了一种有效的安全机制,可以在提高加密存储设备的密钥的管理灵活性的同时,保持较高的设备访问安全性和访问控制能力,密钥分层加密方式确保了即使某个密钥泄露,也因无法获取更高层级的密钥,而无法获得所有数据的访问权限,有效保证加密存储设备的数据安全。进一步地,本申请实施例中可以采用SM3、SM4等国密算法对敏感数据、存储数据等重要数据进行加解密,以在进一步保障安全性的基础上也提高了加密性能。In addition, a three-level key mechanism is adopted in the embodiment of the present application, and the key of the encrypted storage device is divided into three layers: the master key, the key encryption key and the data encryption key, and the keys of each layer have specific uses and access controls. This layered method provides an effective security mechanism, which can improve the management flexibility of the keys of the encrypted storage device while maintaining a high level of device access security and access control capabilities. The key layered encryption method ensures that even if a key is leaked, it is impossible to obtain access rights to all data because it is impossible to obtain keys of a higher level, thereby effectively ensuring the data security of the encrypted storage device. Furthermore, in the embodiment of the present application, national secret algorithms such as SM3 and SM4 can be used to encrypt and decrypt important data such as sensitive data and stored data, so as to improve encryption performance while further ensuring security.

此外,在加密存储设备为SSD设备的情况下,敏感数据可以为TCG协议的SP表。本申请技术方案可以使用主密钥对SP表进行分段加密存储,按照密钥信息、用户身份和访问权限、锁定范围、管理接口等数据分段使用分组加密算法加密,并通过哈希算法计算每段信息散列值存储。这样、在可以有效防止未授权访问和数据泄露的前提下,既可以通过加密并行处理提升SSD设备的运算效率,又还可以在SSD设备出现异常时提升敏感数据的错误定位能力,从而提高敏感数据恢复速度。In addition, when the encrypted storage device is an SSD device, the sensitive data can be the SP table of the TCG protocol. The technical solution of the present application can use the master key to perform segmented encrypted storage of the SP table, and use the group encryption algorithm to encrypt the data segments according to the key information, user identity and access rights, lock range, management interface, etc., and calculate the hash value of each segment of information through the hash algorithm for storage. In this way, under the premise of effectively preventing unauthorized access and data leakage, the computing efficiency of the SSD device can be improved through encrypted parallel processing, and the error location capability of sensitive data can be improved when an abnormality occurs in the SSD device, thereby improving the recovery speed of sensitive data.

请参考图8,其示出了本申请实施例提供的一种数据处理装置的框图。一种数据处理装置应用于加密存储设备。如图8所示,数据处理装置800包括:生成模块801、获取模块802、加密模块803和解密模块804。Please refer to FIG8 , which shows a block diagram of a data processing device provided in an embodiment of the present application. A data processing device is applied to an encrypted storage device. As shown in FIG8 , the data processing device 800 includes: a generation module 801 , an acquisition module 802 , an encryption module 803 and a decryption module 804 .

生成模块801,用于在加密存储设备上电时,生成第一密钥分量;A generating module 801, configured to generate a first key component when the encryption storage device is powered on;

获取模块802,用于获取加密存储设备存储的第二密钥分量;An acquisition module 802 is used to acquire a second key component stored in an encryption storage device;

生成模块801,还用于根据第一密钥分量和第二密钥分量运算生成主密钥,向加密存储设备的内存写入主密钥;The generating module 801 is further used to generate a master key according to the first key component and the second key component, and write the master key into the memory of the encryption storage device;

加密模块803,用于采用主密钥对加密存储设备的敏感数据进行加密处理,得到敏感数据密文,向加密存储设备的硬件存储单元写入敏感数据密文;The encryption module 803 is used to encrypt the sensitive data of the encryption storage device using the master key to obtain the sensitive data ciphertext, and write the sensitive data ciphertext into the hardware storage unit of the encryption storage device;

解密模块804,用于响应于敏感数据读取操作,采用主密钥对敏感数据密文进行解密处理,得到敏感数据,向内存写入敏感数据。The decryption module 804 is used to respond to the sensitive data reading operation, use the master key to decrypt the sensitive data ciphertext, obtain the sensitive data, and write the sensitive data into the memory.

本申请实施例中,加密存储设备可以在上电时生成第一密钥分量,并根据第一密钥分量和存储的第二密钥分量生成主密钥,进而采用主密钥对加密存储设备的敏感数据进行加密处理,得到敏感数据密文,向加密存储设备的硬件存储单元写入敏感数据密文。该技术方案中,主密钥存储于加密存储设备的内存。响应于敏感数据读取操作,可以采用内存中的主密钥对敏感数据密文进行解密处理,以得到敏感数据。由于用于生成主密钥的第一密钥分量是加密存储设备在每次上电时随机生成的,且因内存的断电自动销毁特性,内存中的主密钥也会在加密存储设备出现断电时被自动销毁。因此,主密钥具有较高的安全性,泄露风险较低,进而利用主密钥加密敏感数据,可以有效提升敏感数据的存储安全性。In an embodiment of the present application, the encryption storage device can generate a first key component when powered on, and generate a master key based on the first key component and the stored second key component, and then use the master key to encrypt the sensitive data of the encryption storage device to obtain the sensitive data ciphertext, and write the sensitive data ciphertext to the hardware storage unit of the encryption storage device. In this technical solution, the master key is stored in the memory of the encryption storage device. In response to the sensitive data read operation, the master key in the memory can be used to decrypt the sensitive data ciphertext to obtain the sensitive data. Since the first key component used to generate the master key is randomly generated by the encryption storage device each time it is powered on, and due to the power-off automatic destruction feature of the memory, the master key in the memory will also be automatically destroyed when the encryption storage device is powered off. Therefore, the master key has a higher security and a lower risk of leakage, and then using the master key to encrypt sensitive data can effectively improve the storage security of sensitive data.

可选地,敏感数据密文包括:数据密钥密文和加密密钥密文;内存中敏感数据包括:数据密钥密文以及采用主密钥对加密密钥密文解密后的密钥加密密钥,密钥加密密钥是根据录入用户的用户凭证数据生成的;Optionally, the sensitive data ciphertext includes: data key ciphertext and encryption key ciphertext; the sensitive data in the memory includes: data key ciphertext and a key encryption key after decrypting the encryption key ciphertext using a master key, the key encryption key being generated based on user credential data of the input user;

获取模块802,还用于响应于第一用户触发的数据读写请求,获取数据读写请求包括的第一用户凭证数据;The acquisition module 802 is further configured to, in response to a data read/write request triggered by the first user, acquire first user credential data included in the data read/write request;

生成模块801,还用于对第一用户凭证数据进行密钥派生处理,得到第一用户的密钥加密密钥;The generating module 801 is further used to perform key derivation processing on the first user credential data to obtain a key encryption key of the first user;

解密模块804,还用于在录入用户的密钥加密密钥中,存在第一用户的密钥加密密钥的情况下,采用第一用户的密钥加密密钥对数据密钥密文进行解密处理,得到数据加密密钥,采用数据加密密钥执行数据读写请求指示的数据读取处理,数据加密密钥用于对加密存储设备的存储数据进行加密。The decryption module 804 is also used to, when there is a first user's key encryption key in the input user's key encryption key, use the first user's key encryption key to decrypt the data key ciphertext to obtain the data encryption key, and use the data encryption key to execute the data reading process indicated by the data read and write request. The data encryption key is used to encrypt the storage data of the encrypted storage device.

可选地,敏感数据包括多个数据密钥密文,每个数据密钥密文解密后的数据加密密钥用于:对硬件存储单元中不同的存储地址段的存储数据进行加密;解密模块804,还用于:Optionally, the sensitive data includes multiple data key ciphertexts, and the data encryption key after decryption of each data key ciphertext is used to: encrypt the storage data of different storage address segments in the hardware storage unit; the decryption module 804 is also used to:

获取第一用户可访问的第一地址段;Acquire a first address segment accessible to a first user;

在第一地址段包括数据读写请求指示访问的目标地址的情况下,读取目标地址所在的第一地址段的数据密钥密文;In the case where the first address segment includes a target address to be accessed as indicated by the data read/write request, reading the data key ciphertext of the first address segment where the target address is located;

采用第一用户的密钥加密密钥对数据密钥密文进行解密处理,得到第一地址段的数据加密密钥。The data key ciphertext is decrypted using the key encryption key of the first user to obtain the data encryption key of the first address segment.

可选地,敏感数据密文还包括权限控制数据密文,敏感数据还包括权限控制数据,权限控制数据至少指示录入用户可访问的存储地址段;解密模块804,还用于根据权限控制数据,确定第一用户可访问的第一地址段。Optionally, the sensitive data ciphertext also includes the permission control data ciphertext, and the sensitive data also includes the permission control data, and the permission control data at least indicates the storage address segment accessible to the input user; the decryption module 804 is also used to determine the first address segment accessible to the first user based on the permission control data.

可选地,权限控制数据包括:密钥加密密钥、数据密钥密文和存储地址段的对应关系,密钥加密密钥用于对对应的数据密钥密文加解密,数据密钥密文解密后的数据加密密钥用于对对应的存储地址段的存储数据加解密;解密模块804,还用于:Optionally, the permission control data includes: a correspondence between a key encryption key, a data key ciphertext, and a storage address segment, the key encryption key is used to encrypt and decrypt the corresponding data key ciphertext, and the data encryption key after decrypting the data key ciphertext is used to encrypt and decrypt the storage data of the corresponding storage address segment; the decryption module 804 is further used to:

根据密钥加密密钥、数据密钥密文和存储地址段的对应关系,确定与第一用户的密钥加密密钥对应的存储地址段,得到第一地址段;Determine the storage address segment corresponding to the key encryption key of the first user according to the correspondence between the key encryption key, the data key ciphertext and the storage address segment, and obtain the first address segment;

根据密钥加密密钥、数据密钥密文和存储地址段的对应关系,确定与第一用户的密钥加密密钥对应的数据密钥密文。According to the correspondence between the key encryption key, the data key ciphertext and the storage address segment, the data key ciphertext corresponding to the key encryption key of the first user is determined.

可选地,敏感数据密文还包括访问范围数据密文,敏感数据还包括访问范围数据,访问范围数据至少指示加密存储设备的硬件存储单元中存储地址段对应的访问用户;解密模块804,还用于根据访问范围数据,确定第一用户可访问的第一地址段。Optionally, the sensitive data ciphertext also includes access range data ciphertext, and the sensitive data also includes access range data, and the access range data at least indicates the access user corresponding to the storage address segment in the hardware storage unit of the encrypted storage device; the decryption module 804 is also used to determine the first address segment accessible to the first user based on the access range data.

可选地,访问范围数据包括:密钥加密密钥、数据密钥密文和存储地址段的对应关系,密钥加密密钥用于对对应的数据密钥密文加解密,数据密钥密文解密后的数据加密密钥用于对对应的存储地址段的存储数据加解密;解密模块804,还用于:Optionally, the access range data includes: a correspondence between a key encryption key, a data key ciphertext, and a storage address segment, the key encryption key is used to encrypt and decrypt the corresponding data key ciphertext, and the data encryption key after decrypting the data key ciphertext is used to encrypt and decrypt the storage data of the corresponding storage address segment; the decryption module 804 is further used to:

根据密钥加密密钥、数据密钥密文和存储地址段的对应关系,确定与第一用户的密钥加密密钥对应的存储地址段,得到第一地址段;Determine the storage address segment corresponding to the key encryption key of the first user according to the correspondence between the key encryption key, the data key ciphertext and the storage address segment, and obtain the first address segment;

根据密钥加密密钥、数据密钥密文和存储地址段的对应关系,确定与第一用户的密钥加密密钥对应的数据密钥密文。According to the correspondence between the key encryption key, the data key ciphertext and the storage address segment, the data key ciphertext corresponding to the key encryption key of the first user is determined.

可选地,敏感数据密文包括:多个数据密文段,每个数据密文段包括敏感子数据密文和敏感子数据密文解密后的数据的目标散列值;敏感数据包括:与多个数据密文段一一对应的数据段,每个数据段包括敏感子数据密文对应的敏感子数据;获取模块802,还用于响应于错误数据定位操作,获取内存的敏感数据;Optionally, the sensitive data ciphertext includes: a plurality of data ciphertext segments, each data ciphertext segment includes a sensitive sub-data ciphertext and a target hash value of the data after the sensitive sub-data ciphertext is decrypted; the sensitive data includes: data segments corresponding to the plurality of data ciphertext segments one by one, each data segment includes sensitive sub-data corresponding to the sensitive sub-data ciphertext; the acquisition module 802 is further used to acquire the sensitive data in the memory in response to the error data locating operation;

数据处理装置800还包括:计算模块,用于针对每个数据段,根据数据段中的敏感子数据,计算对应的敏感子数据密文对应的散列值,得到当前散列值;The data processing device 800 further includes: a calculation module, configured to calculate, for each data segment, a hash value corresponding to the ciphertext of the corresponding sensitive sub-data according to the sensitive sub-data in the data segment, to obtain a current hash value;

比较模块,用于对目标散列值和当前散列值进行比较,确定比较结果指示不相等的当前散列值对应的敏感子数据有误。The comparison module is used to compare the target hash value and the current hash value, and determine that the sensitive sub-data corresponding to the unequal current hash value indicated by the comparison result is incorrect.

可选地,敏感数据密文包括:密钥管理数据段、权限控制数据段和访问范围数据段,密钥管理数据段包括:数据密钥密文、加密密钥密文以及第一散列值,第一散列值为数据加密密钥和密钥加密密钥的散列值;权限控制数据段包括:权限控制数据密文以及第二散列值,第二散列值为权限控制数据的散列值;访问范围数据段包括:访问范围数据密文和第三散列值,第三散列值为访问范围数据的散列值;Optionally, the sensitive data ciphertext includes: a key management data segment, an authority control data segment and an access range data segment, the key management data segment includes: a data key ciphertext, an encryption key ciphertext and a first hash value, the first hash value being a hash value of a data encryption key and a key encryption key; the authority control data segment includes: an authority control data ciphertext and a second hash value, the second hash value being a hash value of the authority control data; the access range data segment includes: an access range data ciphertext and a third hash value, the third hash value being a hash value of the access range data;

计算模块,还用于采用密钥加密密钥对敏感数据中的数据密钥密文进行解密处理,得到数据加密密钥;计算敏感数据中数据加密密钥和密钥加密密钥的散列值,得到第四散列值;计算敏感数据中权限控制数据的散列值,得到第五散列值;计算敏感数据中访问范围数据的散列值,得到第六散列值;The calculation module is further used to use the key encryption key to decrypt the data key ciphertext in the sensitive data to obtain the data encryption key; calculate the hash value of the data encryption key and the key encryption key in the sensitive data to obtain a fourth hash value; calculate the hash value of the permission control data in the sensitive data to obtain a fifth hash value; calculate the hash value of the access range data in the sensitive data to obtain a sixth hash value;

比较模块,还用于对第一散列值和第四散列值,第二散列值和第五散列值,第三散列值和第六散列值进行比较,确定敏感数据中,比较结果指示不相等的散列值对应的数据有误。The comparison module is also used to compare the first hash value and the fourth hash value, the second hash value and the fifth hash value, and the third hash value and the sixth hash value to determine that the data corresponding to the unequal hash values indicated by the comparison result in the sensitive data is incorrect.

可选地,获取模块802,还用于获取第二用户的用户凭证数据和权限控制信息,权限控制信息指示第二用户可访问的第二地址段;Optionally, the acquisition module 802 is further configured to acquire user credential data and permission control information of the second user, where the permission control information indicates a second address segment accessible to the second user;

生成模块801,还用于对第二用户的用户凭证数据进行密钥派生处理,得到第二用户的密钥加密密钥;The generating module 801 is further used to perform key derivation processing on the user credential data of the second user to obtain a key encryption key of the second user;

获取模块802,还用于获取第二地址段对应的数据加密密钥;The acquisition module 802 is further used to acquire the data encryption key corresponding to the second address segment;

加密模块803,还用于采用第二用户的密钥加密密钥,对第二地址段的数据加密密钥进行加密处理,得到第二地址段对应的数据密钥密文;The encryption module 803 is further used to encrypt the data encryption key of the second address segment using the key encryption key of the second user to obtain the data key ciphertext corresponding to the second address segment;

生成模块801,还用于生成权限控制数据。The generating module 801 is also used to generate authority control data.

可选地,生成模块801,还用于Optionally, the generating module 801 is further used to

根据第二用户的密钥加密密钥、第二地址段,以及第二地址段的数据密钥密文,生成权限控制数据,权限控制数据包括:密钥加密密钥、数据密钥密文和第二地址段的对应关系。According to the key encryption key of the second user, the second address segment, and the data key ciphertext of the second address segment, permission control data is generated, and the permission control data includes: a corresponding relationship between the key encryption key, the data key ciphertext and the second address segment.

可选地,获取模块802,还用于响应于管理用户的权限录入操作,获取管理用户录入的第二用户的用户凭证数据和权限控制信息。Optionally, the acquisition module 802 is further configured to acquire user credential data and permission control information of the second user entered by the management user in response to the management user's permission entry operation.

可选地,获取模块802,还用于获取加密存储设备的硬件存储单元的访问范围信息,访问范围信息指示硬件存储单元的分段访问情况;Optionally, the acquisition module 802 is further used to acquire access range information of a hardware storage unit of the encryption storage device, where the access range information indicates a segmented access condition of the hardware storage unit;

数据处理装置800还包括:确定模块,用于根据访问范围信息,确定硬件存储单元的多个存储地址段;The data processing device 800 further includes: a determination module, configured to determine a plurality of storage address segments of the hardware storage unit according to the access range information;

生成模块801,还用于生成每个存储地址段不同的数据加密密钥;The generating module 801 is further used to generate a different data encryption key for each storage address segment;

加密模块803,还用于针对每个存储地址段,采用对应的数据加密密钥对存储地址段的存储数据进行加密处理,生成存储数据密文,向存储地址段对应的硬件存储空间写入存储数据密文。The encryption module 803 is also used to encrypt the storage data of each storage address segment using the corresponding data encryption key, generate storage data ciphertext, and write the storage data ciphertext into the hardware storage space corresponding to the storage address segment.

可选地,访问范围信息还指示每个存储地址段的访问用户类别;获取模块802,还用于针对每个存储地址段,获取存储地址段的访问用户类别的每个目标录入用户的密钥加密密钥;Optionally, the access range information further indicates the access user category of each storage address segment; the acquisition module 802 is further used to acquire, for each storage address segment, the key encryption key of each target entry user of the access user category of the storage address segment;

加密模块803,还用于采用每个目标录入用户的密钥加密密钥,分别对存储地址段对应的数据加密密钥进行加密处理,得到存储地址段对应的数据密钥密文;The encryption module 803 is further used to use the key encryption key of each target input user to encrypt the data encryption key corresponding to the storage address segment to obtain the data key ciphertext corresponding to the storage address segment;

生成模块801,还用于根据存储地址段,对应的数据密钥密文以及目标录入用户的密钥加密密钥,生成访问范围数据。The generating module 801 is further used to generate access range data according to the storage address segment, the corresponding data key ciphertext and the key encryption key of the target entry user.

可选地,获取模块802,还用于响应于管理用户的访问范围录入操作,获取管理用户录入的硬件存储单元的访问范围信息。Optionally, the acquisition module 802 is further configured to, in response to an access range entry operation of the management user, acquire access range information of the hardware storage unit entered by the management user.

可选地,访问范围数据密文是采用分组加密算法,利用主密钥对访问范围数据进行加密后的数据;权限控制数据密文是采用分组加密算法,利用主密钥对权限控制数据进行加密后的数据;数据密钥密文是采用分组加密算法,利用密钥加密密钥对数据加密密钥进行加密后的数据;加密密钥密文是采用分组加密算法,利用主密钥对密钥加密密钥进行加密后的数据;敏感子数据密文对应的散列值是采用哈希算法,根据敏感数据中对应的敏感子数据计算得到的数据。Optionally, the access range data ciphertext is data obtained by encrypting the access range data using a block encryption algorithm and a master key; the permission control data ciphertext is data obtained by encrypting the permission control data using a block encryption algorithm and a master key; the data key ciphertext is data obtained by encrypting the data encryption key using a block encryption algorithm and a key encryption key; the encryption key ciphertext is data obtained by encrypting the key encryption key using a block encryption algorithm and a master key; the hash value corresponding to the sensitive sub-data ciphertext is data calculated using a hash algorithm based on the corresponding sensitive sub-data in the sensitive data.

可选地,加密存储设备包括:数据加解密模块,数据加解密模块包括第一运算单元和第二运算单元;Optionally, the encryption storage device includes: a data encryption and decryption module, the data encryption and decryption module includes a first operation unit and a second operation unit;

第一运算单元用于执行分组加密算法,第二运算单元用于执行哈希算法;访问范围数据密文、权限控制数据密文、数据密钥密文、加密密钥密文均是通过调用第一运算单元得到的数据;敏感子数据密文对应的散列值是通过调用第二运算单元得到的数据。The first operation unit is used to execute the block encryption algorithm, and the second operation unit is used to execute the hash algorithm; the access range data ciphertext, the authority control data ciphertext, the data key ciphertext, and the encryption key ciphertext are all data obtained by calling the first operation unit; the hash value corresponding to the sensitive sub-data ciphertext is data obtained by calling the second operation unit.

可选地,加密存储设备包括:第一硬件单元和第二硬件单元,第二密钥分量存储于第一硬件单元;加密模块803,用于采用第二密钥分量对第一密钥分量进行加密处理,得到第一密钥分量密文,向第二硬件单元存储第一密钥分量密文。Optionally, the encryption storage device includes: a first hardware unit and a second hardware unit, the second key component is stored in the first hardware unit; an encryption module 803, used to use the second key component to encrypt the first key component to obtain the first key component ciphertext, and store the first key component ciphertext in the second hardware unit.

可选地,用户凭证数据包括以下至少一项:用户账号的密码、用户的个人识别码PIN、用户录入的生物识别信息。Optionally, the user credential data includes at least one of the following: a password for a user account, a personal identification number PIN of the user, and biometric information entered by the user.

本申请实施例中,加密存储设备可以在上电时生成第一密钥分量,并根据第一密钥分量和存储的第二密钥分量生成主密钥,进而采用主密钥对加密存储设备的敏感数据进行加密处理,得到敏感数据密文,向加密存储设备的硬件存储单元写入敏感数据密文。该技术方案中,主密钥存储于加密存储设备的内存。响应于敏感数据读取操作,可以采用内存中的主密钥对敏感数据密文进行解密处理,以得到敏感数据。由于用于生成主密钥的第一密钥分量是加密存储设备在每次上电时随机生成的,且因内存的断电自动销毁特性,内存中的主密钥也会在加密存储设备出现断电时被自动销毁。因此,主密钥具有较高的安全性,泄露风险较低,进而利用主密钥加密敏感数据,可以有效提升敏感数据的存储安全性。In an embodiment of the present application, the encryption storage device can generate a first key component when powered on, and generate a master key based on the first key component and the stored second key component, and then use the master key to encrypt the sensitive data of the encryption storage device to obtain the sensitive data ciphertext, and write the sensitive data ciphertext to the hardware storage unit of the encryption storage device. In this technical solution, the master key is stored in the memory of the encryption storage device. In response to the sensitive data read operation, the master key in the memory can be used to decrypt the sensitive data ciphertext to obtain the sensitive data. Since the first key component used to generate the master key is randomly generated by the encryption storage device each time it is powered on, and due to the power-off automatic destruction feature of the memory, the master key in the memory will also be automatically destroyed when the encryption storage device is powered off. Therefore, the master key has a higher security and a lower risk of leakage, and then using the master key to encrypt sensitive data can effectively improve the storage security of sensitive data.

可选的,如图9所示,本申请实施例还提供一种电子设备,该电子设备900包括:处理器901,存储器902,以及存储在存储器902上并可在处理器901上运行的程序或指令。该程序或指令被处理器901执行时实现上述数据处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in FIG9 , an embodiment of the present application further provides an electronic device, the electronic device 900 comprising: a processor 901, a memory 902, and a program or instruction stored in the memory 902 and executable on the processor 901. When the program or instruction is executed by the processor 901, each process of the above-mentioned data processing method embodiment is implemented, and the same technical effect can be achieved, and to avoid repetition, it will not be described here.

需要说明的是,本申请实施例中的电子设备900内各个部件的功能,可以参考前述实施例提供的电子设备100内各对应部分的功能,在此不做赘述。It should be noted that the functions of the various components within the electronic device 900 in the embodiment of the present application can refer to the functions of the corresponding parts within the electronic device 100 provided in the aforementioned embodiment, and will not be described in detail here.

本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述数据处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned data processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory, ROM)、随机存取存储器(Random Access Memory, RAM)、磁碟或者光盘等。The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述数据处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。The embodiment of the present application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, the processor is used to run a program or instruction, implement the various processes of the above data processing method embodiment, and can achieve the same technical effect, to avoid repetition, it is not repeated here. It should be understood that the chip mentioned in the embodiment of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims (22)

1. A data processing method, characterized by being applied to an encrypted storage device; the method comprises the following steps:
generating a first key component when the encrypted storage device is powered up;
Acquiring a second key component stored by the encryption storage device;
Generating a master key according to the first key component and the second key component, and writing the master key into the memory of the encryption storage device;
encrypting the sensitive data of the encryption storage equipment by adopting the master key to obtain a sensitive data ciphertext, and writing the sensitive data ciphertext into a hardware storage unit of the encryption storage equipment;
and responding to the sensitive data reading operation, adopting the master key to decrypt the sensitive data ciphertext to obtain the sensitive data, and writing the sensitive data into the memory.
2. The method of claim 1, wherein the sensitive data ciphertext comprises: a data key ciphertext and an encryption key ciphertext; the sensitive data in the memory comprises: the data key ciphertext and the key encryption key which is obtained by decrypting the encryption key ciphertext by adopting the master key are generated according to user credential data of an input user; the method further comprises the steps of:
responding to a data read-write request triggered by a first user, and acquiring first user credential data included in the data read-write request;
Performing key derivation processing on the first user credential data to obtain a key encryption key of the first user;
And under the condition that the key encryption key of the first user exists in the key encryption keys of the input users, decrypting the data key ciphertext by adopting the key encryption key of the first user to obtain a data encryption key, and executing the data reading process indicated by the data reading and writing request by adopting the data encryption key, wherein the data encryption key is used for encrypting the stored data of the encryption storage device.
3. The method of claim 2, wherein the sensitive data comprises a plurality of the data key ciphertexts, each of the data key ciphertexts decrypted data encryption key for: encrypting the storage data of different storage address segments in the hardware storage unit; the method further comprises the steps of:
The step of decrypting the data key ciphertext by using the key encryption key of the first user to obtain the data encryption key comprises the following steps:
acquiring a first address field accessible to the first user;
Reading a data key ciphertext of a first address field where the target address is located under the condition that the first address field comprises the target address where the data read-write request indicates access;
And decrypting the data key ciphertext by adopting the key encryption key of the first user to obtain the data encryption key of the first address segment.
4. A method according to claim 3, wherein the sensitive data ciphertext further comprises entitlement control data ciphertext, the sensitive data further comprising entitlement control data indicative of at least a segment of a memory address accessible to the entering user;
The obtaining a first address field accessible to the first user includes: and determining a first address segment accessible to the first user according to the authority control data.
5. The method of claim 4, wherein the entitlement control data comprises: the corresponding relation among the key encryption key, the data key ciphertext and the storage address segment is that the key encryption key is used for encrypting and decrypting the corresponding data key ciphertext, and the data encryption key after the data key ciphertext is decrypted is used for encrypting and decrypting the storage data of the corresponding storage address segment; the determining, according to the permission control data, a first address field accessible to the first user includes:
Determining a storage address segment corresponding to the key encryption key of the first user according to the corresponding relation among the key encryption key, the data key ciphertext and the storage address segment, and obtaining a first address segment;
The reading the data key ciphertext of the first address field where the target address is located comprises the following steps: and determining the data key ciphertext corresponding to the key encryption key of the first user according to the corresponding relation among the key encryption key, the data key ciphertext and the storage address segment.
6. The method of claim 3, wherein the sensitive data ciphertext further comprises access range data ciphertext, the sensitive data further comprising access range data, the access range data indicating at least an access user corresponding to a storage address field in a hardware storage unit of the encrypted storage device;
the obtaining a first address field accessible to the first user includes: and determining a first address segment accessible to the first user according to the access range data.
7. The method of claim 6, wherein the access range data comprises: the corresponding relation among the key encryption key, the data key ciphertext and the storage address segment is that the key encryption key is used for encrypting and decrypting the corresponding data key ciphertext, and the data encryption key after the data key ciphertext is decrypted is used for encrypting and decrypting the storage data of the corresponding storage address segment; the determining, according to the access range data, a first address segment accessible to the first user includes:
Determining a storage address segment corresponding to the key encryption key of the first user according to the corresponding relation among the key encryption key, the data key ciphertext and the storage address segment, and obtaining a first address segment;
The reading the data key ciphertext of the first address field where the target address is located comprises the following steps: and determining the data key ciphertext corresponding to the key encryption key of the first user according to the corresponding relation among the key encryption key, the data key ciphertext and the storage address segment.
8. The method of claim 1, wherein the sensitive data ciphertext comprises: the data ciphertext comprises a sensitive sub-data ciphertext and a target hash value of data decrypted by the sensitive sub-data ciphertext;
The sensitive data includes: the data segments are in one-to-one correspondence with the data ciphertext segments, and each data segment comprises sensitive sub-data corresponding to the sensitive sub-data ciphertext;
the method further comprises the steps of:
Responding to the error data positioning operation, and acquiring sensitive data of the memory;
For each data segment, calculating a hash value corresponding to the corresponding sensitive sub-data ciphertext according to the sensitive sub-data in the data segment to obtain a current hash value;
And comparing the target hash value with the current hash value, and determining that the comparison result indicates that the sensitive sub-data corresponding to the current hash value which is not equal is wrong.
9. The method of claim 8, wherein the sensitive data ciphertext comprises: a key management data segment, a rights control data segment, and an access range data segment, the key management data segment comprising: a data key ciphertext, an encryption key ciphertext, and a first hash value that is a hash value of a data encryption key and a key encryption key; the entitlement control data section includes: the authorization control data ciphertext and a second hash value, wherein the second hash value is the hash value of the authorization control data; the access range data segment includes: the method comprises the steps of accessing range data ciphertext and a third hash value, wherein the third hash value is a hash value of the access range data;
Calculating, for each data segment, a hash value corresponding to the corresponding ciphertext of the sensitive sub-data according to the sensitive sub-data in the data segment, to obtain a current hash value, comparing the target hash value with the current hash value, and determining that the comparison result indicates that the sensitive sub-data corresponding to the current hash value is incorrect, where the comparison result indicates that the sensitive sub-data corresponding to the current hash value is not equal, including:
Decrypting the data key ciphertext in the sensitive data by adopting the key encryption key to obtain a data encryption key;
calculating hash values of the data encryption key and the key encryption key in the sensitive data to obtain a fourth hash value;
Calculating a hash value of the authority control data in the sensitive data to obtain a fifth hash value;
Calculating a hash value of the access range data in the sensitive data to obtain a sixth hash value;
Comparing the first hash value with the fourth hash value, the second hash value with the fifth hash value, and the third hash value with the sixth hash value to determine that data corresponding to unequal hash values are wrong in the sensitive data.
10. The method according to claim 4, wherein the method further comprises:
Acquiring user credential data and authority control information of a second user, wherein the authority control information indicates a second address field accessible to the second user;
performing key derivation processing on the user credential data of the second user to obtain a key encryption key of the second user;
acquiring a data encryption key corresponding to the second address segment;
Encrypting the data encryption key of the second address segment by adopting the key encryption key of the second user to obtain a data key ciphertext corresponding to the second address segment;
And generating the authority control data.
11. The method of claim 10, wherein the generating the entitlement control data comprises:
Generating the authority control data according to the key encryption key of the second user, the second address segment and the data key ciphertext of the second address segment, wherein the authority control data comprises: and the corresponding relation among the key encryption key, the data key ciphertext and the second address segment.
12. The method of claim 10, wherein the obtaining user credential data and rights control information for the second user comprises:
and responding to the authority input operation of the management user, and acquiring user credential data and authority control information of a second user input by the management user.
13. A method according to claim 3, characterized in that the method further comprises:
Acquiring access range information of a hardware storage unit of the encryption storage device, wherein the access range information indicates a segmented access condition of the hardware storage unit;
determining a plurality of storage address segments of the hardware storage unit according to the access range information;
generating a different data encryption key for each storage address segment;
And for each storage address segment, encrypting the storage data of the storage address segment by adopting the corresponding data encryption key to generate a storage data ciphertext, and writing the storage data ciphertext into a hardware storage space corresponding to the storage address segment.
14. The method of claim 13, wherein the access scope information further indicates an access user category for each of the storage address segments; the method further comprises the steps of:
Acquiring a key encryption key of each target entry user of the access user category of the storage address segment for each storage address segment;
encrypting the data encryption key corresponding to the storage address segment by adopting the key encryption key of each target entry user to obtain a data key ciphertext corresponding to the storage address segment;
And generating access range data according to the storage address segment, the corresponding data key ciphertext and the key encryption key of the target input user.
15. The method of claim 13, wherein the obtaining access range information of the hardware storage unit of the encrypted storage device comprises:
And responding to access range input operation of a management user, and acquiring access range information of a hardware storage unit input by the management user.
16. The method of claim 9, wherein the access range data ciphertext is encrypted data of the access range data using the master key using a block encryption algorithm; the right control data ciphertext is data obtained by encrypting the right control data by using a block encryption algorithm and the master key; the data key ciphertext is data obtained by encrypting the data encryption key by adopting a block encryption algorithm and utilizing the key encryption key; the encryption key ciphertext is data obtained by encrypting the key encryption key by using a block encryption algorithm and the master key; the hash value corresponding to the sensitive sub-data ciphertext is data obtained by calculating according to the sensitive sub-data corresponding to the sensitive data by adopting a hash algorithm.
17. The method of claim 16, wherein the encrypted storage device comprises: the data encryption and decryption module comprises a first operation unit and a second operation unit;
The first operation unit is used for executing the block encryption algorithm, and the second operation unit is used for executing the hash algorithm; the access range data ciphertext, the authority control data ciphertext, the data key ciphertext and the encryption key ciphertext are all data obtained by calling the first operation unit; the hash value corresponding to the sensitive sub-data ciphertext is data obtained by calling the second operation unit.
18. The method of claim 1, wherein the encrypted storage device comprises: the first hardware unit and the second hardware unit, the second key component is stored in the first hardware unit; the method further comprises the steps of:
And encrypting the first key component by adopting the second key component to obtain a first key component ciphertext, and storing the first key component ciphertext into the second hardware unit.
19. The method of claim 2, wherein the user credential data comprises at least one of: the password of the user account, the personal identification number PIN of the user and the biological identification information input by the user.
20. An electronic device comprising a processor and a memory, the memory having instructions stored thereon, which when executed by the processor, implement the method of any of claims 1 to 19.
21. A readable storage medium having stored thereon a program or instructions which when executed by a processor performs the method of any of claims 1 to 19.
22. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the method of any of claims 1 to 19.
CN202411273363.2A 2024-09-12 2024-09-12 Data processing method, electronic device, storage medium and computer program product Active CN118821243B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411273363.2A CN118821243B (en) 2024-09-12 2024-09-12 Data processing method, electronic device, storage medium and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411273363.2A CN118821243B (en) 2024-09-12 2024-09-12 Data processing method, electronic device, storage medium and computer program product

Publications (2)

Publication Number Publication Date
CN118821243A true CN118821243A (en) 2024-10-22
CN118821243B CN118821243B (en) 2025-03-21

Family

ID=93068630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411273363.2A Active CN118821243B (en) 2024-09-12 2024-09-12 Data processing method, electronic device, storage medium and computer program product

Country Status (1)

Country Link
CN (1) CN118821243B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119397583A (en) * 2024-12-30 2025-02-07 苏州元脑智能科技有限公司 A data processing method, system, computer program product, device and medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6581162B1 (en) * 1996-12-31 2003-06-17 Compaq Information Technologies Group, L.P. Method for securely creating, storing and using encryption keys in a computer system
US6745331B1 (en) * 1998-07-10 2004-06-01 Silverbrook Research Pty Ltd Authentication chip with protection from power supply attacks
WO2020051910A1 (en) * 2018-09-14 2020-03-19 Cobo Global Limited Secure hardware cryptographic key storage device with detachable battery and anti-tamper security functionality
CN110971398A (en) * 2018-09-28 2020-04-07 阿里巴巴集团控股有限公司 Data processing method, device and system
CN111079128A (en) * 2019-12-11 2020-04-28 腾讯科技(深圳)有限公司 Data processing method and device, electronic equipment and storage medium
CN112655010A (en) * 2018-10-02 2021-04-13 第一资本服务有限责任公司 System and method for password authentication of contactless cards
CN114244508A (en) * 2021-12-15 2022-03-25 平安科技(深圳)有限公司 Data encryption method, device, equipment and storage medium
WO2022259015A1 (en) * 2021-06-07 2022-12-15 Telefonaktiebolaget Lm Ericsson (Publ) Storage device utilziing physically unclonable function (puf) based secret sharing scheme for data encryption/decryption
CN115544587A (en) * 2022-12-02 2022-12-30 奉加微电子(昆山)有限公司 Encryption method, decryption method, chip, and computer-readable storage medium
CN116233158A (en) * 2023-02-09 2023-06-06 北京五八信息技术有限公司 A data storage method, device, equipment and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6581162B1 (en) * 1996-12-31 2003-06-17 Compaq Information Technologies Group, L.P. Method for securely creating, storing and using encryption keys in a computer system
US6745331B1 (en) * 1998-07-10 2004-06-01 Silverbrook Research Pty Ltd Authentication chip with protection from power supply attacks
WO2020051910A1 (en) * 2018-09-14 2020-03-19 Cobo Global Limited Secure hardware cryptographic key storage device with detachable battery and anti-tamper security functionality
CN110971398A (en) * 2018-09-28 2020-04-07 阿里巴巴集团控股有限公司 Data processing method, device and system
CN112655010A (en) * 2018-10-02 2021-04-13 第一资本服务有限责任公司 System and method for password authentication of contactless cards
CN111079128A (en) * 2019-12-11 2020-04-28 腾讯科技(深圳)有限公司 Data processing method and device, electronic equipment and storage medium
WO2022259015A1 (en) * 2021-06-07 2022-12-15 Telefonaktiebolaget Lm Ericsson (Publ) Storage device utilziing physically unclonable function (puf) based secret sharing scheme for data encryption/decryption
CN114244508A (en) * 2021-12-15 2022-03-25 平安科技(深圳)有限公司 Data encryption method, device, equipment and storage medium
CN115544587A (en) * 2022-12-02 2022-12-30 奉加微电子(昆山)有限公司 Encryption method, decryption method, chip, and computer-readable storage medium
CN116233158A (en) * 2023-02-09 2023-06-06 北京五八信息技术有限公司 A data storage method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
冉娟;李晓宇;: "基于秘密共享协议的移动数据存储研究", 计算机科学, no. 04, 15 April 2016 (2016-04-15) *
胡俭勇;苏锦海;: "基于FPGA的USB密钥载体的设计与实现", 电子技术, no. 3, 20 December 2007 (2007-12-20) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119397583A (en) * 2024-12-30 2025-02-07 苏州元脑智能科技有限公司 A data processing method, system, computer program product, device and medium

Also Published As

Publication number Publication date
CN118821243B (en) 2025-03-21

Similar Documents

Publication Publication Date Title
US10915633B2 (en) Method and apparatus for device security verification utilizing a virtual trusted computing base
US20190158277A1 (en) Technologies for secure key provisioning with a manageability engine
EP2583410B1 (en) Single-use authentication methods for accessing encrypted data
US9424430B2 (en) Method and system for defending security application in a user's computer
JP4912879B2 (en) Security protection method for access to protected resources of processor
US8103883B2 (en) Method and apparatus for enforcing use of danbury key management services for software applied full volume encryption
JP6275653B2 (en) Data protection method and system
US20080181406A1 (en) System and Method of Storage Device Data Encryption and Data Access Via a Hardware Key
US20110016330A1 (en) Information leak prevention device, and method and program thereof
US20040117625A1 (en) Attestation using both fixed token and portable token
US8296841B2 (en) Trusted platform module supported one time passwords
US20040117318A1 (en) Portable token controlling trusted environment launch
US20080040613A1 (en) Apparatus, system, and method for secure password reset
US11735319B2 (en) Method and system for processing medical data
CN100547598C (en) Saving and retrieving data based on symmetric key encryption
SG185640A1 (en) Method and system of secure computing environment having auditable control of data movement
CN118821243B (en) Data processing method, electronic device, storage medium and computer program product
WO2022052665A1 (en) Wireless terminal and interface access authentication method for wireless terminal in uboot mode
CN114520735B (en) User identity authentication method, system and medium based on trusted execution environment
CN118821104A (en) Data authorization management method and related equipment applied to trusted data space
CN116305330B (en) Safety management method for CPU hardware
CN108345804B (en) Storage method and device in trusted computing environment
CN114840863B (en) Secure storage method and system based on trusted embedded device and FTP
CN114091027B (en) Information configuration method, data access method, related device and equipment
US9177160B1 (en) Key management in full disk and file-level encryption

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
GR01 Patent grant
GR01 Patent grant