A root key file verification method and device
By generating verification request messages and identity authentication of the key distribution end, decrypting and hashing verification of the root key file, the problem of root key error in the quantum secure terminal is solved, the integrity and correctness verification of the root key file is realized, and the security and reliability of communication are improved.
Patent Information
- Application Number
- CN202310073240.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-30
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2043-01-30
AI Technical Summary
The root key pre-noted by existing quantum security terminals may have errors when leaving the factory, and cannot guarantee the security and reliability of communications. They need to be verified to ensure integrity and correctness.
The terminal generates a verification request message, carries the hash value of the device ID and the root key cipher file, the key distribution terminal authenticates and returns the key expansion parameters, and the terminal decrypts the root key cipher file and hash verification to ensure the integrity and correctness of the root key file.
It effectively avoids access to illegal devices, improves the security of the root key file, and ensures the absolute security and reliability of the communication process.
Smart Images

Figure CN116094705B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a root key file verification method and device. Background Art
[0002] Traditional information security is achieved through encryption algorithms that rely on computational complexity. However, with the rapid development of computing power, traditional encryption algorithms that rely on computational complexity face increasingly severe security risks.
[0003] As society places increasing emphasis on communication security, quantum secure communication technology has gained widespread attention. It can perfectly overcome the security risks of traditional communication technologies and ensure the absolute security and reliability of the communication process.
[0004] Quantum secure communication is the first quantum information technology to achieve practical application and industrialization. Currently, a variety of quantum security devices are commercially available for information security. These devices can perform quantum encryption on data, ensuring the high security of the data they transmit. When performing quantum secure communication, a quantum secure terminal transmits user data encrypted with quantum keys over a local area network or the internet, while also relaying the encryption quantum key through a quantum secure network. Quantum terminals are pre-loaded with a root key at the factory. However, if this pre-loaded root key is incorrect, normal communication cannot be guaranteed. Therefore, it is necessary to verify the root key within the quantum secure terminal to ensure its integrity and accuracy. Summary of the Invention
[0005] In order to solve the above problem, the present invention discloses a root key file verification method.
[0006] This application provides a root key file verification method, the method comprising:
[0007] The terminal reads the device ID and root key index corresponding to the root key ciphertext file based on the attribute information of the root key ciphertext file, and calculates the first hash value of the root key ciphertext file; generates a verification request message, carries the device ID and the first hash value in the verification request message, and sends the verification request message to the key distribution end;
[0008] The key distribution end receives the verification request message, matches the root key file record according to the root key index in the verification request message, searches and determines the root key ciphertext file, root key plaintext file, device ID and first key extension parameter corresponding to the root key index based on the root key file record, calculates the second hash value corresponding to the found root key ciphertext file, and performs identity authentication on the terminal based on the comparison result of the first hash value and the second hash value, and whether the device ID in the verification request message matches the device ID in the root key file record. If the hash value comparison result is consistent and the device ID matches, the identity authentication is passed, and then the third hash value corresponding to the root key plaintext file is calculated. A verification success message is returned to the terminal, and the third hash value and the first key extension parameter are carried in the message. Otherwise, the identity authentication fails, and a verification failure message is returned to the terminal.
[0009] If the terminal receives a verification success message from the key distribution end, it extracts the first key extension parameter and the third hash value corresponding to the root key plaintext file in the verification success message, splices the first key extension parameter with the second key extension parameter in the quantum security terminal to obtain a decryption key for decrypting the root key ciphertext file, obtains the root key plaintext file by decrypting the root key ciphertext file, and then calculates the fourth hash value corresponding to the root key plaintext file. Based on the comparison result of the fourth hash value information and the third hash value, it is determined whether the root key file is abnormal; otherwise, the root key ciphertext file is continued to be used for the verification process until the preset verification number threshold is reached.
[0010] In the above scheme, the device ID and the first hash value in the verification request message are encrypted by the first key to form the first encrypted data, and the first key extension parameter and the third hash value in the verification success message are encrypted by the second key to form the second encrypted data, and the first key and the second key are pre-stored in the terminal and the key distribution end.
[0011] In the above solution, the method further includes:
[0012] The terminal sends the first key index to the key distribution end;
[0013] The key distribution end receives the first key index, determines the first key according to the first key index, and carries the second key index in a verification success response message;
[0014] The terminal receives a verification success response message sent from the key distribution end, and determines the second key according to the second key index information in the verification success response message to decrypt the second encrypted data.
[0015] In the above solution, the specific method for obtaining the decryption key for decrypting the root key ciphertext file includes:
[0016] Concatenate the first key extension parameter and the second key extension parameter to form an initial key;
[0017] The initial key is expanded to form an extended key of corresponding length according to a preset key expansion algorithm and the length of the root key file, thereby obtaining the extended key for decrypting the root key ciphertext file.
[0018] In the above solution, the root key ciphertext file includes multiple groups of uplink root key ciphertext files and downlink root key ciphertext files arranged in pairs, and the terminal obtains the first hash value by calculating the hash value of the first group of uplink root key ciphertext files and downlink root key ciphertext files in the root key ciphertext file;
[0019] The root key center obtains the third hash value by calculating the combined hash value of the first group of uplink root key plaintext files and downlink root key plaintext files in the root key plaintext files.
[0020] In the above scheme, each upstream root key plaintext file and downstream root key plaintext file carries a corresponding reference hash value;
[0021] The verification method further includes:
[0022] The terminal calculates the hash value of each decrypted upstream root key plaintext file and downstream root key plaintext file, and verifies whether it is the same as the reference hash value to verify the correctness of each decrypted upstream root key plaintext file and downstream root key plaintext file.
[0023] The present application also provides a root key file verification device, the device comprising: a reading module and a verification module; wherein the reading module is used to read attribute information corresponding to the root key file, and obtain the device ID, root key index, first key extension parameter, first key and second key corresponding to the root key ciphertext file;
[0024] The verification module is used to compare the calculated fourth hash value of the root key plaintext file with the third hash value received from the key distribution end; and when the fourth hash value is consistent with the third hash value, determine that the verification is successful; when the fourth hash value is inconsistent with the third hash value, determine that the verification fails.
[0025] In the above solution, the device further includes a traversal module for traversing the independent files of each root key file, decrypting each root key ciphertext file according to the calculated decryption key, and calculating the actual hash value information corresponding to each independent file in each root key plaintext file; the reading module is further used to read the reference hash value carried by each root key plaintext file;
[0026] The verification module is configured to compare the actual hash value information with the reference hash value information; and when the actual hash value information is consistent with the reference hash value information, determine that the verification is successful; when the actual hash value information is inconsistent with the reference hash value information, determine that the verification fails.
[0027] In the above solution, the device further includes a decryption module, the decryption module being configured to determine a decryption key based on a key index, and to concatenate the first key extension parameter and the second key extension parameter according to the received second key extension parameter to form an initial key;
[0028] The initial key is expanded to form an extended key according to a preset key expansion algorithm and the length of the root key file to decrypt the root key ciphertext file.
[0029] The root key file verification method of the present application first generates a verification request message by the terminal, which carries the device ID and the hash value of the root key ciphertext file. The key distribution end authenticates the terminal based on the hash value of the root key ciphertext file and the device ID in the received verification request message, and returns the hash value of the root key plaintext file and the key extension parameter for decrypting the root key ciphertext file after the identity authentication is legal; the terminal obtains the decryption key based on the key extension parameter to decrypt the root key ciphertext file to obtain the root key plaintext file, and performs a hash verification on it again; the key distribution end needs to perform identity authentication during this verification process to avoid access by illegal devices. , and simultaneously verifies the hash verification based on the root key ciphertext file and the root key plaintext file, effectively ensuring the integrity and correctness of the root key file; the terminal decrypts the root key ciphertext file, which requires the key distribution end to provide the key extension parameter, avoiding the situation where the decryption key and the root key plaintext file may be leaked at the same time when the key extension parameter is stored in the terminal, thereby improving the security of the root key file; the verification device of the present application mainly includes: a reading module and a verification module; wherein, the reading module is used to read the attribute information corresponding to the root key file, and the verification module is used for hash verification, and the combination of the two can verify the integrity and correctness of the stored root key file. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a timing diagram of a root key file verification method in a quantum security terminal according to an embodiment of the present application;
[0031] Figure 2 A schematic diagram of a method for obtaining an extended key in an embodiment of the present application;
[0032] Figure 3 Schematic diagram of a root key verification device in an embodiment of the present application;
[0033] Figure 4Schematic diagram of a method for determining a first key and a second key in an embodiment of the present application. DETAILED DESCRIPTION
[0034] To make the objectives, technical solutions, and advantages of this application more clear, this application will be further described in detail below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of this application without making any creative efforts are within the scope of protection of this application.
[0035] Example: The terminal in this example mainly refers to a quantum security device, which is a device that uses quantum true random numbers to encrypt and decrypt data;
[0036] The quantum security device is pre-injected with a root key when it leaves the factory. The root key is generated by the root key center based on the interface configuration or imported device information.
[0037] When generating a root key: The root key center generates root key information for the device based on the imported device information. The root key information includes the root key file and the generation record corresponding to the root key.
[0038] The root key generated by the root key center is one or more root key groups, and each root key group is identified by the group ID when it is generated;
[0039] Each root key group may include multiple root key files, the number of which is determined by the file size granularity. Root key files are numbered starting from 1, and the file sequence is 1...n. In this embodiment, the number of root key files in each root key group is even. Files with odd numbers are used as upstream root keys, and files with even numbers are used as downstream root keys. After each root key file is generated, its corresponding hash value Hk is calculated.
[0040] The root key center generates a corresponding generation record for the root key group based on the device ID;
[0041] The build record includes:
[0042] The root key center generates a first key extension parameter, a second key extension parameter, a first key, and a second key according to a preset length;
[0043] And the device ID ciphertext information Ir obtained by encrypting the device ID.
[0044] The root key center simultaneously establishes a generation record table and a file record table, where the generation record table is based on the generation record when the above-mentioned root key file is generated, and the file record table is used to find and locate files from the generation record table. The two tables are associated through the association index R, which is a one-to-many relationship.
[0045] When the root key is output: the root key group and its corresponding root key parameter data are exported from the root key center, where the root key parameter data includes: the device ID (denoted as DID) corresponding to the root key group, the type identifier, and the authentication information corresponding to the root key group; the authentication information includes: the index corresponding to the root key group (denoted as root key index I1), the second key extension parameter, the first key, and the second key; the type identifier is used to indicate the extension algorithm of the encryption key and the extension algorithm of the decryption key;
[0046] When exporting the root key: the exported file uses the DID as the directory and the group ID as the subdirectory;
[0047] The root key files in each exported root key group carry the hash value Hk corresponding to the file, and each root key file is encrypted using a different extended key to obtain a root key ciphertext file. In addition, the file header of each root key ciphertext file also carries corresponding attribute information, including the file type, group ID, total number of files, number of files of the same type, file sequence number of the same type, and group selection random number Rg corresponding to the root key file. This attribute information is not encrypted.
[0048] The methods for obtaining the extended key include:
[0049] S1, concatenate the first key extension parameter and the second key extension parameter to form an initial key;
[0050] S2, according to the number N of key files, expand the initial key to form N file encryption root keys K that correspond one-to-one with each root key group;
[0051] S3, obtaining a file encryption root key K corresponding to the ciphertext file, and expanding the file encryption root key K to form an extended key corresponding to the key file according to a preset root key expansion algorithm and the length of the key file.
[0052] In a possible example, the first key extension parameter and the second key extension parameter are both 128-bit random numbers, which are concatenated in step S1 to form a 256-bit initial key K0; in step S2, they are expanded to form N corresponding file encryption root keys K cFor example, if the number of key files N=3, namely M1, M2, and M3, then K1, K2, and K3, three corresponding file encryption root keys, are first expanded. The specific key expansion algorithm can use, for example, the AES key expansion algorithm; when encrypting each key file, the expanded file encryption root key is further expanded based on the file length of the key file to be encrypted to form an encryption key consistent with the length of the key file; for example, the length of the key file M1 is 256 bits, and the length of the expanded file encryption root key K1 is 128 bits; when encrypting the key file M1, the corresponding file encryption root key K1 is first taken out, and then based on the preset root key expansion algorithm and the length of the key file M1, the file encryption root key K1 is expanded to an expanded key file of 256 bits, thereby encrypting the key file M1.
[0053] From the above root key generation and derivation process, it can be seen that the root key file in the root key group pre-injected in the quantum security device is an encrypted root key ciphertext file; at the same time, the file header of each individual root key ciphertext file carries the attribute information corresponding to the file, which includes the file type, group ID, total number of files, number of type files, type file sequence number, and group selection random number Rg corresponding to the root key ciphertext file; each root key ciphertext file in each root key group is numbered according to the parity of the file number. The file number with an odd number is used as the uplink root key of the quantum security device, and the file number with an even number is used as the downlink root key of the quantum security device;
[0054] At the same time, the quantum security device also stores root key parameter data corresponding to each root key group. The root key parameter data includes: the device ID (denoted as DID) corresponding to the root key, the type identifier, and the authentication information corresponding to each root key group file; the authentication information includes: the root key index I1 corresponding to the root key group, the second key expansion parameter, the first key, and the second key; the type identifier is used to indicate the key expansion algorithm and the decryption key expansion algorithm;
[0055] See also Figure 1 The specific verification method of the root key of this embodiment includes:
[0056] 101. The quantum security device selects an unauthenticated root key group; if there are multiple root key groups, the root key groups are selected in order of their group ID numbers;
[0057] When the root key ciphertext file includes multiple groups of uplink root key ciphertext files and downlink root key ciphertext files arranged in pairs, the quantum security device obtains a first hash value by calculating a combined hash value of a first group of uplink root key ciphertext files and downlink root key ciphertext files in the root key ciphertext file;
[0058] The root key center obtains a third hash value by calculating a combined hash value of the first group of uplink root key plaintext files and the downlink root key plaintext files in the root key plaintext files;
[0059] Each uplink root key plaintext file and downlink root key plaintext file carries a corresponding reference hash value;
[0060] The verification method further includes:
[0061] The terminal calculates the hash value of each decrypted upstream root key plaintext file and downstream root key plaintext file, and verifies whether it is the same as the reference hash value to verify the correctness of each decrypted upstream root key plaintext file and downstream root key plaintext file.
[0062] During verification, the corresponding group ID is obtained from the header of the root key ciphertext file to be authenticated. Based on the group ID, the authentication information and device ID corresponding to the root key ciphertext file are determined from the root key parameter data. The group ID is used to identify each root key group. In one possible example, the group ID is a true random number generated by a true random number generator to ensure its randomness, non-repeatability, and uniqueness. This prevents duplicate numbers when multiple root key groups are allocated, which could lead to errors in subsequent authentication information retrieval.
[0063] Calculate the combined hash value H1 of the first upstream root key ciphertext file and the first downstream root key ciphertext file in the root key group; if there are an even number of root key files in each root key group, the file with an odd number is used as the upstream root key, and the file with an even number is used as the downstream root key;
[0064] Construct an access request message based on the hash value H1 and the device ID and root key index I1 in the authentication information, and encrypt the device ID and hash value H1 in the access request message using the first key in the authentication information;
[0065] Send an access request message to the access base station according to the access base station IP address, wherein the access request message includes the root key index I1, the encrypted device ID and the hash value H1;
[0066] 102. The root key center receives the authentication request message, searches for the root key generation record based on the root key index I1 in the authentication request message, obtains the second key extension parameter, the first key, and the second key from the root key generation record, extracts the first key, and decrypts the encrypted content in the authentication request message to obtain the device ID and hash value H1.
[0067] Based on the root key generation record, the combined hash value H2 of the first upstream root key ciphertext file and the downstream root key ciphertext file of the corresponding root key group is obtained and calculated. The identity of the quantum security device is authenticated by verifying whether the hash value H2 is the same as the hash value H1, and whether the received device ID is consistent with the record in the root key generation record. If the hash value verification is successful and the device ID is consistent, the authentication is successful, otherwise the authentication fails. The dual verification of the device ID and the file hash value is used here to ensure the reliability of the identity authentication. At the same time, the message transmission is encrypted, which further improves the security.
[0068] Upon successful authentication, obtaining and calculating a combined hash value H3 of the first upstream root key plaintext file and the downstream root key plaintext file in the root key group based on the root key generation record, encrypting the hash value H3 and the second key extension parameter using the second key, and generating an authentication response message indicating successful authentication. The authentication response message carries: the device ID, the encrypted hash value H3, and the second key extension parameter;
[0069] When authentication fails, generating an authentication response message indicating the authentication failure;
[0070] Returning the authentication response message to the access base station;
[0071] 103. The quantum security device receives the verification response message. If the verification response message indicates that the authentication is successful, the encrypted content of the message is decrypted according to the second key in the root key parameter data to obtain a hash value H3 and a second key extension parameter. The second key extension parameter is concatenated with the first key extension parameter in the quantum security device and extended according to a preset key extension algorithm. The specific process can refer to the method for obtaining the extended key in the root key derivation process described above. The key for decrypting each root key ciphertext file in the root key group is obtained, and the root key ciphertext file is decrypted to obtain a root key plaintext file.
[0072] See also Figure 2 , that is, the methods for obtaining the extended key include:
[0073] S1, concatenate the first key extension parameter and the second key extension parameter to form an initial key;
[0074] S2, according to the number N of key files, expand the initial key to form N file encryption root keys K that correspond one-to-one with each root key group;
[0075] S3, obtaining a file encryption root key K corresponding to the ciphertext file, and expanding the file encryption root key K to form an extended key corresponding to the key file according to a preset root key expansion algorithm and the length of the key file.
[0076] In a possible example, the first key extension parameter and the second key extension parameter are both 128-bit random numbers, which are concatenated in step S1 to form a 256-bit initial key K0; in step S2, they are expanded to form N corresponding file encryption root keys K c For example, if the number of key files N=3, namely M1, M2, and M3, then K1, K2, and K3, three corresponding file encryption root keys, are first expanded. The specific key expansion algorithm can use, for example, the AES key expansion algorithm; when encrypting each key file, the expanded file encryption root key is further expanded based on the file length of the key file to be encrypted to form an encryption key consistent with the length of the key file; for example, the length of the key file M1 is 256 bits, and the length of the expanded file encryption root key K1 is 128 bits; when encrypting the key file M1, the corresponding file encryption root key K1 is first taken out, and then based on the preset root key expansion algorithm and the length of the key file M1, the file encryption root key K1 is expanded to an expanded key file of 256 bits, thereby encrypting the key file M1.
[0077] Calculate the combined hash value H4 of the first uplink root key plaintext file and the first downlink root key plaintext file in the root key group, and verify whether the hash value H4 is the same as the hash value H3 to verify whether the decryption key is correct; that is, select the first uplink and downlink root key plaintext file for a quick preliminary verification to determine whether the decryption key is correct;
[0078] The key to decryption relies on the second key expansion parameter from the root key center. Therefore, only legitimate devices that have passed identity authentication, the correct first key expansion parameter, the correct second key expansion parameter, and the key expansion algorithm can perform correct decryption. And because only the first key expansion parameter is retained in the quantum security terminal, even if it is leaked, it is difficult for outsiders to obtain the complete encryption and decryption keys, which improves overall security.
[0079] At the same time, according to the hash value Hk carried in each root key plaintext file, each root key plaintext file is hash-checked until all root key plaintext files are verified, and the root key plaintext files that have successfully been verified are recorded.
[0080] The hash value Hk used to further verify the correctness of each root key plaintext file obtained after decryption is generated by the root key center and the key distribution end when the key file is pre-injected into the quantum security device. The key plaintext files are carried in the root key plaintext file and encrypted together, ensuring its security and making it difficult to be tampered with. The correctness of each root key plaintext file obtained after decryption is guaranteed by further verifying the hash value Hk.
[0081] In the above process, the device ID and the first hash value in the verification request message are encrypted using the first key to form first encrypted data, and the first key extension parameter and the third hash value in the verification success message are encrypted using the second key to form second encrypted data. The first key and the second key are both pre-stored in the terminal and the key distribution end;
[0082] Since the first key and the second key are pre-stored in the terminal and the key distribution end, there is no need to transmit the key during the transmission of the verification request message and the verification success message, reducing the risk of key exposure;
[0083] For details on decrypting verification request messages and verification success messages, see Figure 4 , the method further comprises:
[0084] The quantum security device also sends the first key index to the key distribution terminal;
[0085] The root key center receives the first key index, determines the first key according to the first key index, and carries the second key index in a verification success response message;
[0086] The quantum security device receives a verification success response message sent from the root key center, determines the second key according to the second key index information in the verification success response message, and decrypts the second encrypted data; and quickly locates and searches for the first key and the second key used for decryption through the key index;
[0087] In one possible example, the first key, the second key, the first key extension parameter, and the second key extension parameter used for encryption are all true random numbers generated by a true random number generator to ensure their randomness, non-repeatability, and uniqueness;
[0088] In this embodiment, the root key file verification method first generates a verification request message by the quantum security device, which carries the device ID and the hash value of the root key ciphertext file. The root key center authenticates the quantum security device based on the hash value of the root key ciphertext file and the device ID in the received verification request message, and returns the hash value of the root key plaintext file and the key expansion parameter for decrypting the root key ciphertext file after the identity authentication is legal. The quantum security device obtains the decryption key based on the key expansion parameter to decrypt the root key ciphertext file to obtain the root key plaintext file, and performs a hash verification on it again. The root key center needs to perform identity authentication during this verification process to avoid illegal devices. access, and simultaneously verify the hash verification based on the root key ciphertext file and the root key plaintext file, effectively ensuring the integrity and correctness of the root key file; the quantum security device needs the root key center to provide key extension parameters when decrypting the root key ciphertext file, which avoids the situation where the decryption key and the root key plaintext file may be leaked at the same time when the key extension parameters are stored in the quantum security device, thereby improving the security of the root key file; the verification device of the present application mainly includes: a reading module and a verification module; wherein the reading module is used to read the attribute information corresponding to the root key file, and the verification module is used for hash verification. The combination of the two can verify the integrity and correctness of the stored root key file.
[0089] See also Figure 3 The root key file verification device in this embodiment includes: a reading module and a verification module; wherein the reading module is used to read the attribute information corresponding to the root key file and obtain the device ID, root key index, first key extension parameter, first key and second key corresponding to the root key ciphertext file;
[0090] The verification module is used to compare the calculated fourth hash value of the root key plaintext file with the third hash value received from the key distribution end; and when the fourth hash value is consistent with the third hash value, determine that the verification is successful; when the fourth hash value is inconsistent with the third hash value, determine that the verification fails.
[0091] The device further includes a traversal module for traversing the independent files of each root key file, decrypting each root key ciphertext file according to the calculated decryption key, and calculating the actual hash value information corresponding to each independent file in each root key plaintext file; the reading module is also used to read the reference hash value carried by each root key plaintext file;
[0092] The verification module is configured to compare the actual hash value information with the reference hash value information; and when the actual hash value information is consistent with the reference hash value information, determine that the verification is successful; when the actual hash value information is inconsistent with the reference hash value information, determine that the verification fails.
[0093] In addition, the apparatus further includes a decryption module configured to determine a decryption key using a key index and to concatenate the first key extension parameter and the second key extension parameter based on the received second key extension parameter to form an initial key;
[0094] The initial key is expanded to form an extended key according to a preset key expansion algorithm and the length of the root key file to decrypt the root key ciphertext file.
[0095] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A root key file verification method, characterized in that: The method comprises: The terminal reads the device ID and root key index corresponding to the root key ciphertext file based on the attribute information of the root key ciphertext file, and calculates the first hash value of the root key ciphertext file; generates a verification request message, carries the device ID and the first hash value in the verification request message, and sends the verification request message to the key distribution end; The key distribution end receives the verification request message, matches the root key file record according to the root key index in the verification request message, searches and determines the root key ciphertext file, root key plaintext file, device ID and first key extension parameter corresponding to the root key index based on the root key file record, calculates the second hash value corresponding to the found root key ciphertext file, and performs identity authentication on the terminal based on the comparison result of the first hash value and the second hash value, and whether the device ID in the verification request message matches the device ID in the root key file record. If the hash value comparison result is consistent and the device ID matches, the identity authentication is passed, and then the third hash value corresponding to the root key plaintext file is calculated. A verification success message is returned to the terminal, and the third hash value and the first key extension parameter are carried in the message. Otherwise, the identity authentication fails, and a verification failure message is returned to the terminal. If the terminal receives a verification success message from the key distribution end, it extracts the first key extension parameter and the third hash value corresponding to the root key plaintext file in the verification success message, splices the first key extension parameter with the second key extension parameter in the quantum security terminal to obtain a decryption key for decrypting the root key ciphertext file, obtains the root key plaintext file by decrypting the root key ciphertext file, and then calculates the fourth hash value corresponding to the root key plaintext file. Based on the comparison result of the fourth hash value information and the third hash value, it is determined whether the root key file is abnormal; otherwise, the root key ciphertext file is continued to be used for the verification process until the preset verification number threshold is reached.
2. The root key file verification method according to claim 1, wherein: The device ID and the first hash value in the verification request message are encrypted by the first key to form the first encrypted data, and the first key extension parameter and the third hash value in the verification success message are encrypted by the second key to form the second encrypted data. The first key and the second key are both pre-stored in the terminal and the key distribution end.
3. The root key file verification method according to claim 2, wherein: The method further comprises: The terminal sends the first key index to the key distribution end; The key distribution end receives the first key index, determines the first key according to the first key index, and carries the second key index in a verification success response message; The terminal receives a verification success response message sent from the key distribution end, and determines the second key according to the second key index information in the verification success response message to decrypt the second encrypted data.
4. The root key file verification method according to claim 1, wherein: The specific method for obtaining the decryption key for decrypting the root key ciphertext file includes: Concatenate the first key extension parameter and the second key extension parameter to form an initial key; The initial key is expanded to form an extended key of corresponding length according to a preset key expansion algorithm and the length of the root key file, thereby obtaining the extended key for decrypting the root key ciphertext file.
5. The root key file verification method according to claim 4, wherein: The root key ciphertext file includes a plurality of groups of uplink root key ciphertext files and downlink root key ciphertext files arranged in pairs, and the terminal obtains a first hash value by calculating a hash value of a first group of uplink root key ciphertext files and downlink root key ciphertext files in the root key ciphertext file; The root key center obtains the third hash value by calculating the combined hash value of the first group of uplink root key plaintext files and downlink root key plaintext files in the root key plaintext files.
6. The root key file verification method according to claim 5, wherein: Each uplink root key plaintext file and downlink root key plaintext file carries a corresponding reference hash value; The verification method further includes: The terminal calculates the hash value of each decrypted upstream root key plaintext file and downstream root key plaintext file, and verifies whether it is the same as the reference hash value to verify the correctness of each decrypted upstream root key plaintext file and downstream root key plaintext file.
7. A root key file verification device, used to execute the root key file verification method according to any one of claims 1 to 6, characterized in that: The device includes: a reading module and a verification module; wherein the reading module is used to read the attribute information corresponding to the root key file, and obtain the device ID, root key index, first key extension parameter, first key and second key corresponding to the root key ciphertext file; The verification module is used to compare the calculated fourth hash value of the root key plaintext file with the third hash value received from the key distribution end; and when the fourth hash value is consistent with the third hash value, determine that the verification is successful; when the fourth hash value is inconsistent with the third hash value, determine that the verification fails.
8. The root key file verification device according to claim 7, wherein: The device also includes a traversal module for traversing the independent files of each root key file, decrypting each root key ciphertext file according to the calculated decryption key, and calculating the actual hash value information corresponding to each independent file in each root key plaintext file; the reading module is also used to read the reference hash value carried by each root key plaintext file; The verification module is configured to compare the actual hash value information with the reference hash value information; and when the actual hash value information is consistent with the reference hash value information, determine that the verification is successful; when the actual hash value information is inconsistent with the reference hash value information, determine that the verification fails.
9. The root key file verification device according to claim 7 or 8, characterized in that: The apparatus further includes a decryption module configured to determine a decryption key using a key index and to concatenate the first key extension parameter and the second key extension parameter based on the received second key extension parameter to form an initial key; The initial key is expanded to form an extended key according to a preset key expansion algorithm and the length of the root key file to decrypt the root key ciphertext file.
Citation Information
Patent Citations
Key processing method and device, storage medium and processor
CN110874478A
Method and system for accessing quantum security device to base station
CN115276974A