WO2020134637A1 - 一种密钥组分验证方法、装置及终端设备 - Google Patents

一种密钥组分验证方法、装置及终端设备 Download PDF

Info

Publication number
WO2020134637A1
WO2020134637A1 PCT/CN2019/116301 CN2019116301W WO2020134637A1 WO 2020134637 A1 WO2020134637 A1 WO 2020134637A1 CN 2019116301 W CN2019116301 W CN 2019116301W WO 2020134637 A1 WO2020134637 A1 WO 2020134637A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
record
component
verification
hash value
Prior art date
Application number
PCT/CN2019/116301
Other languages
English (en)
French (fr)
Inventor
董时舫
Original Assignee
百富计算机技术(深圳)有限公司
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 百富计算机技术(深圳)有限公司 filed Critical 百富计算机技术(深圳)有限公司
Publication of WO2020134637A1 publication Critical patent/WO2020134637A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators

Definitions

  • the present application belongs to the technical field of data processing, and particularly relates to a key component verification method, device and terminal equipment.
  • the key is gradually used to encrypt various files that need to be encrypted.
  • other keys can be generated through the system seed key divergence, so that each terminal device in the system can not only meet the requirements of key uniqueness, but also save key storage space.
  • the key management host system in the security room may be damaged by external factors such as unexpected failures or power outages and natural disasters, resulting in damage to the system seed key. Therefore, the system seed key must be backed up. During the system recovery process, the system seed key can be recovered from the backup media.
  • the key component is a common key backup method.
  • a key can contain two or more key components. Each key component can have the same length or different key components.
  • the agreed synthesis formula generates the key, so during the backup process, the key components can be handed over to different full-time personnel for management. When the key needs to be restored, each key component is obtained and restored according to the agreed synthesis formula Key.
  • the key components are theoretically wrong (for example, the data of individual key components are miscoded), misused (for example, component mismatch, version mismatch, expired validity, etc.), forged, maliciously tampered with, or The possibility of secret replacement is required to verify the key components in order to ensure that the restored key is correct.
  • the conventional key component verification algorithm is to use the verification key to calculate a series of verification codes for the verified key component.
  • this verification method has poor versatility.
  • the verified key component is the system seed secret
  • it is difficult to create another verification key for verification calculation.
  • the existing key component verification algorithm has poor versatility, and it cannot guarantee that the system seed key can realize safe backup storage and accurate recovery.
  • the embodiments of the present application provide a key component verification method, device, and terminal device to solve the poor commonality of existing key component verification algorithms, which cannot guarantee the safe backup storage and accuracy of the system seed key The problem of recovery.
  • a first aspect of an embodiment of the present application provides a key component verification method, including:
  • the first key component record passes verification.
  • a second aspect of an embodiment of the present application provides a key component verification device, including:
  • a component recording module configured to receive a component reading instruction, and read a first key component record according to the component reading instruction, wherein the key component record includes the key component and component accessory information;
  • a first verification module configured to perform hash calculation on the first key component record, and determine whether the calculated first hash value is consistent with the second hash value in the key verification record;
  • the component passing module is used for verifying that the first key component record passes when the first hash value is consistent with the second hash value.
  • a third aspect of the embodiments of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the computer program Implement the steps of the above method.
  • a fourth aspect of the embodiments of the present application provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the steps of the foregoing method are implemented.
  • a hash calculation is performed on the first key component record to determine whether the first hash value obtained by the hash calculation is consistent with the second hash value in the key verification record, In the hash calculation, even if the calculated value changes slightly, the result of the hash calculation will be greatly deviated. Therefore, when the first hash value is consistent with the second hash value, you can determine the first A key component record is a reliable record. The first key component record is verified. In the key component record verification, no additional verification key needs to be generated, and the key component of any key can be verified , High versatility, solves the problem that the existing key component verification algorithm is poor in versatility, and cannot guarantee the safe backup storage and accurate recovery of the system seed key.
  • FIG. 1 is a schematic flowchart of an implementation method of a key component verification method provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of a key component verification device provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a terminal device provided by an embodiment of the present application.
  • the term “if” may be interpreted as “when” or “once” or “in response to determination” or “in response to detection” depending on the context .
  • the phrase “if determined” or “if [described condition or event] is detected” may be interpreted in the context to mean “once determined” or “in response to a determination” or “once detected [described condition or event ]” or “In response to detection of [the described condition or event]”.
  • the key component verification method in Embodiment 1 of the present application includes:
  • Step S101 Receive a component reading instruction, and read a first key component record according to the component reading instruction, where the key component record includes the key component and component accessory information;
  • the key component of the key to be restored can be read from the secure storage medium according to the component reading instruction, and synthesized according to the key component of the key to be restored with a preset synthesis formula, The original text of the key to be restored can be obtained.
  • the possibility of error, misuse, forgery, tampering and replacement of the key component during storage in order to ensure the reliability of the original text of the restored key, it is necessary to record the key component of the restored key verification.
  • the first key component record may be read according to the component read instruction first, and the key component record includes the key component and the component auxiliary information, wherein the component auxiliary information may be performed according to actual needs Set, the component auxiliary information can be set to empty, that is, the key component record contains only the key component, and the component auxiliary information can not be empty.
  • the component auxiliary information may include the key version number, key generation time, key validity period, key name, key text synthesis formula, component number, component length, and filled random number.
  • Step S102 Perform hash calculation on the first key component record to determine whether the calculated first hash value is consistent with the second hash value in the key verification record;
  • the content recorded in the key verification record can be set according to actual needs, for example, the key verification record can include the key version number, key generation time, key validity period, key name, key text synthesis formula, and each key The component length corresponding to the component record, the second hash value corresponding to each key component record, and the fourth hash value corresponding to the original text record of the key.
  • the second hash value is the hash value obtained by hashing the second key component record when the key verification record is generated.
  • the second hash value can be used for the first key during the key restoration process Component records for verification.
  • Hash calculation is performed on the first key component record. During the hash calculation, even if the calculated value changes slightly, the result of the hash calculation will be greatly deviated. Therefore, the first Whether the hash value is consistent with the second hash value to determine whether the first key component record is reliable.
  • the hash calculation algorithm can be set according to the actual situation.
  • the SHA256 algorithm can be selected.
  • the SHA256 algorithm is a secure hash algorithm SHA (Secure Hash Algorithm), one of the series of algorithms, whose digest length is 256bits, that is 32 bytes, is mainly suitable for digital signatures. It is a digital signature algorithm defined in the digital signature standard. This algorithm can generate another fixed length based on a piece of input data. , Small data fragments, originally very regular input data, after the operation, the resulting data becomes unrecognizable and scattered, so it is called a hash algorithm.
  • SHA Secure Hash Algorithm
  • Step S103 When the first hash value is consistent with the second hash value, the first key component record passes verification.
  • the first hash value is consistent with the second hash value, it means that the first key component record has not been erroneous or tampered, the key component record is reliable, and the first key component record is verified.
  • the first hash value and the second hash value are inconsistent, it indicates that there is a possibility of error in the first key component record. At this time, the key component record is unreliable, and the first key component record is verified failure.
  • the method further includes:
  • A1 Synthesize the key components in each first key component record with a preset synthesis formula to obtain the original text of the first key
  • the key components recorded in each first key component can also be synthesized in a predetermined synthesis to obtain the first key text, and the first key The reliability of the original text is verified.
  • the first key original text record may include the first key original text and the original text auxiliary information corresponding to the first key original text, wherein the original text auxiliary information may be set according to actual needs, and the original text auxiliary information may be set to blank, that is, the key original text record Only the original text of the key is included in the original text, and the auxiliary information of the original text may not be empty.
  • the auxiliary information of the original text may include the key version number, key generation time, key validity period, and password.
  • Key name, key text composition formula, component number array and component length array where the component number array includes the component number of each key component, and the component length array includes the component length of each key component .
  • A3. Perform hash calculation on the original text record of the first key to determine whether the calculated third hash value is consistent with the fourth hash value in the key verification record;
  • the fourth hash value is the hash value obtained by hashing the original text record of the second key when generating the key verification record.
  • the fourth hash value can be the original text record of the first key during the key restoration process authenticating.
  • each first key component record is composed of the key component record 1 and the key component record 2.
  • the custodian A When the key is restored, the custodian A reads the key component record 1, and the custodian B also reads the key component record 1. Although a single key component record 1 can be verified, two key component records 1 cannot synthesize the correct key text. Therefore, it is necessary to verify the reliability of the key text record to ensure the correctness of the key text , Completeness, effectiveness and legality.
  • the third hash value is consistent with the fourth hash value, it indicates that the first key original text record is reliable, and the first key original text in the first key original text record is the key to be restored.
  • the third hash value and the fourth hash value are inconsistent, it indicates that there is a deviation in the first key component record used to synthesize the first key text, and the first key component of the synthesized first key text needs to be checked Whether the record is the correct key component record.
  • the method further includes:
  • the format of the key verification record can be checked to determine whether the key verification record meets the preset format requirements.
  • the hash calculation of the first key component record is specifically:
  • hash calculation is performed on the first key component record.
  • the hash calculation of the first key component record when the key verification record meets the preset format requirements specifically includes:
  • the verification of the first key component record may be continued, and the first key component record Perform hash calculations.
  • the component auxiliary information in the first key component record is inconsistent with the corresponding component auxiliary information in the key verification record, the verification of the first key component record is suspended, and the corresponding verification error information is reported to the work Personnel, for example, when reading the component auxiliary information of the first key component record, the key version number, key generation time, key validity period, key name, The fields such as the original text synthesis formula of the key are compared with the same field in the key verification record one by one.
  • calculation method of the first hash value is as follows:
  • the key component to be backed up and the component auxiliary information corresponding to the key component to be backed up are recorded as the second key component;
  • the key component to be backed up and the component auxiliary information corresponding to the key component to be backed up are used as the second key component record.
  • the second key component record can be stored in different In the secure storage medium, each secure storage medium is handed over to different key component custodians for safekeeping.
  • the secure storage medium can be selected according to actual needs, for example, IC card, U shield, etc. can be selected.
  • the data format of the key verification record and the content of the component auxiliary information of the first key component record can be compared and verified, so that the cause of the error can be found in time, so that the staff can change it in time
  • the operation method eliminates the error.
  • calculation method of the second hash value is as follows:
  • Hashing the second key original text record can obtain a fourth hash value, and the fourth hash value can be stored in the key verification record, which is used to perform the first key original text record during the key restoration process verification.
  • the key validity period is verified, and the first key is a reliable and trusted key.
  • the key validity period is less than the current clock value of the system, it means the first The original text of the key has expired and can no longer be used. Report "The key has expired" to the staff and suspend the reading process.
  • the first key component record is hashed to determine whether the first hash value obtained by the hash calculation is the same as the second hash in the key verification record
  • the values are consistent. In the hash calculation, even if the calculated value changes slightly, the result of the hash calculation will be greatly deviated. Therefore, when the first hash value is consistent with the second hash value, It can be determined that the first key component record is a reliable record. The first key component record is verified.
  • the first key text record can also be verified by the fourth hash value, thereby ensuring the correctness, completeness, validity, and legality of the first key text.
  • the format of the key verification record and the content of the component auxiliary information in the first key component record can also be verified, so that the staff can discover errors in time and correct the operation method , To facilitate the use of staff.
  • the second hash value and the fourth hash value are obtained by hashing the second key component record and the original calculation of the second key. A key component record and the first key text record are verified.
  • the key validity period in the key verification record is less than the current clock value of the system; if the key validity period is less than the current clock value of the system, it means that the original text of the first key has exceeded The validity period can no longer be used, report "the key has expired" to the staff, and abort the reading process; if the value of the key validity period is greater than or equal to the current clock value of the system, the key validity period is verified, then confirm and report The original text of the synthesized first key is a reliable and trustworthy key.
  • Embodiment 2 of the present application provides a key component verification device. For ease of description, only parts related to the present application are shown. As shown in FIG. 2, the key component verification device includes,
  • the component recording module 201 is configured to receive a component reading instruction and read a first key component record according to the component reading instruction, wherein the key component record includes the key component and component accessory information ;
  • the first verification module 202 is configured to perform hash calculation on the first key component record, and determine whether the calculated first hash value is consistent with the second hash value in the key verification record;
  • the component passing module 203 is configured to verify that the first key component record passes when the first hash value is consistent with the second hash value.
  • the device further includes:
  • the original text synthesis module is used to synthesize the key components in each first key component record with a preset synthesis formula to obtain the first key original text;
  • the original text recording module is configured to use the first key original text and the original text auxiliary information corresponding to the first key original text as the first key original text record;
  • a second verification module configured to perform hash calculation on the original text record of the first key, and determine whether the calculated third hash value is consistent with the fourth hash value in the key verification record;
  • the original text passing module is used for verifying that the first key original text record passes when the third hash value is consistent with the fourth hash value.
  • the device further includes:
  • the verification reading module is configured to receive a key verification record reading instruction, and read a key verification record according to the key verification reading instruction, wherein the key verification record includes component attachment information and a second hash Value and fourth hash value;
  • a format detection module used to determine whether the key verification record meets the preset format requirements
  • the component passing module 203 is specifically used to perform a hash calculation on the first key component record when the key verification record meets the preset format requirement, and determine the calculated first Whether a hash value is consistent with the second hash value in the key verification record.
  • component passing module 203 specifically includes:
  • the information judgment sub-module is used to judge whether the component auxiliary information in the first key component record corresponds to the corresponding in the key verification record when the key verification record meets the preset format requirement Consistent component information;
  • a hash judgment sub-module which is used for the first key component when the component auxiliary information in the first key component record is consistent with the corresponding component auxiliary information in the key verification record
  • the records are hashed to determine whether the calculated first hash value is consistent with the second hash value in the key verification record.
  • the device further includes:
  • the component backup module is used to record the key component to be backed up and the component auxiliary information corresponding to the key component to be backed up as the second key component record during the key backup process;
  • the second hash module is configured to hash the second key component record to obtain the second hash value.
  • the device further includes:
  • a second original text module used during the key backup process to use the original text of the key to be calculated and the original text auxiliary information corresponding to the original text of the key to be calculated as the second original text record;
  • the fourth hash module is configured to hash the original text record of the second key to obtain the fourth hash value.
  • FIG. 3 is a schematic diagram of a terminal device provided in Embodiment 3 of the present application.
  • the terminal device 3 of this embodiment includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30.
  • the processor 30 executes the computer program 32, the steps in the above embodiment of the key component verification method are implemented, for example, steps S101 to S103 shown in FIG. 1.
  • the processor 30 executes the computer program 32, the functions of each module/unit in the foregoing device embodiments are realized, for example, the functions of the modules 201 to 203 shown in FIG. 2.
  • the computer program 32 may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 31 and executed by the processor 30 to complete This application.
  • the one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 32 in the terminal device 3.
  • the computer program 32 may be divided into a component recording module, a first verification module, and a component passing module.
  • the specific functions of each module are as follows:
  • a component recording module configured to receive a component reading instruction, and read a first key component record according to the component reading instruction, wherein the key component record includes the key component and component accessory information;
  • a first verification module configured to perform hash calculation on the first key component record, and determine whether the calculated first hash value is consistent with the second hash value in the key verification record;
  • the component passing module is used for verifying that the first key component record passes when the first hash value is consistent with the second hash value.
  • the terminal device 3 may be a computing device such as a desktop computer, a notebook, a palmtop computer and a cloud server.
  • the terminal device may include, but is not limited to, the processor 30 and the memory 31.
  • FIG. 3 is only an example of the terminal device 3, and does not constitute a limitation on the terminal device 3, and may include more or fewer components than those illustrated, or a combination of certain components, or different components.
  • the terminal device may further include an input and output device, a network access device, a bus, and the like.
  • the so-called processor 30 may be a central processing unit (Central Processing Unit (CPU), can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit (ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 31 may be an internal storage unit of the terminal device 3, such as a hard disk or a memory of the terminal device 3.
  • the memory 31 may also be an external storage device of the terminal device 3, such as a plug-in hard disk equipped on the terminal device 3, a smart memory card (Smart Media Card, SMC), and a secure digital (SD) Flash card Card) etc.
  • the memory 31 may also include both an internal storage unit of the terminal device 3 and an external storage device.
  • the memory 31 is used to store the computer program and other programs and data required by the terminal device.
  • the memory 31 can also be used to temporarily store data that has been or will be output.
  • each functional unit and module is used as an example for illustration.
  • the above-mentioned functions may be allocated by different functional units
  • Module completion means that the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.
  • the functional units and modules in the embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit may use hardware It can also be implemented in the form of software functional units.
  • the specific names of each functional unit and module are only for the purpose of distinguishing each other, and are not used to limit the protection scope of the present application.
  • the disclosed device/terminal device and method may be implemented in other ways.
  • the device/terminal device embodiments described above are only schematic.
  • the division of the module or unit is only a logical function division, and in actual implementation, there may be another division manner, such as multiple units Or components can be combined or integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or software function unit.
  • the integrated module/unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the present application can implement all or part of the processes in the methods of the above embodiments, or it can be completed by a computer program instructing related hardware.
  • the computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, the steps of the foregoing method embodiments may be implemented.
  • the computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file, or some intermediate form, etc.
  • the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals and software distribution media, etc.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • electrical carrier signals telecommunications signals and software distribution media, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

一种密钥组分验证方法、装置及终端设备,所述方法包括:接收组分读取指令,根据所述组分读取指令读取第一密钥组分记录,其中,密钥组分记录包括密钥组分和组分附属信息;对所述第一密钥组分记录进行哈希计算,判断计算得到的第一哈希值是否与密钥验证记录中的第二哈希值一致;当所述第一哈希值与所述第二哈希值一致时,所述第一密钥组分记录验证通过。

Description

一种密钥组分验证方法、装置及终端设备 技术领域
本申请属于数据处理技术领域,尤其涉及一种密钥组分验证方法、装置及终端设备。
背景技术
随着加密技术的发展,密钥逐渐被应用于加密各种需要加密的文件。在一个密钥系统中,可以通过系统种子密钥发散生成其他密钥,使得系统中的各终端设备既能满足密钥唯一性的要求,又能节省密钥存储空间。
安全房内的密钥管理主机系统可能会遭受意外故障或断电以及自然灾害等外界因素的破坏,从而导致系统种子密钥损毁,因此,必须对系统种子密钥进行备份。在系统恢复过程中,可以从备份的媒介中恢复系统种子密钥。
密钥组分是一种常见的密钥备份方式,一个密钥可以含有两个或两个以上的密钥组分,各个密钥组分长度可以相同,也可以不同,各个密钥组分按约定的合成公式生成密钥,因此,在备份过程中,可以将密钥组分交由不同的专职人员进行管理,当需要还原密钥时,获取各个密钥组分之后按约定的合成公式还原密钥。
但是,密钥组分在理论上存在出错(例如个别密钥组分的数据出现误码)、误用(例如组分不匹配、版本不匹配、超过有效期等)、伪造、被恶意篡改或被秘密替换的可能,为了确保还原的密钥是正确的,需要对密钥组分进行验证。
常规的密钥组分验证算法是采用验证密钥对受验证的密钥组分计算出一串验证码,但是,这种验证方式的通用性差,当受验证的密钥组分是系统种子密钥的密钥组分时,难以再创建一个验证密钥用于验证计算。
综上,现有的密钥组分验证算法通用性差,无法保证系统种子密钥实现安全备份存储与准确恢复。
技术问题
有鉴于此,本申请实施例提供了一种密钥组分验证方法、装置及终端设备,以解决现有的密钥组分验证算法通用性差,无法保证系统种子密钥实现安全备份存储与准确恢复的问题。
技术解决方案
本申请实施例的第一方面提供了一种密钥组分验证方法,包括:
接收组分读取指令,根据所述组分读取指令读取第一密钥组分记录,其中,密钥组分记录包括密钥组分和组分附属信息;
对所述第一密钥组分记录进行哈希计算,判断计算得到的第一哈希值是否与密钥验证记录中的第二哈希值一致;
当所述第一哈希值与所述第二哈希值一致时,所述第一密钥组分记录验证通过。
本申请实施例的第二方面提供了一种密钥组分验证装置,包括:
组分记录模块,用于接收组分读取指令,根据所述组分读取指令读取第一密钥组分记录,其中,密钥组分记录包括密钥组分和组分附属信息;
第一验证模块,用于对所述第一密钥组分记录进行哈希计算,判断计算得到的第一哈希值是否与密钥验证记录中的第二哈希值一致;
组分通过模块,用于当所述第一哈希值与所述第二哈希值一致时,所述第一密钥组分记录验证通过。
本申请实施例的第三方面提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述方法的步骤。
本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上述方法的步骤。
有益效果
本申请实施例与现有技术相比存在的有益效果是:
本申请的密钥组分验证方法中,对第一密钥组分记录进行哈希计算,判断哈希计算得到的第一哈希值是否与密钥验证记录中的第二哈希值一致,由于在哈希计算中,即使被计算的值发生微小变动,也会使哈希计算的结果产生极大的偏差,因此,当第一哈希值与第二哈希值一致时,可以确定第一密钥组分记录为可靠的记录,第一密钥组分记录验证通过,在密钥组分记录验证中,不需要额外生成验证密钥,可以对任何密钥的密钥组分进行验证,通用性高,解决了现有的密钥组分验证算法通用性差,无法保证系统种子密钥实现安全备份存储与准确恢复的问题。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种密钥组分验证方法的实现流程示意图;
图2是本申请实施例提供的一种密钥组分验证装置的示意图;
图3是本申请实施例提供的终端设备的示意图。
本发明的实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
如在本说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
另外,在本申请的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
实施例一:
下面对本申请实施例一提供的一种密钥组分验证方法进行描述,请参阅附图1,本申请实施例一中的密钥组分验证方法包括:
步骤S101、接收组分读取指令,根据所述组分读取指令读取第一密钥组分记录,其中,密钥组分记录包括密钥组分和组分附属信息;
当需要进行密钥还原时,可以根据组分读取指令从安全存储介质读取待还原密钥的密钥组分,根据待还原密钥的密钥组分以预设的合成公式进行合成,可以得到待还原密钥的密钥原文。但是,由于密钥组分在存储过程中存在出错、误用、伪造、篡改和替换的可能,因此,为了保证还原的密钥原文的可靠性,需要对待还原密钥的密钥组分记录进行验证。
此时,可以先根据所述组分读取指令读取第一密钥组分记录,密钥组分记录包括密钥组分和组分附属信息,其中,组分附属信息可以根据实际需要进行设置,组分附属信息可以设置为空,即密钥组分记录中只包含密钥组分,组分附属信息也可以不为空,根据需要记录的数据设置对应的组分附属信息,例如,组分附属信息可以包括密钥版本号、密钥生成时间、密钥有效期、密钥名称、密钥原文合成公式、组分编号、组分长度和填充的随机数。
步骤S102、对所述第一密钥组分记录进行哈希计算,判断计算得到的第一哈希值是否与密钥验证记录中的第二哈希值一致;
密钥验证记录所记录的内容可以根据实际需要进行设置,例如,密钥验证记录可以包括密钥版本号、密钥生成时间、密钥有效期、密钥名称、密钥原文合成公式、各密钥组分记录对应的组分长度、各密钥组分记录对应的第二哈希值、密钥原文记录对应的第四哈希值。
第二哈希值为在生成密钥验证记录时,对第二密钥组分记录进行哈希计算得到的哈希值,第二哈希值可以在密钥还原的过程中对第一密钥组分记录进行验证。
对第一密钥组分记录进行哈希计算,由于哈希计算过程中,即使被计算的值发生微小变动,也会使哈希计算的结果产生极大的偏差,因此,可以通过判断第一哈希值与第二哈希值是否一致来判断第一密钥组分记录是否可靠。
哈希计算的算法可以根据实际情况进行设置,例如可以选用SHA256算法,SHA256算法是安全散列算法SHA(Secure Hash Algorithm)系列算法之一,其摘要长度为256bits,即32个字节,主要适用于数字签名,是数字签名标准里面定义的数字签名算法,该算法可以根据一段输入数据来生成另一固定长度的、小数据片段,原本很规整的输入数据,经过运算后,得到的结果数据变得面目全非、散乱不堪,因此被称为散列算法。
步骤S103、当所述第一哈希值与所述第二哈希值一致时,所述第一密钥组分记录验证通过。
当第一哈希值与第二哈希值一致时,表示第一密钥组分记录并未出错或被篡改,该密钥组分记录是可靠的,第一密钥组分记录验证通过。
当第一哈希值与第二哈希值不一致时,表示第一密钥组分记录存在出错的可能性,此时该密钥组分记录是不可靠的,第一密钥组分记录验证失败。
进一步地,所述方法还包括:
A1、将各个第一密钥组分记录中的密钥组分以预设的合成公式进行合成,得到第一密钥原文;
在对各个第一密钥组分记录进行验证之后,还可以将各个第一密钥组分记录的密钥组分以预设的合成进行合成,得到第一密钥原文,对第一密钥原文的可靠性进行验证。
A2、以所述第一密钥原文和所述第一密钥原文对应的原文附属信息作为第一密钥原文记录;
第一密钥原文记录可以包括第一密钥原文和第一密钥原文对应的原文附属信息,其中,原文附属信息可以根据实际需要进行设置,原文附属信息可以设置为空,即密钥原文记录中只包含密钥原文,原文附属信息也可以不为空,根据需要记录的数据设置对应的原文附属信息,例如,原文附属信息可以包括密钥版本号、密钥生成时间、密钥有效期、密钥名称、密钥原文合成公式、组分编号数组和组分长度数组,其中,组分编号数组包括各个密钥组分的组分编号,组分长度数组包括各个密钥组分的组分长度。
A3、对所述第一密钥原文记录进行哈希计算,判断计算得到的第三哈希值是否与所述密钥验证记录中的第四哈希值一致;
第四哈希值为生成密钥验证记录时,对第二密钥原文记录进行哈希计算得到的哈希值,第四哈希值可以在密钥还原的过程中对第一密钥原文记录进行验证。
A4、当所述第三哈希值与所述第四哈希值一致时,所述第一密钥原文记录验证通过。
由于在密钥还原的过程中,保管员需要将各个第一密钥组分记录中密钥组分以预设的合成公式进行合成得到第一密钥原文,其中,有可能各个第一密钥组分记录均为可靠的密钥组分记录,但是可能出现保管员拿错了不同版本的密钥组分记录、拿到了重复的密钥组分记录或拿到了其他密钥的密钥组分记录等情况,导致虽然单个第一密钥组分记录验证均可通过,但是根据各个第一密钥组分记录合成的第一密钥原文为错误的密钥原文,例如,一个待还原的密钥由密钥组分记录1和密钥组分记录2合成,在还原密钥时,保管员A读取了密钥组分记录1,保管员B也读取了密钥组分记录1,虽然单个密钥组分记录1可以验证通过,但是两个密钥组分记录1无法合成正确的密钥原文,因此,需要对密钥原文记录的可靠性进行验证,确保密钥原文的正确性、完备性、有效性和合法性。
当第三哈希值与第四哈希值一致时,表示第一密钥原文记录是可靠的,第一密钥原文记录中的第一密钥原文即是所需还原的密钥。
当第三哈希值与第四哈希值不一致时,表示用于合成第一密钥原文的第一密钥组分记录存在偏差,需要查验合成第一密钥原文的第一密钥组分记录是否为正确的密钥组分记录。
进一步地,在所述对所述第一密钥组分记录进行哈希计算之前还包括:
B1、接收密钥验证记录读取指令,根据所述密钥验证读取指令读取密钥验证记录,其中,所述密钥验证记录包括组分附属信息、第二哈希值和第四哈希值;
B2、判断所述密钥验证记录是否符合预设格式要求;
在对第一密钥组分记录进行哈希计算之前,可以先对密钥验证记录的格式进行检验,判断密钥验证记录是否符合预设格式要求。
对应地,所述对所述第一密钥组分记录进行哈希计算具体为:
当所述密钥验证记录符合所述预设格式要求时,对所述第一密钥组分记录进行哈希计算。
当密钥验证记录符合预设格式要求时,则进行第一密钥组分记录的验证,对第一密钥组分记录进行哈希计算。当密钥验证记录中存在任意字段不符合预设格式要求,包含无效字符时,则中止对密钥组分记录的验证,报告“验证记录无效”给工作人员。
进一步地,所述当所述密钥验证记录符合所述预设格式要求时,对所述第一密钥组分记录进行哈希计算具体包括:
C1、当所述密钥验证记录符合所述预设格式要求时,判断所述第一密钥组分记录中的组分附属信息是否与所述密钥验证记录中对应的组分附属信息一致;
除了验证密钥验证记录的格式之外,还可以对第一密钥组分记录中的组分附属信息进行验证,判断第一密钥组分记录中的组分附属信息是否与密钥验证记录中对应的组分附属信息一致。
C2、当所述第一密钥组分记录中的组分附属信息与所述密钥验证记录中对应的组分附属信息一致时,对所述第一密钥组分记录进行哈希计算。
当第一密钥组分记录中的组分附属信息与密钥验证记录中对应的组分附属信息一致时,可以继续进行第一密钥组分记录的验证,对第一密钥组分记录进行哈希计算。当第一密钥组分记录中的组分附属信息与密钥验证记录中对应的组分附属信息不一致时,则中止对第一密钥组分记录的验证,报告对应的验证出错信息给工作人员,例如,在读取第一密钥组分记录的组分附属信息时,可以将第一密钥组分记录中的密钥版本号、密钥生成时间、密钥有效期、密钥名称、密钥原文合成公式等字段与密钥验证记录中的同一字段逐一进行比较,若不一致,则报告“封装信息验证失败”并中止读取过程;然后核实组分编号字段,核实其是否属于密钥验证记录中组分编号数组中的一员,若不属于(例如第一密钥组分记录中的组分编号为2,密钥验证记录中的组分编号数组内记录的编号为一、二、三…),则报告“组分编号验证失败”并中止读取过程;然后核实第一密钥组分记录中的组分长度是否与密钥验证记录中对应的组分长度一致,若不一致,则报告“组分长度验证失败”并中止读取过程。
进一步地,所述第一哈希值的计算方法如下:
D1、在密钥备份的过程中,以待备份的密钥组分和所述待备份的密钥组分对应的组分附属信息作为第二密钥组分记录;
在密钥备份的过程中,以待备份的密钥组分和待备份的密钥组分对应的组分附属信息作为第二密钥组分记录,第二密钥组分记录可以保存在不同的安全存储介质中,每一个安全存储介质交给不同的密钥组分保管员进行保管,安全存储介质可以根据实际需要进行选择,例如可以选择IC卡、U盾等。
D2、对所述第二密钥组分记录进行哈希计算,得到所述第二哈希值。
对第二密钥组分记录进行哈希计算,可以得到第二哈希值,第二哈希值可以保存在密钥验证记录中,用于在密钥还原的过程对第一密钥组分记录进行验证,密钥验证记录可以单独保存在另外的安全存储介质中,并将该安全存储介质交给密钥验证管理员进行保管。
由于在密钥还原的过程中存在较多的出错原因,通过第二哈希值和第四哈希值虽然可以辨识密钥组分记录和密钥原文记录的准确性,但是无法得知具体错误原因,因此,可以在进行哈希计算之前对密钥验证记录的数据格式和第一密钥组分记录的组分附属信息的内容进行比对验证,从而及时发现错误原因,方便工作人员及时更改操作方法排除错误。
进一步地,所述第二哈希值的计算方法如下:
E1、在密钥备份的过程中,以所述待计算的密钥原文和所述待计算的密钥原文对应的原文附属信息作为第二密钥原文记录;
E2、对所述第二密钥原文记录进行哈希计算,得到所述第四哈希值;
对第二密钥原文记录进行哈希运算,可以得到第四哈希值,第四哈希值可以保存在密钥验证记录中,用于在密钥还原的过程对第一密钥原文记录进行验证。
此外,还可以在第一密钥原文记录验证通过后,对密钥验证记录中的密钥有效期进行检查,判断密钥验证记录中的密钥有效期的值是否小于系统当前的时钟值,当密钥有效期的值大于或等于系统当前的时钟值时,密钥有效期验证通过,第一密钥原文为可靠的、可信任的密钥,当密钥有效期小于系统当前的时钟值时,表示第一密钥原文已超过有效期,不能再使用,报告“密钥已超过有效期”至工作人员,并中止读取过程。
本实施例一提供的密钥组分验证方法中,对第一密钥组分记录进行哈希计算,判断哈希计算得到的第一哈希值是否与密钥验证记录中的第二哈希值一致,由于在哈希计算中,即使被计算的值发生微小变动,也会使哈希计算的结果产生极大的偏差,因此,当第一哈希值与第二哈希值一致时,可以确定第一密钥组分记录为可靠的记录,第一密钥组分记录验证通过,在密钥组分记录验证中,不需要额外生成验证密钥,可以对任何密钥的密钥组分进行验证,通用性高,解决了现有的密钥组分验证算法通用性差,无法保证系统种子密钥实现安全备份存储与准确恢复的问题。
验证了第一密钥组分记录之后,还可以通过第四哈希值验证第一密钥原文记录,从而保证第一密钥原文的正确性、完备性、有效性和合法性。
在使用第一哈希值进行验证之前,还可以对密钥验证记录的格式和第一密钥组分记录中的组分附属信息的内容进行验证,从而使工作人员及时发现错误和改正操作方法,方便工作人员的使用。
第二哈希值和第四哈希值为密钥备份的过程中,对第二密钥组分记录和第二密钥原文计算进行哈希运算得到,可以在密钥还原的过程中对第一密钥组分记录和第一密钥原文记录进行验证。
在第一密钥原文验证之后,还可以验证密钥验证记录中的密钥有效期是否小于系统当前的时钟值;若密钥有效期小于系统当前的时钟值时,则表示第一密钥原文已超过有效期,不能再使用,报告“密钥已超过有效期”至工作人员,并中止读取过程;若密钥有效期的值大于或等于系统当前的时钟值时,密钥有效期验证通过,则证实并报告所合成的第一密钥原文是可靠的、可信任的密钥。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
实施例二:
本申请实施例二提供了一种密钥组分验证装置,为便于说明,仅示出与本申请相关的部分,如图2所示,密钥组分验证装置包括,
组分记录模块201,用于接收组分读取指令,根据所述组分读取指令读取第一密钥组分记录,其中,密钥组分记录包括密钥组分和组分附属信息;
第一验证模块202,用于对所述第一密钥组分记录进行哈希计算,判断计算得到的第一哈希值是否与密钥验证记录中的第二哈希值一致;
组分通过模块203,用于当所述第一哈希值与所述第二哈希值一致时,所述第一密钥组分记录验证通过。
进一步地,所述装置还包括:
原文合成模块,用于将各个第一密钥组分记录中的密钥组分以预设的合成公式进行合成,得到第一密钥原文;
原文记录模块,用于以所述第一密钥原文和所述第一密钥原文对应的原文附属信息作为第一密钥原文记录;
第二验证模块,用于对所述第一密钥原文记录进行哈希计算,判断计算得到的第三哈希值是否与所述密钥验证记录中的第四哈希值一致;
原文通过模块,用于当所述第三哈希值与所述第四哈希值一致时,所述第一密钥原文记录验证通过。
进一步地,所述装置还包括:
验证读取模块,用于接收密钥验证记录读取指令,根据所述密钥验证读取指令读取密钥验证记录,其中,所述密钥验证记录包括组分附属信息、第二哈希值和第四哈希值;
格式检测模块,用于判断所述密钥验证记录是否符合预设格式要求;
对应地,所述组分通过模块203,具体用于当所述密钥验证记录符合所述预设格式要求时,对所述第一密钥组分记录进行哈希计算,判断计算得到的第一哈希值是否与密钥验证记录中的第二哈希值一致。
进一步地,所述组分通过模块203,具体包括:
信息判断子模块,用于当所述密钥验证记录符合所述预设格式要求时,判断所述第一密钥组分记录中的组分附属信息是否与所述密钥验证记录中对应的组分附属信息一致;
哈希判断子模块,用于当所述第一密钥组分记录中的组分附属信息与所述密钥验证记录中对应的组分附属信息一致时,对所述第一密钥组分记录进行哈希计算,判断计算得到的第一哈希值是否与密钥验证记录中的第二哈希值一致。
进一步地,所述装置还包括:
组分备份模块,用于在密钥备份的过程中,以待备份的密钥组分和所述待备份的密钥组分对应的组分附属信息作为第二密钥组分记录;
第二哈希模块,用于对所述第二密钥组分记录进行哈希计算,得到所述第二哈希值。
进一步地,所述装置还包括:
第二原文模块,用于在密钥备份的过程中,以所述待计算的密钥原文和所述待计算的密钥原文对应的原文附属信息作为第二密钥原文记录;
第四哈希模块,用于对所述第二密钥原文记录进行哈希计算,得到所述第四哈希值。
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
实施例三:
图3是本申请实施例三提供的终端设备的示意图。如图3所示,该实施例的终端设备3包括:处理器30、存储器31以及存储在所述存储器31中并可在所述处理器30上运行的计算机程序32。所述处理器30执行所述计算机程序32时实现上述密钥组分验证方法实施例中的步骤,例如图1所示的步骤S101至S103。或者,所述处理器30执行所述计算机程序32时实现上述各装置实施例中各模块/单元的功能,例如图2所示模块201至203的功能。
示例性的,所述计算机程序32可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器31中,并由所述处理器30执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序32在所述终端设备3中的执行过程。例如,所述计算机程序32可以被分割成组分记录模块、第一验证模块以及组分通过模块,各模块具体功能如下:
组分记录模块,用于接收组分读取指令,根据所述组分读取指令读取第一密钥组分记录,其中,密钥组分记录包括密钥组分和组分附属信息;
第一验证模块,用于对所述第一密钥组分记录进行哈希计算,判断计算得到的第一哈希值是否与密钥验证记录中的第二哈希值一致;
组分通过模块,用于当所述第一哈希值与所述第二哈希值一致时,所述第一密钥组分记录验证通过。
所述终端设备3可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端设备可包括,但不仅限于,处理器30、存储器31。本领域技术人员可以理解,图3仅仅是终端设备3的示例,并不构成对终端设备3的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器30可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器31可以是所述终端设备3的内部存储单元,例如终端设备3的硬盘或内存。所述存储器31也可以是所述终端设备3的外部存储设备,例如所述终端设备3上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器31还可以既包括所述终端设备3的内部存储单元也包括外部存储设备。所述存储器31用于存储所述计算机程序以及所述终端设备所需的其他程序和数据。所述存储器31还可以用于暂时地存储已经输出或者将要输出的数据。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (10)

  1. 一种密钥组分验证方法,其特征在于,包括:
    接收组分读取指令,根据所述组分读取指令读取第一密钥组分记录,其中,密钥组分记录包括密钥组分和组分附属信息;
    对所述第一密钥组分记录进行哈希计算,判断计算得到的第一哈希值是否与密钥验证记录中的第二哈希值一致;
    当所述第一哈希值与所述第二哈希值一致时,所述第一密钥组分记录验证通过。
  2. 如权利要求1所述的密钥组分验证方法,其特征在于,所述方法还包括:
    将各个第一密钥组分记录中的密钥组分以预设的合成公式进行合成,得到第一密钥原文;
    以所述第一密钥原文和所述第一密钥原文对应的原文附属信息作为第一密钥原文记录;
    对所述第一密钥原文记录进行哈希计算,判断计算得到的第三哈希值是否与所述密钥验证记录中的第四哈希值一致;
    当所述第三哈希值与所述第四哈希值一致时,所述第一密钥原文记录验证通过。
  3. 如权利要求1所述的密钥组分验证方法,其特征在于,在所述对所述第一密钥组分记录进行哈希计算之前还包括:
    接收密钥验证记录读取指令,根据所述密钥验证读取指令读取密钥验证记录,其中,所述密钥验证记录包括组分附属信息、第二哈希值和第四哈希值;
    判断所述密钥验证记录是否符合预设格式要求;
    对应地,所述对所述第一密钥组分记录进行哈希计算具体为:
    当所述密钥验证记录符合所述预设格式要求时,对所述第一密钥组分记录进行哈希计算。
  4. 如权利要求3所述的密钥组分验证方法,其特征在于,所述当所述密钥验证记录符合所述预设格式要求时,对所述第一密钥组分记录进行哈希计算具体包括:
    当所述密钥验证记录符合所述预设格式要求时,判断所述第一密钥组分记录中的组分附属信息是否与所述密钥验证记录中对应的组分附属信息一致;
    当所述第一密钥组分记录中的组分附属信息与所述密钥验证记录中对应的组分附属信息一致时,对所述第一密钥组分记录进行哈希计算。
  5. 如权利要求1所述的密钥组分验证方法,其特征在于,所述第二哈希值的计算方法如下:
    在密钥备份的过程中,以待备份的密钥组分和所述待备份的密钥组分对应的组分附属信息作为第二密钥组分记录;
    对所述第二密钥组分记录进行哈希计算,得到所述第二哈希值。
  6. 如权利要求5所述的密钥组分验证方法,其特征在于,所述第四哈希值的计算方法如下:
    在密钥备份的过程中,以待计算的密钥原文和所述待计算的密钥原文对应的原文附属信息作为第二密钥原文记录;
    对所述第二密钥原文记录进行哈希计算,得到所述第四哈希值。
  7. 一种密钥组分验证装置,其特征在于,包括:
    组分记录模块,用于接收组分读取指令,根据所述组分读取指令读取第一密钥组分记录,其中,密钥组分记录包括密钥组分和组分附属信息;
    第一验证模块,用于对所述第一密钥组分记录进行哈希计算,判断计算得到的第一哈希值是否与密钥验证记录中的第二哈希值一致;
    组分通过模块,用于当所述第一哈希值与所述第二哈希值一致时,所述第一密钥组分记录验证通过。
  8. 如权利要求7所述的密钥组分验证装置,其特征在于,所述装置还包括:
    原文合成模块,用于将各个第一密钥组分记录中的密钥组分以预设的合成公式进行合成,得到第一密钥原文;
    原文记录模块,用于以所述第一密钥原文和所述第一密钥原文对应的原文附属信息作为第一密钥原文记录;
    第二验证模块,用于对所述第一密钥原文记录进行哈希计算,判断计算得到的第三哈希值是否与所述密钥验证记录中的第四哈希值一致;
    原文通过模块,用于当所述第三哈希值与所述第四哈希值一致时,所述第一密钥原文记录验证通过。
  9. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至6任一项所述方法的步骤。
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至6任一项所述方法的步骤。
PCT/CN2019/116301 2018-12-29 2019-11-07 一种密钥组分验证方法、装置及终端设备 WO2020134637A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811654834.9A CN109768853A (zh) 2018-12-29 2018-12-29 一种密钥组分验证方法、装置及终端设备
CN201811654834.9 2018-12-29

Publications (1)

Publication Number Publication Date
WO2020134637A1 true WO2020134637A1 (zh) 2020-07-02

Family

ID=66452564

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/116301 WO2020134637A1 (zh) 2018-12-29 2019-11-07 一种密钥组分验证方法、装置及终端设备

Country Status (2)

Country Link
CN (1) CN109768853A (zh)
WO (1) WO2020134637A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109768853A (zh) * 2018-12-29 2019-05-17 百富计算机技术(深圳)有限公司 一种密钥组分验证方法、装置及终端设备
CN111967609B (zh) * 2020-08-14 2021-08-06 深圳前海微众银行股份有限公司 模型参数验证方法、设备及可读存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060036627A1 (en) * 2004-08-06 2006-02-16 Roger Deran Method and apparatus for a restartable hash in a trie
CN103988189A (zh) * 2011-12-08 2014-08-13 国际商业机器公司 检测在信息设备之间的数据传输的数据丢失的方法
CN107425962A (zh) * 2017-04-21 2017-12-01 济南浪潮高新科技投资发展有限公司 一种数据分级加密与分割的云端数据保护方法
CN107465505A (zh) * 2017-08-28 2017-12-12 阿里巴巴集团控股有限公司 一种密钥数据处理方法、装置及服务器
CN107609416A (zh) * 2017-09-11 2018-01-19 浙江志诚软件有限公司 用户数据的安全加密方法、系统、计算机装置及计算机可读存储介质
US20180219871A1 (en) * 2017-02-01 2018-08-02 Futurewei Technologies, Inc. Verification of fragmented information centric network chunks
CN109768853A (zh) * 2018-12-29 2019-05-17 百富计算机技术(深圳)有限公司 一种密钥组分验证方法、装置及终端设备

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008070167A1 (en) * 2006-12-05 2008-06-12 Security First Corporation Improved tape backup method
US20100088745A1 (en) * 2008-10-06 2010-04-08 Fujitsu Limited Method for checking the integrity of large data items rapidly

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060036627A1 (en) * 2004-08-06 2006-02-16 Roger Deran Method and apparatus for a restartable hash in a trie
CN103988189A (zh) * 2011-12-08 2014-08-13 国际商业机器公司 检测在信息设备之间的数据传输的数据丢失的方法
US20180219871A1 (en) * 2017-02-01 2018-08-02 Futurewei Technologies, Inc. Verification of fragmented information centric network chunks
CN107425962A (zh) * 2017-04-21 2017-12-01 济南浪潮高新科技投资发展有限公司 一种数据分级加密与分割的云端数据保护方法
CN107465505A (zh) * 2017-08-28 2017-12-12 阿里巴巴集团控股有限公司 一种密钥数据处理方法、装置及服务器
CN107609416A (zh) * 2017-09-11 2018-01-19 浙江志诚软件有限公司 用户数据的安全加密方法、系统、计算机装置及计算机可读存储介质
CN109768853A (zh) * 2018-12-29 2019-05-17 百富计算机技术(深圳)有限公司 一种密钥组分验证方法、装置及终端设备

Also Published As

Publication number Publication date
CN109768853A (zh) 2019-05-17

Similar Documents

Publication Publication Date Title
US8572673B2 (en) Data processing apparatus and method
RU154072U1 (ru) Средство чтения смарт-карты с безопасной функцией журналирования
US10205748B2 (en) Protection for computing systems from revoked system updates
BR112019014815A2 (pt) Método implementado por computador, meio de armazenamento legível por computador não transitório e sistema
CN109784870B (zh) 合同管理方法、装置、计算机设备及计算机可读存储介质
US20200117550A1 (en) Method, device and computer program product for backing up data
US11671262B2 (en) Asynchronously determining relational data integrity using cryptographic data structures
US7962765B2 (en) Methods and systems for tamper resistant files
US10853197B2 (en) Data recovery with authenticity
CN112907375B (zh) 数据处理方法、装置、计算机设备和存储介质
US11481284B2 (en) Systems and methods for generating self-notarized backups
WO2020134637A1 (zh) 一种密钥组分验证方法、装置及终端设备
CN111339551B (zh) 数据的验证方法及相关装置、设备
CN110347678B (zh) 一种金融数据的存储方法、系统、装置及设备
CN112560062B (zh) 处方签名的防伪方法、装置、电子设备及存储介质
CN112163036A (zh) 区块链信息的构建和查询方法及相关装置
CN116450391A (zh) 一种故障定位方法、装置、设备及介质
CN112883397A (zh) 数据存储方法、数据读取方法、装置、设备及存储介质
CN112835854A (zh) 文件存储方法、装置、电子设备和存储介质
CN114401096B (zh) 区块链数据的上链控制方法、装置、设备及存储介质
US20220383333A1 (en) System and method of validating one or more components of an information handling system
US9323951B2 (en) Encrypted warranty verification and diagnostic tool
CN111404662B (zh) 一种数据处理方法及装置
CN118916048A (zh) 防拷贝系统及防拷贝方法
JP2002006739A (ja) 認証情報生成装置およびデータ検証装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19903062

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19903062

Country of ref document: EP

Kind code of ref document: A1