Method and device for preventing ciphertext from replaying during quantum security key relay encryption

By using the chaotic packet number window to identify cipher text reproduction in quantum security key relay encrypted communication, the problem that the prior art cannot effectively resist cipher text reproduction attacks is solved, and the security and integrity of data transmission are guaranteed.

CN119544269AActive Publication Date: 2025-02-28MATRICTIME DIGITAL TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411555200.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-02-28
Estimated Expiration
2044-11-04

AI Technical Summary

Technical Problem

The existing quantum security key relay encrypted communication methods cannot effectively resist ciphertext replay attacks, resulting in the security and stability of network communication being threatened.

Method used

By obtaining the saved chaotic packet number window at the receiving end, and determining whether the ciphertext data is a playback ciphertext based on the positional relationship of the packet sequence number, the precise identification and exclusion of ciphertext data is achieved.

Benefits of technology

Effectively maintain the security and integrity of data transmission, prevent ciphertext replay attacks, and improve communication security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544269A_ABST
    Figure CN119544269A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for preventing ciphertext playback during quantum security key relay encryption. When the ciphertext data is received, the legality of the ciphertext data is firstly verified so as to ensure the integrity and the source reliability of the data carried in the ciphertext data, which is a basic step for subsequently determining whether the ciphertext data is the replayed ciphertext or not. Under the condition of determining that the received ciphertext data is legal, if the packet serial number is located in the stored disordered packet serial number window and the ciphertext data carrying the packet serial number has been successfully processed, determining that the ciphertext data is a replayed ciphertext; and if the packet serial number is located in front of the disordered packet serial number window, determining that the ciphertext data is a replayed ciphertext. Through the mechanism, the receiving end can accurately identify and exclude the replayed ciphertext data, so that the security and integrity of data transmission are effectively maintained. The preset disordered packet sequence number window provides a reasonable range, and allows a receiving end to flexibly process disordered data packets on the premise of not influencing data integrity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security and quantum encryption technology, and in particular to a method and device for preventing ciphertext replay during quantum secure key relay encryption. Background Art

[0002] With the rapid advancement of information technology, the issue of network communication security has become a focus of global attention. In this context, the global quantum security network, as an innovative network architecture, aims to use the unique advantages of quantum technology to provide unprecedented security for network communications. Among them, quantum secure key relay encryption communication, as the core communication method of the global quantum security network, plays a vital role.

[0003] Quantum secure key relay encrypted communication cleverly realizes key sharing and encrypted communication between any two quantum secure terminals that do not have direct symmetric keys by accessing the relay function of the base station and the quantum secure network. This communication mode not only greatly improves the security of the communication process, but also significantly enhances the flexibility and scalability of the network. Through quantum secure key relay encrypted communication, even if two quantum secure terminals in the global quantum secure network do not have pre-shared keys, quantum secure encrypted communication can be carried out quickly and securely when needed, thereby ensuring the confidentiality and integrity of the information.

[0004] However, despite the many advantages of quantum secure key relay encrypted communication, it still faces security threats that cannot be ignored in practical applications, especially replay attacks. Replay attacks are malicious behaviors in which attackers capture and repeatedly send legitimate ciphertext data, taking advantage of the fact that these data packets have been normally encrypted, so that they can pass the verification of the encryption layer and be decrypted smoothly. Once these replayed data packets are mistakenly passed to the business layer, they may cause confusion in business logic, misinterpretation of data, and even paralysis of the entire system, thus posing a serious threat to the security and stability of network communications.

[0005] In order to effectively deal with replay attacks, although a unique key can be assigned and used for each encrypted data during the encryption process, the so-called "one-time one-key" strategy, the decryption end needs to be able to reliably identify and decrypt these messages encrypted with different keys, while ensuring that each key is only used once during the decryption process. This not only increases the complexity and difficulty of communication, but also puts higher requirements on key management.

[0006] Therefore, how to prevent ciphertext replay attacks during quantum secure key relay encryption has become a key technical problem that needs to be urgently solved in the current construction of a global quantum secure network. Summary of the invention

[0007] The present application provides a method and device for preventing ciphertext replay during quantum secure key relay encryption, so as to solve the problem that the existing quantum secure key relay encryption communication method cannot effectively resist ciphertext replay attacks.

[0008] In a first aspect, the present application provides a method for preventing ciphertext replay during quantum security key relay encryption, the method being applied to any quantum security terminal added to a global quantum security network, the method comprising:

[0009] When it is determined that the received ciphertext data is legal, a saved reorderable packet sequence number window is obtained; wherein the range of the reorderable packet sequence number window is [qm, q], q is the maximum packet sequence number carried by the ciphertext data currently successfully processed from the sender, m is the preset window length, and both q and m are integers greater than 0;

[0010] If the packet sequence number is within the reorderable packet sequence number window, and the ciphertext data carrying the packet sequence number has been successfully processed, then the ciphertext data is determined to be a replayed ciphertext;

[0011] If the packet sequence number is located before the reorderable packet sequence number window, it is determined that the ciphertext data is a replayed ciphertext.

[0012] In a second aspect, the present application provides a device for preventing ciphertext replay during quantum security key relay encryption, the device being applied to any quantum security terminal added to a global quantum security network, the device comprising:

[0013] A first processing unit is configured to obtain a saved reorderable packet sequence number window when determining that the received ciphertext data is legal; wherein the range of the reorderable packet sequence number window is [qm, q], q is the maximum packet sequence number carried by the ciphertext data currently successfully processed from the sender, m is a preset window length, and both q and m are integers greater than 0;

[0014] The second processing unit is used to determine that the ciphertext data is replayed ciphertext if the packet sequence number is within the shuffleable packet sequence number window and the ciphertext data carrying the packet sequence number has been successfully processed; or, if the packet sequence number is before the shuffleable packet sequence number window, determine that the ciphertext data is replayed ciphertext.

[0015] In a third aspect, the present application also provides a quantum security terminal, including: a processor and a memory;

[0016] The processor is used to execute the method for preventing ciphertext replay during quantum secure key relay encryption as described above by calling the program or instruction stored in the memory.

[0017] In a fourth aspect, the present application also provides a computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute the method for preventing ciphertext replay during quantum secure key relay encryption as described.

[0018] In a fifth aspect, the present application also provides a computer program product, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method for preventing ciphertext replay during quantum secure key relay encryption as described above.

[0019] The beneficial effects of this application are as follows:

[0020] 1. When receiving ciphertext data, first verify the legitimacy of the ciphertext data to ensure the integrity and source reliability of the data carried in the ciphertext data, which is the basic step for subsequently determining whether the ciphertext data is a replayed ciphertext.

[0021] 2. When the received ciphertext data is determined to be legal, if the packet sequence number is within the saved reorderable packet sequence number window, and the ciphertext data carrying the packet sequence number has been successfully processed, the ciphertext data is determined to be replayed ciphertext; if the packet sequence number is before the reorderable packet sequence number window, the ciphertext data is determined to be replayed ciphertext. Through this mechanism, the receiving end can accurately identify and exclude replayed ciphertext data, thereby effectively maintaining the security and integrity of data transmission.

[0022] 3. The preset out-of-order packet sequence number window provides a reasonable range, allowing the receiver to flexibly handle out-of-order data packets without affecting data integrity. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0024] Figure 1 A schematic diagram of a process for preventing ciphertext replay during quantum secure key relay encryption provided by an embodiment of the present application;

[0025] Figure 2 A schematic diagram of a specific process for preventing ciphertext replay during quantum secure key relay encryption provided in an embodiment of the present application;

[0026] Figure 3 A schematic diagram of the structure of a device for preventing ciphertext replay during quantum secure key relay encryption provided by the present application;

[0027] Figure 4 A schematic diagram of the structure of a quantum security terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.

[0029] The global quantum security network can support secure and efficient quantum communication between any quantum security terminals connected to the global quantum security network, regardless of their geographical location. A core of the global quantum security network is to use the access base station as a communication hub to connect the quantum security terminal to the global quantum security network, and to achieve key relay between terminals connected to the quantum security network.

[0030] During the access process, when a quantum security terminal accesses an access base station, the access base station will assign a network access identifier to the quantum security terminal, that is, a unique terminal identifier of the entire quantum security network, to identify the quantum security terminal. The network access identifier carries information about the country, operator, region, cell, access base station, and quantum security terminal. With this network access identifier, the quantum security terminal can be identified in the global quantum security network through this network access identifier within the time range that the quantum security terminal has this network access identifier. Subsequently, the quantum security terminal can apply for services and request resources from the global quantum security network through the access base station.

[0031] In the key relay process, the sender will relay the key through the sender access base station through the quantum security network to the access base station of the decryption end, and then the decryption end access base station will forward the key to the decryption end, so as to ensure that a symmetric quantum security key is formed between the sender and the decryption end, and encryption and decryption communication can be achieved. The global quantum security network also includes a key center, which mainly distributes keys, i.e., quantum keys, to quantum security terminals connected to the global quantum security network.

[0032] Through this global quantum security network, the key relay process can be separated from the ciphertext data transmission process, thereby further improving the security of ciphertext data transmission. However, this quantum security key relay encryption communication method has the following problems:

[0033] During data transmission, attackers capture and repeatedly send legitimate ciphertext data, taking advantage of the fact that these ciphertext data have been normally encrypted, so that they can pass the verification of the receiving end encryption layer and be decrypted. Once these replayed data packets are mistakenly passed to the business layer, it may cause confusion in business logic, misinterpretation of data, and even paralysis of the entire system, thus posing a serious threat to the security and stability of network communications.

[0034] In order to solve the above problems, the present application provides a method and device for preventing ciphertext replay during quantum secure key relay encryption, so that under the quantum secure key relay encryption communication mode, the receiving end can effectively deal with ciphertext replay attacks and improve communication security.

[0035] Embodiment 1:

[0036] Figure 1 A schematic diagram of a process for preventing ciphertext replay during quantum secure key relay encryption provided in an embodiment of the present application, the process comprising:

[0037] S101: When it is determined that the received ciphertext data is legal, obtain the saved shuffled packet sequence number window; wherein the range of the shuffled packet sequence number window is [qm, q], q is the maximum packet sequence number carried by the ciphertext data currently successfully processed from the sender, m is the preset window length, and both q and m are integers greater than 0.

[0038] For any quantum security terminal that joins the global quantum security network, the quantum security terminal can serve as a receiving end to receive ciphertext data sent through a traditional network by another quantum security terminal that joins the global quantum security network (for the convenience of distinction, the quantum security terminal that sends ciphertext data is recorded as the sending end). At the same time, the quantum key relayed by the sending end can also be received through the global quantum security network. After receiving the ciphertext data, the receiving end can perform a legitimacy check on the ciphertext data. If it is determined that the ciphertext data passes the legitimacy check, it means that the ciphertext data is legal, but it is not certain whether the ciphertext data is a replayed ciphertext or a normally received ciphertext data, then the method for preventing ciphertext replay during quantum security key relay encryption provided by the present application is used to further determine whether the ciphertext data is a replayed ciphertext. If it is determined that the ciphertext data does not pass the legitimacy check, it means that the ciphertext data is legal and the ciphertext data cannot be a replayed ciphertext, then the ciphertext data is discarded.

[0039] In one example, the data carried in the encryption header of the ciphertext data can be verified to determine whether the ciphertext data is legal. The data carried in the encryption header includes, but is not limited to: the session index of the receiving end, the pairing index of the quantum key, and the packet number of the ciphertext data. The pairing index is used to indicate the receiving end to locate the quantum key corresponding to the ciphertext data from the relay key obtained from the global quantum security network. The packet number is used to indicate the order in which the current data packet is sent. Exemplarily, the receiving end and the sending end pre-agree on the hash algorithm of the encryption header, and the ciphertext data will carry the checksum of the encryption header determined by the sending end according to the hash algorithm (for the convenience of distinction, the checksum determined by the sending end can be expressed as K). After receiving the ciphertext data, the receiving end can determine the checksum of the encryption header based on the data carried in the encryption header according to the pre-agreement hash algorithm (for the convenience of distinction, the checksum determined by the receiving end can be expressed as K'). The receiving end determines whether the ciphertext data is legal by comparing whether the K' is consistent with the K carried in the ciphertext data. Specifically, if K' is consistent with K carried in the ciphertext data, the ciphertext data is determined to be legal; if K' is inconsistent with K carried in the ciphertext data, the ciphertext data is determined to be forged.

[0040] In a possible implementation, the receiving end may perform a format check on the encryption header of the received ciphertext data before performing a check and comparison on the encryption header, so as to promptly identify forged ciphertext whose format does not meet the requirements. For example, whether the data length carried by the encryption header meets the preset data length range, whether the data carried by the encryption header is of a pre-configured specified type, etc. The receiving end will further check and compare the encryption header of the ciphertext data only if it determines that the format of the encryption header of the ciphertext data passes the format check. If the receiving end determines that the format of the encryption header of the ciphertext data does not pass the format check, indicating that the ciphertext data is forged, the receiving end refuses to respond to the ciphertext data.

[0041] For example, when the device structure at the receiving end includes an encryption area, an isolation area, and a communication area, and the encryption area is connected to the isolation area, and the isolation area is connected to the communication area, the communication area of ​​the receiving end can pass the ciphertext data to the isolation area of ​​the receiving end after receiving the ciphertext data. The isolation area can perform a format check on the encryption header of the ciphertext data. When it is determined that the encryption header passes the format check, the isolation area will pass the ciphertext data to the encryption area to verify and compare the encryption header of the ciphertext data through the encryption area; when it is determined that the encryption header does not pass the format check, the isolation area can directly discard the forged ciphertext data, so that the forged ciphertext data will not enter the encryption area of ​​the receiving end, which is conducive to ensuring the security of the encryption area.

[0042] In actual application scenarios, the transmission between the receiving end and the sending end can be reliable order-preserving transmission or unreliable transmission. In reliable order-preserving transmission, the packet sequence numbers carried by the ciphertext data received by the receiving end from the sending end are continuous and each packet sequence number is unique and non-repetitive. Therefore, the receiving end can confirm whether the ciphertext data is a replayed ciphertext by comparing the packet sequence number. In unreliable transmission, problems such as network congestion and delay may be encountered, which may lead to unstable data transmission. In addition, there is also the risk of counterfeiters forging ciphertext data. In the face of this situation, the receiving end needs to take strict security measures to verify the packet sequence number to ensure that the legitimate ciphertext data will not be mistakenly discarded, and at the same time, it can accurately identify and exclude forged ciphertext data, thereby maintaining the security and integrity of data transmission. Specifically, when the receiving end determines that the received ciphertext data is legitimate, it will obtain the previously saved scrambled packet sequence number window associated with the sending end. Then, based on the positional relationship between the packet sequence number and the scrambled packet sequence number window, the receiving end can further determine whether the ciphertext data is a replayed ciphertext. The reorderable packet sequence number window can be used to support the determination of whether ciphertext data is replayed ciphertext in a reliable order-preserving transmission scenario, and can also support the determination of whether ciphertext data is replayed ciphertext in an unreliable transmission scenario.

[0043] The range of the reorderable packet sequence number window is set to [qm, q], where q represents the maximum packet sequence number carried by the ciphertext data currently successfully processed from the sender, and m is a preset window length, both of which are integers greater than 0. The reorderable packet sequence number window indicates that the receiving end can receive reordered ciphertext data within a certain packet sequence number range.

[0044] It should be noted that, in a reliable order-preserving transmission scenario, the window length of the out-of-order packet sequence number window may be 1.

[0045] In a possible implementation, the window length m of the reorderable packet sequence number window can be determined based on the number of ciphertext data that can be received within a preconfigured unit time length, for example, 300 ciphertext data can be received in one minute, and the maximum delayed reception time length of the ciphertext data, for example, 3 minutes. Exemplarily, the product between the number of ciphertext data that can be received within a unit time length and the maximum delayed reception time length of the ciphertext data is determined, and the product is determined as m.

[0046] S102: If the packet sequence number is within the reorderable packet sequence number window, and the ciphertext data carrying the packet sequence number has been successfully processed, then the ciphertext data is determined to be a replayed ciphertext.

[0047] S103: If the packet sequence number is located before the reorderable packet sequence number window, it is determined that the ciphertext data is a replayed ciphertext.

[0048] The following describes several situations for determining whether the ciphertext data is a replayed ciphertext based on the positional relationship between the packet sequence number and the reorderable packet sequence number window:

[0049] Case 1: The packet sequence number is within the reorderable packet sequence number window, and the ciphertext data carrying the packet sequence number has been successfully processed.

[0050] When the packet sequence number of the received ciphertext data falls within the reorderable packet sequence number window of [qm,q], and it is found that the ciphertext data corresponding to the packet sequence number has been successfully processed, this usually means that the ciphertext data is a replayed ciphertext. Because in a reliable transmission protocol, the same packet sequence number should not correspond to multiple different ciphertext data. Therefore, if the receiving end determines that the packet sequence number is within the reorderable packet sequence number window and has successfully processed the ciphertext data carrying the packet sequence number, it is determined that the ciphertext data is a replayed ciphertext.

[0051] Case 2: The packet sequence number is within the reorderable packet sequence number window, and the ciphertext data carrying the packet sequence number has not been successfully processed.

[0052] If the packet sequence number of the received ciphertext data is also within the reorderable packet sequence number window of [qm,q], but it is determined that the ciphertext data corresponding to the packet sequence number has not been successfully processed, then this is most likely a normal reorder reception situation. Therefore, if the receiving end determines that the packet sequence number is within the reorderable packet sequence number window and has not successfully processed the ciphertext data carrying the packet sequence number, then it is determined that the ciphertext data is not replayed ciphertext.

[0053] Case 3: The packet sequence number is located before the reorderable packet sequence number window.

[0054] When the packet sequence number of the received ciphertext data is less than qm, that is, it is located before the reorderable packet sequence number window, this usually indicates that the ciphertext data is an outdated data packet, which may be caused by network delay or error at the sender, or it may be a replayed ciphertext sent by a forger. In this case, regardless of whether the ciphertext data with the same packet sequence number has been successfully processed before, the ciphertext data is not suitable for subsequent processing as compliant ciphertext data. Therefore, if the receiving end determines that the packet sequence number is before the reorderable packet sequence number window, the receiving end can consider the ciphertext data to be a replayed ciphertext.

[0055] Case 4: The packet sequence number is located after the reorderable packet sequence number window.

[0056] When the packet sequence number of the ciphertext data is greater than the maximum packet sequence number in the current reorderable packet sequence number window, that is, the packet sequence number is after the reorderable packet sequence number window, since q in the current reorderable packet sequence number window represents the maximum packet sequence number carried by the ciphertext data from the sender that has been successfully processed, then the legal ciphertext data sent after q in the sending order should also be logically not processed by the receiving end. This means that if the packet sequence number carried by the received ciphertext data is greater than q, then this ciphertext data is likely to have arrived for the first time and has not been processed, so it may just be a normal out-of-order reception situation, or a normal reliable order-preserving transmission situation. Based on this, if the receiving end determines that the packet sequence number is after the reorderable packet sequence number window, it is determined that the ciphertext data is not a replayed ciphertext.

[0057] In a possible implementation manner, if it is determined based on the above embodiment that the ciphertext data is replayed ciphertext data, the ciphertext data is discarded.

[0058] In general, when sending ciphertext data, the sender will also relay the quantum key corresponding to the ciphertext data to the receiver through the global quantum security network, and the receiver can receive each quantum key relayed by each sender through the global quantum security network. When the receiver determines that the received ciphertext data is not a replayed ciphertext based on the above embodiment, the ciphertext data can be paired with the quantum key relayed to the receiver based on the pairing index carried in the encryption header of the ciphertext data. Pairing here refers to determining the quantum key carrying the pairing index. If the quantum key corresponding to the ciphertext data is found, the ciphertext data is decrypted based on the quantum key corresponding to the ciphertext data to obtain the plaintext data. If the quantum key corresponding to the ciphertext data is not found, the ciphertext data is cached until the quantum key corresponding to the ciphertext data is found.

[0059] After the receiving end successfully decrypts the ciphertext data and recovers the plaintext data, in order to ensure the correctness of the decryption process and the integrity and authenticity of the plaintext data, the receiving end can perform a hash check on the plaintext data (for example, a hash algorithm such as SHA-256, MD5, etc.). Only when it is determined that the plaintext data passes the hash check can it be determined that the ciphertext data is correctly decrypted, that is, the ciphertext data is successfully processed. If it is determined that the plaintext data does not pass the hash check, it means that the ciphertext data decryption failed, and the plaintext data is discarded.

[0060] In a possible implementation, after the ciphertext data is successfully processed based on the above embodiment, if the packet sequence number carried by the ciphertext data is greater than the maximum packet sequence number currently recorded, it is necessary to timely update the shuffled packet sequence number window according to the packet sequence number, that is, slide the shuffled packet sequence number window to the packet sequence number. For example, if the current packet sequence number is q+2 and the saved shuffled packet sequence number window is [qm, q], then the shuffled packet sequence number window [qm, q] is slid to q+2, and the shuffled packet sequence number window after sliding is [q-m+2, q+2]. For another example, if the current packet sequence number is q+1 and the saved shuffled packet sequence number window is [qm, q], then the shuffled packet sequence number window [qm, q] is slid to q+1, and the shuffled packet sequence number window after sliding is [q-m+1, q+1].

[0061] The beneficial effects of this application are as follows:

[0062] 1. When receiving ciphertext data, first verify the legitimacy of the ciphertext data to ensure the integrity and source reliability of the data carried in the ciphertext data, which is the basic step for subsequently determining whether the ciphertext data is a replayed ciphertext.

[0063] 2. When the received ciphertext data is determined to be legal, if the packet sequence number is within the saved reorderable packet sequence number window, and the ciphertext data carrying the packet sequence number has been successfully processed, the ciphertext data is determined to be replayed ciphertext; if the packet sequence number is before the reorderable packet sequence number window, the ciphertext data is determined to be replayed ciphertext. Through this mechanism, the receiving end can accurately identify and exclude replayed ciphertext data, thereby effectively maintaining the security and integrity of data transmission.

[0064] 3. The preset out-of-order packet sequence number window provides a reasonable range, allowing the receiver to flexibly handle out-of-order data packets without affecting data integrity.

[0065] Embodiment 2:

[0066] In order to ensure the legality of the ciphertext data, based on the above embodiment, in this application, determining that the ciphertext data is legal includes:

[0067] Based on the session index carried in the encryption header, an irreducible polynomial and an anti-counterfeiting true random number are obtained; wherein the sending end and the quantum security terminal pre-agree on the irreducible polynomial, the anti-counterfeiting true random number and the session indexes corresponding to the sending end and the quantum security terminal respectively;

[0068] Determine a Toplitz matrix based on the irreducible polynomial and the anti-counterfeiting true random number;

[0069] Performing hash calculation on the session index, the pairing index carried in the encryption header, and the packet sequence number through the Toplitz matrix to determine an anti-counterfeiting hash value H';

[0070] If it is determined that the H' is consistent with the H carried in the ciphertext data, then the ciphertext data is determined to be legal.

[0071] In the global quantum security network, it is crucial to ensure the security of quantum security key relay encryption communication and the integrity of data. To achieve this goal, any two quantum security terminals added to the global quantum security network need to pre-agree on key parameters such as irreducible polynomials, anti-counterfeiting true random numbers, and the session indexes corresponding to the two quantum security terminals before they officially conduct quantum security key relay encryption communication. Through these key parameters, combined with the characteristic data of the current session of the two quantum security terminals, the anti-counterfeiting mark required for each session of the two quantum security terminals is generated - the anti-counterfeiting hash value. This anti-counterfeiting hash value not only contains the characteristic information of the current session, but also incorporates the randomness of the irreducible polynomial and the anti-counterfeiting true random number, making it difficult for counterfeiters to generate valid hash values ​​only through simple algorithmic attacks. Even if counterfeiters can partially crack or forge the hash algorithm, they still cannot generate forged hash values ​​that can deceive the receiving end because they cannot accurately predict or copy the irreducible polynomial and the anti-counterfeiting true random number.

[0072] The method for the two quantum security terminals to pre-agree on these key parameters may be achieved by manually filling the two quantum security terminals with the key parameters.

[0073] Based on the above embodiment, after the two quantum security terminals that need to communicate have determined the irreducible polynomial, the anti-counterfeiting true random number and the session indexes of the two quantum security terminals respectively, they can perform formal quantum security key relay encryption communication.

[0074] Exemplarily, the following is an explanation through a specific quantum secure key relay encryption communication process:

[0075] When there is plaintext data to be sent to the receiving end at the sending end, the sending end obtains a quantum key for the plaintext data from a stored key pool. For example, the quantum key is determined from the stored key pool according to the data length of the plaintext data and a pre-configured encryption ratio. The encryption ratio is used to indicate the ratio between the length of the quantum key per bit and the length of the data that can be encrypted by the quantum key per bit.

[0076] Next, the sender can perform quantum encryption on the plaintext data based on the quantum key through a pre-configured quantum encryption algorithm to obtain ciphertext data. For example, the sender encrypts the plaintext data through the quantum key according to the encryption ratio and the pre-configured quantum encryption algorithm to obtain ciphertext data. The encryption header of the ciphertext data is determined based on the saved session index of the receiving end, the pairing index of the quantum key and the packet sequence number of the ciphertext data. The encryption header is assembled into the ciphertext data. Among them, the session index of the receiving end is used to indicate the irreducible polynomial and anti-counterfeiting true random number required for the receiving end to distinguish different sessions and locate the current session.

[0077] In order to prevent the ciphertext data from being forged, in this application, the sender will also determine the Toplitz matrix based on the irreducible polynomial and the anti-counterfeiting true random number. Through the Toplitz matrix, the feature information of the current session (including the session index, the pairing index and the packet sequence number) is hashed to determine the anti-counterfeiting hash value (for the convenience of description, the following embodiments may represent the anti-counterfeiting hash value determined by the sender as H).

[0078] For example, the irreducible polynomial p and the anti-counterfeiting true random number s are used as parameters to generate a Toplitz matrix, including:

[0079] 1) The number of rows and columns of the Toplitz matrix is ​​related to the degree of the irreducible polynomial p: Assume that the highest degree of p is n;

[0080] 2) The elements of the first row are equal to the elements of the anti-counterfeiting true random number s;

[0081] 3) Starting from the second row, the elements of each row are equal to the elements of the previous row shifted right by one position and multiplied by the coefficient of the irreducible polynomial p;

[0082] 4) For the anti-counterfeiting true random number s = [s0, s1, ..., s n-1 ] and the irreducible polynomial p = a0*x^0+a1*x^1+…+a n-1 *x^(n-1), the i-th row of the Toplitz matrix T will be [s i ,s i-1 *a0,s i-2 *a1,…,s i-n+1 *a n-2 ,s i-n *a n-1 ].

[0083] 5) According to the dimension of the Toplitz matrix, the size of the data block is determined, and then according to the size of the data block, the feature data after the session index, the pairing index and the packet sequence number are combined, for example, the combined feature data is expressed as session index ‖ pairing index ‖ packet sequence number length, etc., and divided into several data blocks. For example: M = [m0, m1, ...], where m represents the data block obtained by the division, and M is the combined feature data;

[0084] 6) Treat each data block as a column vector; for each data block, multiply it with the Toplitz matrix T and obtain the hash value of the first row of the multiplication result;

[0085] 7) Repeat step 6) above, perform multiplication on each data block, and combine the first row of each result to form the final hash value H(M) = [h0, h1, ...].

[0086] After the transmitting end obtains H based on the above embodiment, the H can be encapsulated into ciphertext data, and then the ciphertext data carrying H is sent to the receiving end through a traditional network.

[0087] At the same time, the sending end also needs to relay the quantum key to the receiving end through the global quantum security network. Exemplarily, the sending end will send the key index of the quantum key and the second network access identifier to the access base station (referred to as the first access base station) to which the sending end accesses. The first access base station obtains the quantum key from the key pool paired with the sending end based on the key index. Then, the first access base station relays the quantum key and the second network access identifier to the access base station (referred to as the second access base station) to which the receiving end accesses based on the second network access identifier. The second access base station can encrypt the quantum key and send it to the receiving end based on the second network access identifier.

[0088] For the receiving end, after receiving the ciphertext data sent by the sending end, the receiving end can parse the ciphertext data to obtain the session index, pairing index and packet sequence number carried in the encryption header of the ciphertext data. Then, the same method as the above-mentioned sending end is adopted, based on the session index, pairing index and packet sequence number, combined with the stored irreducible polynomial and anti-counterfeiting true random number, the legitimacy of the ciphertext data is verified to determine whether the ciphertext data is a forged ciphertext. Exemplarily, the receiving end obtains the session index carried in the encryption header of the ciphertext data, and then locates the irreducible polynomial and anti-counterfeiting true random number agreed in advance for the session according to the session index. Then, based on the irreducible polynomial and the anti-counterfeiting true random number, the Toplitz matrix is ​​determined. Through the Toplitz matrix, the session index, pairing index and packet sequence number carried in the encryption header of the ciphertext data are hashed to determine the anti-counterfeiting hash value (for the convenience of distinction, the anti-counterfeiting hash value determined by the receiving end in the following embodiments can be expressed as H').

[0089] Under normal circumstances, the method for determining the anti-counterfeiting hash value, the required irreducible polynomial and the anti-counterfeiting true random number are all secret information unique to the sender and the receiver. The two use the same method and can only calculate the same anti-counterfeiting hash value based on consistent data. For counterfeiters, since they cannot obtain the irreducible polynomial and anti-counterfeiting true random number used by the sender and the receiver to generate the anti-counterfeiting hash value, and the irreducible polynomial and anti-counterfeiting true random number are not transmitted during the quantum security key relay encryption communication process, it is difficult for counterfeiters to generate a valid hash value only by a simple algorithm attack, that is, to generate the same anti-counterfeiting hash value as the receiver. Therefore, in this application, after obtaining H', the receiver can compare H' with the H carried by the ciphertext data to ensure the authenticity and integrity of the ciphertext data. If H is consistent with H', it means that the ciphertext data is indeed generated by the sender, and the ciphertext data is determined to be legal. If H is inconsistent with H', it means that the ciphertext data may be forged by a counterfeiter, and the ciphertext data is determined to be a forged ciphertext.

[0090] Embodiment 3:

[0091] The following is a description of a method for preventing ciphertext replay during quantum secure key relay encryption provided by the present application through a specific embodiment. Figure 2 A schematic diagram of a specific process for preventing ciphertext replay during quantum secure key relay encryption provided in an embodiment of the present application, the process includes:

[0092] S201: receiving ciphertext data sent by a sender.

[0093] S202: Determine whether the ciphertext data passes the legality check. If it is determined that the ciphertext data is legal, execute S203; otherwise, execute S212.

[0094] In a possible implementation, determining whether the ciphertext data is legal includes:

[0095] Based on the session index carried in the encryption header, an irreducible polynomial and an anti-counterfeiting true random number are obtained; wherein the sender and the quantum security terminal pre-agree on an irreducible polynomial, an anti-counterfeiting true random number, and a session index corresponding to the sender and the quantum security terminal respectively;

[0096] Determine the Toplitz matrix based on irreducible polynomials and anti-counterfeiting true random numbers;

[0097] The session index, the pairing index and the packet sequence number carried in the encryption header are hashed through the Toplitz matrix to determine the anti-counterfeiting hash value H';

[0098] If it is determined that H' is consistent with H carried in the ciphertext data, then the ciphertext data is determined to be legal;

[0099] If it is determined that H' is inconsistent with H carried in the ciphertext data, it is determined that the ciphertext data is a forged ciphertext.

[0100] S203: Obtain the out-of-order packet sequence number window associated with the sender.

[0101] The range of the out-of-order packet sequence number window is [qm, q], where q is the maximum packet sequence number carried by the ciphertext data currently successfully processed from the sender, and m is the preset window length. Both q and m are integers greater than 0.

[0102] S204: If the packet sequence number is within the reorderable packet sequence number window, and the ciphertext data carrying the packet sequence number has been successfully processed, the ciphertext data is determined to be replayed ciphertext, and S212 is executed.

[0103] S205: If the packet sequence number is located before the reorderable packet sequence number window, it is determined that the ciphertext data is a replayed ciphertext, and S212 is executed.

[0104] S206: If the packet sequence number is within the reorderable packet sequence number window, and the ciphertext data carrying the packet sequence number has not been successfully processed, it is determined that the ciphertext data is not a replayed ciphertext, and S208 is executed.

[0105] S207: If the packet sequence number is located after the reorderable packet sequence number window, it is determined that the ciphertext data is not a replayed ciphertext.

[0106] S208: Based on the pairing index carried by the encryption header, the ciphertext data is paired with the quantum key relayed to the quantum security terminal through the global quantum security network to determine the quantum key corresponding to the ciphertext data, and the ciphertext data is decrypted by the quantum key corresponding to the ciphertext data to obtain the plaintext data.

[0107] S209: When it is determined that the plaintext data passes the hash check, it is determined that the ciphertext data is successfully processed.

[0108] S210: Determine whether the packet sequence number is greater than the maximum packet sequence number, if so, execute S211, otherwise, execute S201.

[0109] S211: Slide the reorderable packet sequence number window to the packet sequence number and execute S201.

[0110] S212: discard the ciphertext data and execute S201.

[0111] Embodiment 4:

[0112] Based on the same inventive concept, the present application also provides a device for preventing ciphertext replay during quantum security key relay encryption, which is applied to a sending end that joins a global quantum security network. Figure 3A schematic diagram of a device for preventing ciphertext replay during quantum secure key relay encryption provided by the present application, the device comprising:

[0113] The first processing unit 31 is used to obtain a saved reorderable packet sequence number window when determining that the received ciphertext data is legal; wherein the range of the reorderable packet sequence number window is [qm, q], q is the maximum packet sequence number carried by the ciphertext data currently successfully processed from the sender, m is a preset window length, and both q and m are integers greater than 0;

[0114] The second processing unit 32 is used to determine that the ciphertext data is replayed ciphertext if the packet sequence number is within the shuffled packet sequence number window and the ciphertext data carrying the packet sequence number has been successfully processed; or, if the packet sequence number is before the shuffled packet sequence number window, determine that the ciphertext data is replayed ciphertext.

[0115] In some possible implementations, the second processing unit 32 is further used to determine that the ciphertext data is not a replayed ciphertext if the packet sequence number is within the shuffled packet sequence number window and the ciphertext data carrying the packet sequence number has not been successfully processed; or, if the packet sequence number is after the shuffled packet sequence number window, determine that the ciphertext data is not a replayed ciphertext.

[0116] In some possible implementations, the device further includes: an encryption and decryption unit;

[0117] The encryption and decryption unit is used to pair the ciphertext data with the quantum key relayed to the quantum security terminal through the global quantum security network based on the pairing index carried by the encryption header to determine the quantum key corresponding to the ciphertext data; decrypt the ciphertext data through the quantum key corresponding to the ciphertext data to obtain plaintext data; and when it is determined that the plaintext data passes the hash check, record that the ciphertext data is successfully processed.

[0118] In some possible implementations, the first processing unit 31 is further configured to slide the re-orderable packet sequence number window to the packet sequence number when the packet sequence number is greater than the maximum packet sequence number.

[0119] In some possible implementations, m is determined based on the amount of ciphertext data that can be received within a preconfigured unit time length and the maximum delayed reception time length of the ciphertext data.

[0120] In some possible implementations, the first processing unit 31 is specifically used to obtain an irreducible polynomial and an anti-counterfeiting true random number based on the session index carried in the encryption header; wherein the sending end and the quantum security terminal pre-agree on the irreducible polynomial, the anti-counterfeiting true random number and the session index corresponding to the sending end and the quantum security terminal respectively; based on the irreducible polynomial and the anti-counterfeiting true random number, a Toplitz matrix is ​​determined; through the Toplitz matrix, a hash calculation is performed on the session index, the pairing index carried in the encryption header, and the packet sequence number to determine the anti-counterfeiting hash value H'; if it is determined that H' is consistent with H carried in the ciphertext data, the ciphertext data is determined to be legal.

[0121] It should be noted that the principle of the device for preventing ciphertext replay during quantum secure key relay encryption provided in this embodiment to solve the technical problem is the same as the principle of solving the technical problem in the above method embodiment, and the repeated parts will not be repeated.

[0122] Embodiment 5:

[0123] Based on the above embodiments, the present application also provides a quantum security terminal. Figure 4 A schematic diagram of the structure of a quantum security terminal provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, it includes: a processor 41, a communication interface 42, a memory 43 and a communication bus 44, wherein the processor 41, the communication interface 42, and the memory 43 communicate with each other through the communication bus 44;

[0124] The memory 43 stores a computer program. When the program is executed by the processor 41, the processor 41 can perform the following steps:

[0125] When it is determined that the received ciphertext data is legal, a saved reorderable packet sequence number window is obtained; wherein the range of the reorderable packet sequence number window is [qm, q], q is the maximum packet sequence number carried by the ciphertext data currently successfully processed from the sender, m is the preset window length, and both q and m are integers greater than 0;

[0126] If the packet sequence number is within the reorderable packet sequence number window, and the ciphertext data carrying the packet sequence number has been successfully processed, then the ciphertext data is determined to be a replayed ciphertext;

[0127] If the packet sequence number is located before the reorderable packet sequence number window, it is determined that the ciphertext data is a replayed ciphertext.

[0128] Since the principle of solving the problem by the above-mentioned quantum security terminal is similar to the method for preventing ciphertext replay during quantum security key relay encryption, the implementation of the above-mentioned quantum security terminal can refer to the embodiment of the method, and the repeated parts will not be repeated.

[0129] Embodiment 6:

[0130] On the basis of the above embodiments, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program executable by a processor is stored. When the program runs on the processor, the processor implements the following steps when executing:

[0131] When it is determined that the received ciphertext data is legal, a saved reorderable packet sequence number window is obtained; wherein the range of the reorderable packet sequence number window is [qm, q], q is the maximum packet sequence number carried by the ciphertext data currently successfully processed from the sender, m is the preset window length, and both q and m are integers greater than 0;

[0132] If the packet sequence number is within the reorderable packet sequence number window, and the ciphertext data carrying the packet sequence number has been successfully processed, then the ciphertext data is determined to be a replayed ciphertext;

[0133] If the packet sequence number is located before the reorderable packet sequence number window, it is determined that the ciphertext data is a replayed ciphertext.

[0134] Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to the method for preventing ciphertext replay during quantum secure key relay encryption, the implementation of the above-mentioned computer-readable storage medium can refer to the embodiment of the method, and the repeated parts will not be repeated.

Claims

1. A method for preventing ciphertext replay during quantum secure key relay encryption, characterized in that: The method is applied to any quantum security terminal added to the global quantum security network, and the method comprises: When it is determined that the received ciphertext data is legal, a saved reorderable packet sequence number window is obtained; wherein the range of the reorderable packet sequence number window is [qm, q], q is the maximum packet sequence number carried by the ciphertext data currently successfully processed from the sender, m is the preset window length, and both q and m are integers greater than 0; If the packet sequence number is within the reorderable packet sequence number window, and the ciphertext data carrying the packet sequence number has been successfully processed, then the ciphertext data is determined to be a replayed ciphertext; If the packet sequence number is located before the reorderable packet sequence number window, it is determined that the ciphertext data is a replayed ciphertext.

2. The method according to claim 1, characterized in that The method further comprises: If the packet sequence number is within the reorderable packet sequence number window, and the ciphertext data carrying the packet sequence number has not been successfully processed, it is determined that the ciphertext data is not a replayed ciphertext; If the packet sequence number is located after the reorderable packet sequence number window, it is determined that the ciphertext data is not a replayed ciphertext.

3. The method according to claim 2, characterized in that The method further comprises: Based on the pairing index carried by the encryption header, pairing the ciphertext data with the quantum key relayed to the quantum security terminal through the global quantum security network to determine the quantum key corresponding to the ciphertext data; Decrypting the ciphertext data using the quantum key corresponding to the ciphertext data to obtain plaintext data; When it is determined that the plaintext data passes the hash check, it is recorded that the ciphertext data is successfully processed.

4. The method according to claim 3, characterized in that The method further comprises: When the packet sequence number is greater than the maximum packet sequence number, the reorderable packet sequence number window is slid to the packet sequence number.

5. The method according to claim 1, characterized in that The m is determined according to the amount of ciphertext data that can be received within a pre-configured unit time length and the maximum delayed reception time length of the ciphertext data.

6. The method according to claim 1, characterized in that Determining that the ciphertext data is legal includes: Based on the session index carried in the encryption header, an irreducible polynomial and an anti-counterfeiting true random number are obtained; wherein the sending end and the quantum security terminal pre-agree on the irreducible polynomial, the anti-counterfeiting true random number and the session indexes corresponding to the sending end and the quantum security terminal respectively; Determine a Toplitz matrix based on the irreducible polynomial and the anti-counterfeiting true random number; Performing hash calculation on the session index, the pairing index carried in the encryption header, and the packet sequence number through the Toplitz matrix to determine an anti-counterfeiting hash value H'; If it is determined that the H' is consistent with the H carried in the ciphertext data, then the ciphertext data is determined to be legal.

7. A device for preventing ciphertext replay during quantum secure key relay encryption, characterized in that: The device is applied to any quantum security terminal added to the global quantum security network, and the device includes: A first processing unit is configured to obtain a saved reorderable packet sequence number window when determining that the received ciphertext data is legal; wherein the range of the reorderable packet sequence number window is [qm, q], q is the maximum packet sequence number carried by the ciphertext data currently successfully processed from the sender, m is a preset window length, and both q and m are integers greater than 0; The second processing unit is used to determine that the ciphertext data is replayed ciphertext if the packet sequence number is within the shuffleable packet sequence number window and the ciphertext data carrying the packet sequence number has been successfully processed; or, if the packet sequence number is before the shuffleable packet sequence number window, determine that the ciphertext data is replayed ciphertext.

8. A quantum security terminal, characterized in that: include: Processor and memory; The processor is used to execute the method for preventing ciphertext replay during quantum secure key relay encryption as described in any one of claims 1 to 6 by calling the program or instruction stored in the memory.

9. A computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute the method for preventing ciphertext replay during quantum secure key relay encryption as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Replay attack prevention method and device

    CN109756460A

  • Universe quantum security equipment and system

    CN115001686A

  • Anti-playback method and device

    CN115225334A

  • Data dynamic updating method and device, computer equipment, medium and product

    CN115913770A

  • Network anti-replay method and device, electronic equipment and storage medium

    CN116137573A