An information synchronization exchange method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202510007672.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2045-01-03
AI Technical Summary
但这种信息交换方式存在显著的公平性问题,若其中一方接收到另一方传输的密文和解密密钥后,却不向对方提供自己的解密密钥或提供错误的解密密钥,则会导致一方获益而另一方无法正确解密
[0133]1.双方可实现数据的同步交换,即一方在获得对方密钥、解密对方密文并获取明文信息的同时,另一方也可同步完成对等操作。
Smart Images

Figure CN119814284B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of data security technology, and in particular to an information synchronization exchange method, apparatus, electronic device and storage medium. Background Technology
[0002] In general, when parties A and B need to exchange information, they typically encrypt their respective messages, then transmit the ciphertext and decryption key to each other. Finally, they use the key to decrypt the ciphertext and obtain the plaintext. However, this method of information exchange has a significant fairness issue. If one party receives the ciphertext and decryption key from the other but fails to provide its own decryption key or provides an incorrect one, one party will benefit while the other party cannot decrypt correctly. Summary of the Invention
[0003] This invention provides a method, apparatus, electronic device, and storage medium for synchronous information exchange, which can realize the synchronous exchange of information between communicating parties, avoid the consequence of one party benefiting while the other party suffers losses, and thus ensure the fairness of information exchange.
[0004] In a first aspect, embodiments of the present invention provide an information synchronization and exchange method, comprising:
[0005] They exchange ciphertexts corresponding to their respective information to be transmitted with the other end of the communication through a symmetric encryption algorithm.
[0006] They exchange hash values of their respective random information with the peer using an asymmetric encryption algorithm;
[0007] The two parties exchange multiple sets of ciphertext combinations using a symmetric encryption algorithm. Each set of ciphertext combinations is obtained by encrypting the hash value of its own information to be transmitted and the hash value of the other party's random information using each of its multiple sets of keys. Each set of keys is generated based on the symmetric key used to encrypt the information to be transmitted.
[0008] By transmitting the key in split form, the two parties exchange multiple sets of keys with each other, so that both parties can verify the correctness of the key based on the received key and the combination of multiple sets of ciphertext.
[0009] If the verification is successful, the information to be transmitted by the peer is determined based on the multiple sets of keys of the peer and the ciphertext to be transmitted by the peer.
[0010] Secondly, embodiments of the present invention provide an information synchronization and exchange device, comprising:
[0011] The first exchange module is used to exchange the ciphertext to be transmitted corresponding to the information to be transmitted with the other end of the communication through a symmetric encryption algorithm;
[0012] The second exchange module is used to exchange the hash values of their respective random information with the peer through an asymmetric encryption algorithm.
[0013] The third exchange module is used to exchange multiple sets of ciphertext combinations with the peer through a symmetric encryption algorithm. Each set of ciphertext combinations is obtained by encrypting the hash value of its own information to be transmitted and the hash value of the random information of the other party through each of its multiple sets of keys. Each set of keys is generated based on the symmetric key used to encrypt the information to be transmitted.
[0014] The fourth exchange module is used to exchange multiple sets of keys with the peer by transmitting the key in a split manner, so that both parties can verify the correctness of the key based on the received key and the received multiple sets of ciphertext.
[0015] The decryption module is used to determine the information to be transmitted by the peer based on multiple sets of keys of the peer and the ciphertext to be transmitted by the peer, if the verification is successful.
[0016] Thirdly, embodiments of the present invention provide an electronic device, comprising:
[0017] At least one processor; and
[0018] A memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method as described in the first aspect.
[0020] Fourthly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0021] In this invention, both communicating parties use their respective multiple sets of keys to encrypt the hash value of their own transmitted information and the hash value of the other party's random information, resulting in multiple ciphertext combinations. Through the exchange and transmission of these ciphertext combinations, and the splitting and exchange of their respective multiple sets of keys, both parties can verify the correctness of the keys transmitted by the other. If verification is successful, both parties can determine the other party's transmitted information based on the received key and the other party's transmitted ciphertext. This scheme enables synchronous exchange of transmitted information. During the information exchange process, key correctness can be verified, ensuring that either party can promptly detect fraudulent activities or errors during transmission, preventing one party from benefiting at the expense of the other, and thus guaranteeing the fairness of the information exchange.
[0022] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart of an information synchronization and exchange method provided according to Embodiment 1 of the present invention;
[0025] Figure 2 This is a flowchart of an information synchronization and exchange method provided according to Embodiment 2 of the present invention;
[0026] Figure 3 This is a flowchart of an information synchronization and exchange method provided in Embodiment 3 of the present invention;
[0027] Figure 4 This is a schematic diagram of the structure of an information synchronization and exchange device according to Embodiment 4 of the present invention;
[0028] Figure 5 This is a schematic diagram of the structure of an electronic device that implements an embodiment of the present invention. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first," "second," etc., used in this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] Example 1
[0032] Figure 1 This is a flowchart of an information synchronization exchange method according to Embodiment 1 of the present invention. This embodiment is applicable to situations involving synchronous information exchange with a communication peer. The method can be executed by an information synchronization exchange device, which can be implemented in software and / or hardware and integrated into an electronic device. Furthermore, the electronic device includes, but is not limited to, computers, laptops, etc.
[0033] like Figure 1 As shown, the method includes:
[0034] S110. Exchange the ciphertext corresponding to the information to be transmitted with the other end of the communication through a symmetric encryption algorithm.
[0035] In this embodiment of the invention, the electronic device needs to synchronously exchange the information to be transmitted with the communication peer. The electronic device in this embodiment can be considered as device A, and the peer communicating with device A can be considered as device B. Device B can be a device capable of interacting with device A, such as a computer or laptop computer, and is not limited here.
[0036] The information to be transmitted can be information to be transmitted to the other party in the communication. For example, if the information to be transmitted is information that device A needs to transmit to device B, denoted as M. A For example, if the information to be transmitted is information that device B needs to transmit to device A, denoted as M. B The specific content of the information to be transmitted is not limited. The ciphertext to be transmitted can be the ciphertext obtained by encrypting the information to be transmitted using a symmetric encryption algorithm.
[0037] Symmetric encryption algorithms are those in which the sender and receiver use the same key to encrypt and decrypt data; that is, the encryption and decryption keys are identical. They mainly include two categories: stream ciphers and block ciphers. This invention does not specify a particular symmetric encryption algorithm; any symmetric encryption algorithm that meets the protocol flow and security requirements is acceptable, but device A and device B must use the same symmetric encryption algorithm. Optionally, the symmetric encryption algorithm can be the Chinese national standard SM4 algorithm.
[0038] In this step, device A randomly generates a key for the symmetric encryption algorithm Enc(), and uses the same key for encryption and decryption, denoted as keyA; then, keyA and Enc() are used to encrypt M. A Get M A The corresponding ciphertext Enc to be transmitted keyA (M A ), and transmit the ciphertext Enc keyA (M A Transmitted to device B.
[0039] Similarly, device B randomly generates a key for the symmetric encryption algorithm Enc(), and uses the same key for encryption and decryption, denoted as keyB; M is then encrypted using keyB and Enc(). B Get M B The corresponding ciphertext to be transmitted, Enc keyB (M B ), and transmit the ciphertext Enc keyB (M B Transmitted to device A.
[0040] At this point, device A and device B, i.e., the two communicating parties, have exchanged the ciphertext corresponding to their respective information to be transmitted.
[0041] S120. Exchange the hash values of their respective random information with the peer using an asymmetric encryption algorithm.
[0042] Asymmetric encryption algorithms, also known as public-key encryption algorithms, use a pair of mathematically related keys to perform encryption and decryption. This pair consists of a public key and a private key. The public key is used for encryption and is publicly available; the private key is used for decryption and is kept secret, and the decryption key cannot be derived from the encryption key. This invention does not specify a particular asymmetric encryption algorithm; any asymmetric encryption algorithm that meets the protocol flow and security requirements is acceptable, but device A and device B must use the same asymmetric encryption algorithm. Optionally, the asymmetric encryption algorithm can be a lattice cipher.
[0043] Random information can be randomly generated, and its specific content is not limited. The random information of device A can be denoted as m. A The random information of device B can be denoted as m. B .
[0044] The hash value of random information can be obtained by processing the random information using a hash function (also known as a hash algorithm). A hash function can process and transform input data of any length and output a string of fixed length. This invention does not specify a particular hash algorithm, as long as it meets the functional and security requirements of the hash algorithm, but device A and device B must use the same hash algorithm. Optionally, the hash algorithm can be the Chinese national cryptographic hash algorithm SM3.
[0045] In this step, device A randomly generates a public-private key pair (pk) for the asymmetric encryption algorithm Enc'(). A ,sk A ), where the public key pk A Send to device B, private key sk A Store it safely. Similarly, device B randomly generates a public-private key pair (pk) for the asymmetric encryption algorithm Enc'(). B ,sk B ), where the public key pk B Send to device A, private key sk B Store properly.
[0046] Device A generates random information m A m is generated using the hash algorithm H() A Hash value H(m) A Using the asymmetric encryption algorithm Enc'() and public key pk B Encrypt H(m) A )get Will Send to device B, H(m) A Store it properly. Similarly, device B generates random information m. B m is generated using the hash algorithm H() B Hash value H(m) B Using the asymmetric encryption algorithm Enc'() and public key pk A Encrypt H(m) B )get Will Send to device A, H(m) B Keep it safe.
[0047] Device A uses the asymmetric encryption algorithm and its corresponding asymmetric decryption algorithm Dec'() and the private key sk. A Decryption get Similarly, device B uses Dec'() and the private key sk B Decryption get
[0048]
[0049] At this point, the two communicating parties have exchanged the hash values of their respective random information.
[0050] S130. Exchange multiple sets of ciphertext combinations with the peer through a symmetric encryption algorithm. Each set of ciphertext combinations is obtained by encrypting the hash value of its own information to be transmitted and the hash value of the other party's random information using each of its multiple sets of keys. Each set of keys is generated based on the symmetric key used to encrypt the information to be transmitted.
[0051] In one embodiment, each of the multiple sets of keys includes a random key and a post-processed key. The post-processed key is the result of an XOR operation between the random key and the symmetric key used to encrypt the information to be transmitted. The random key is used to encrypt the hash value of the information to be transmitted, and the post-processed key is used to encrypt the hash value of the other party's random information. The random key can be a randomly generated key using a symmetric encryption algorithm, and is not limited here. The post-processed key is the result of an XOR operation between the random key and the key used to symmetrically encrypt the information to be transmitted in S110 (i.e., the symmetric key).
[0052] In this step, device A generates n sets of keys for a symmetric encryption algorithm (n is not limited), and the n sets of keys are represented as {(a1,a1′),(a2,a′2),…,(an,a′n)}, where a i A random key. For a i The corresponding keys after the operation, i = 1, 2, ..., n, This represents a bitwise XOR operation; the information M to be transmitted is generated using the hash algorithm H(). A Hash value H(M) A ); combining symmetric encryption algorithms and random key a i Encrypt H(M) A )get Using the key a after the operation i Encryption H(m) B )get Obtain n sets of ciphertext combinations Transmit the obtained n sets of ciphertext combinations to device B.
[0053] Similarly, device B generates n sets of keys for a symmetric encryption algorithm (n is not limited), and the n sets of keys are represented as {(b1,b1′),(b2,b2′),…,(bn,bn′)}, where b i A random key. For b i The corresponding processed key, i = 1, 2, ..., n; the information M to be transmitted is generated using the hash algorithm H(). BHash value H(M) B ); combining symmetric encryption algorithms and random key b i Encrypt H(M) B )get Using the key b after computation i Encryption H(m) A )get This leads to n combinations of ciphertext. Transmit the obtained n sets of ciphertext combinations to device A.
[0054] At this point, the two parties have exchanged multiple sets of ciphertext combinations.
[0055] S140. Exchange multiple sets of keys with the peer by transmitting the key in a split manner, so that both parties can verify the correctness of the key based on the received key and the received multiple sets of ciphertext.
[0056] In this step, there are no restrictions on the method of splitting and transmitting multiple sets of keys. For example, it can be based on the unintentional transmission protocol, or it can be that the multiple sets of keys are converted into corresponding binary bits and transmitted in the order of the binary bits, or it can be a combination of the above two methods.
[0057] The Oblivious Transfer (OT) protocol is a cryptographic protocol widely used in the field of secure multi-party computation. This invention employs a 2-to-1 oblivious transfer protocol, where the sender sends two messages to the receiver, and the receiver can selectively receive either message using a single selection bit. Simultaneously, the sender cannot determine which message the receiver has received, and the receiver cannot determine which message was not received.
[0058] In this step, device A can transmit n sets of keys {(a1,a1′),(a2,a′2),…,(a1′,a2 ... n ,a′ n The key in}; similarly, device B can transmit n sets of keys {(b1,b1′),(b2,b2′),…,(b} to device A via a 2-to-1 unintentional transmission protocol. n ,b n The key in ′)} is partially obtained; at this point, both parties have obtained a portion of the other party's key, and can use the obtained partial key to decrypt the corresponding ciphertext in multiple ciphertext combinations of the other party, and verify the correctness of the obtained partial key.
[0059] Device A can convert its n sets of keys into corresponding binary bits and transmit them to Device B in binary bit order, one binary bit at a time. Similarly, Device B can convert its n sets of keys into corresponding binary bits and transmit them to Device A in binary bit order, one binary bit at a time. When the two communicating parties exchange binary bits from multiple sets of keys, they can verify the correctness of each other's multiple sets of keys based on the received binary bits, the unintentional transmission of a portion of the received key in a 2-to-1 choice, and the ciphertext in the other party's multiple ciphertext combinations.
[0060] During the above verification process, if the verification fails, the key transmission can be stopped, preventing the other party from obtaining its complete key; if the verification succeeds, the transmission continues until multiple sets of keys have been transmitted.
[0061] S150. If the verification is successful, determine the information to be transmitted by the peer based on the multiple sets of keys of the peer and the ciphertext to be transmitted by the peer.
[0062] In this step, after device A verifies that the multiple sets of keys transmitted by device B are correct, since the multiple sets of keys transmitted by device B are based on the information M to be transmitted by device B... B If an encrypted symmetric key is generated, then device A can determine device B's connection to M using multiple sets of keys transmitted by device B. B The encryption symmetric key is used to determine the information to be transmitted by device B based on the determined symmetric key and the ciphertext to be transmitted transmitted by device B. Similarly, device B can determine the information to be transmitted by device A using multiple sets of keys transmitted by device A and the ciphertext to be transmitted transmitted by device A.
[0063] In one embodiment, determining the information to be transmitted by the peer based on multiple sets of keys from the peer and the ciphertext to be transmitted from the peer includes: performing an XOR operation on any set of keys from the peer's multiple sets of keys, including a random key and a key after computation, to obtain a symmetric key for encrypting the information to be transmitted from the peer; and decrypting the ciphertext to be transmitted from the peer using a symmetric decryption algorithm based on the symmetric key obtained by the XOR operation to obtain the information to be transmitted from the peer.
[0064] Specifically, device A can transmit n sets of keys {(b1,b1′),(b2,b2′),…,(b...} to device B. n ,b n Choose any pair (bi, bi′) from ′)} to determine the information M to be transmitted by device B. B The symmetric key for encryption is Using the symmetric decryption algorithm Dec() and key B Decrypting the ciphertext Enc to be transmitted from device B keyB (M B), obtain the information M to be transmitted from device B. B =Dec keyB (Enc keyB (M B )).
[0065] Similarly, device B can transmit n sets of keys {(a1,a1′),(a2,a′2),…,(a1′ ... n ,a′ n Take any pair (ai, ai′) from} to determine the information M to be transmitted by device A. A The symmetric key for encryption is Using the symmetric decryption algorithm Dec() and key A Decrypt the ciphertext Enc to be transmitted from device A keyA (M A ), obtain the information M to be transmitted from device A. A =Dec keyA (Enc keyA (M A )).
[0066] At this point, both parties have successfully exchanged their respective information to be transmitted.
[0067] In this invention, both communicating parties use their respective multiple sets of keys to encrypt the hash value of their own transmitted information and the hash value of the other party's random information, resulting in multiple ciphertext combinations. Through the exchange and transmission of these ciphertext combinations, and the splitting and exchange of their respective multiple sets of keys, both parties can verify the correctness of the keys transmitted by the other. If verification is successful, both parties can determine the other party's transmitted information based on the received key and the other party's transmitted ciphertext. This scheme enables synchronous exchange of transmitted information. During the information exchange process, key correctness can be verified, ensuring that either party can promptly detect fraudulent activities or errors during transmission, preventing one party from benefiting at the expense of the other, and thus guaranteeing the fairness of the information exchange.
[0068] Example 2
[0069] Figure 2 This is a flowchart of an information synchronization exchange method provided in Embodiment 2 of the present invention. This embodiment is based on Embodiment 1 above, and further refines the method of exchanging multiple sets of keys with the peer by transmitting the key in a split manner, so that both communicating parties can verify the correctness of the key based on the received key and the received multiple sets of ciphertext combinations.
[0070] like Figure 2 As shown, the method includes:
[0071] S110. Exchange the ciphertext corresponding to the information to be transmitted with the other end of the communication through a symmetric encryption algorithm.
[0072] S120. Exchange the hash values of their respective random information with the peer using an asymmetric encryption algorithm.
[0073] S130. Exchange multiple sets of ciphertext combinations with the peer through a symmetric encryption algorithm. Each set of ciphertext combinations is obtained by encrypting the hash value of its own information to be transmitted and the hash value of the other party's random information using each of its multiple sets of keys. Each set of keys is generated based on the symmetric key used to encrypt the information to be transmitted.
[0074] S141. Exchange one of the keys from each of the multiple sets of keys with the peer via an unintentional transmission protocol as the first exchange, so that both parties can perform the first verification based on the received multiple sets of ciphertext combinations and the key received in the first exchange.
[0075] In this step, device A can access n sets of keys {(a1,a1′),(a2,a′2),…,(a…} n ,a′ n Each key in} i ,a i Each device B executes a 2-out-of-1 unintentional transmission protocol, allowing it to selectively receive one of the keys (ai, ai′) from each pair. For example, if it receives a... i Or receive a i However, device A cannot determine which specific key device B received. Ultimately, device B can obtain half of the n keys from device A, that is, n keys.
[0076] Similarly, device B can handle n sets of keys {(b1,b1′),(b2,b2′),…,(b n ,b n Each key (b) in ′)} i ,b i Each device A will execute a 2-out-of-1 unintentional transmission protocol, allowing it to selectively receive one of the keys (bi, bi′) from each pair. For example, if it receives b... i Or receive b i However, device B cannot determine which specific key device A received. Ultimately, device A can obtain half of the n keys from device B, that is, n keys.
[0077] At this point, both parties have successfully obtained half of the other party's n sets of keys. They can then perform the first verification based on the received half of the key and the other party's multiple sets of ciphertext.
[0078] In one embodiment, the first verification is performed based on the received multiple sets of ciphertext combinations and the key received in the first exchange, including: decrypting the corresponding ciphertext in the received multiple sets of ciphertext combinations using the key received in the first exchange to obtain a first decryption result; in the first decryption result, if the result obtained by decrypting with the random key in the key received in the first exchange is consistent, and the result obtained by decrypting with the processed key in the key received in the first exchange is consistent, then the first verification passes.
[0079] Device A can use the key received in the first exchange, i.e., {(b1,b1′),(b2,b2′),…,(b n ,b n In each key pair (bi,bi′) in the array, one of the (b) keys is... i or b i (′), using a symmetric decryption algorithm to decrypt multiple ciphertext combinations. The corresponding ciphertext in the code yields the first decryption result. The decrypted ciphertext can be understood as b. i Used for decryption b i ′ used for decryption In the first decryption result, if through b i The decryption result is always H(M) B ), through b i The decryption result is H(m) A If the first verification passes, then the first verification is successful.
[0080] Similarly, device B can use the key received in the first exchange, i.e., {(a1,a1′),(a2,a′2),…,(a…} n ,a′ n Each key in )} i ,a i One of (a) ′) i or a i (′), using a symmetric decryption algorithm to decrypt multiple ciphertext combinations. The corresponding ciphertext is used to obtain the first decryption result. The decrypted ciphertext can be understood as a. i Used for decryption a i ′ used for decryption In the first decryption result, if through a i The decryption result is always H(M) A ), through a i The decryption result is H(m) B If the first verification passes, then the first verification is successful.
[0081] During the initial verification process, if one party discovers that the key transmitted by the other party is incorrect, it can take relevant measures, such as stopping the transmission.
[0082] S142. The two parties exchange multiple sets of keys according to binary bits using the asymmetric encryption algorithm as a second exchange, so that both parties can perform a second verification based on the key received in the second exchange and the key received in the first exchange, and perform a third verification based on the multiple sets of ciphertext combinations received and the key received in the second exchange.
[0083] In this step, device A can transfer {(a1,a1′),(a2,a′2),…,(a n ,a′ n All bits are converted to binary representation, and the first bit (bit1) of the converted binary representation is taken. a,a′ (0 or 1), using the asymmetric encryption algorithm Enc'() and the public key pk of device B. B Encrypting the binary bits yields Will The data is transmitted to device B. Device B can then use the asymmetric decryption algorithm Dec'() and the private key sk. B Decryption get
[0084] Similarly, device B can store {(b1,b1′),(b2,b2′),…,(b n ,b n All bits of the ')} are converted to binary form, and the first bit (bit1) of the converted binary representation is taken. b,b′ (0 or 1), using the asymmetric encryption algorithm Enc'() and the public key pk of device A. A Encrypting the binary bits yields Will The data is transmitted to device A. Device A can then use the asymmetric decryption algorithm Dec'() and the private key sk. A Decryption get
[0085] At this point, both parties have successfully exchanged the first binary bits of their respective multi-key conversions. The remaining binary bits are then exchanged sequentially in the same manner until both parties have successfully exchanged all binary bits of their multi-keys, constituting the second exchange. Throughout the entire process of the second exchange, both parties can perform a second verification based on the keys received in the second exchange and the keys received in the first exchange.
[0086] In one embodiment, the second verification is performed based on the key received at the second exchange and the key received at the first exchange, including: during the second exchange, comparing the binary bits received at the second exchange with the binary bits of the key received at the first exchange; if there is no corresponding binary bit, the verification is skipped; if there is a corresponding binary bit and the corresponding binary bits are consistent, the second verification is successful.
[0087] During the second exchange, as device A receives each binary bit transmitted by device B, it compares the received binary bit with the binary bits of the key received in the first exchange. For example, it compares the first binary bit received in the second exchange (bit1b,b) with the first binary bit received in the second exchange. ′ Compare with the key (b1 or b1′) received in the first exchange in (b1, b1′). Specifically: if the key received in the first exchange is b1, then bit1... b,b′ Compare with the first binary bit of b1; if they match, continue matching the next newly received binary bit; if the key received in the first exchange is b1′, then bit1... b,b′ Instead of participating in the matching, after receiving a fixed number of binary bits (which could be the number of binary bits corresponding to b1), the newly received binary bits are compared with the first binary bit of b1'. If they match, the matching of the next binary bit continues.
[0088] Similarly, during the second exchange, device B can compare the binary bits received from device A in the second exchange with the binary bits of the key received from device A in the first exchange in a similar manner.
[0089] During the second verification process, if at least one key received in the second key exchange matches a key received in the first key exchange within that same key group, the second verification passes; otherwise, the verification fails. If the second verification passes, the communicating parties can perform a third verification based on the key received in the second key exchange and multiple ciphertext combinations from the other party.
[0090] In one embodiment, a third verification is performed based on the received multiple sets of ciphertext combinations and the key received in the second exchange, including: decrypting the ciphertext that was not decrypted in the first verification using the key received in the second exchange to obtain a second decryption result; in the second decryption result, if the first result obtained by decryption using the random key in the key received in the second exchange is consistent with the second result obtained by decryption using the processed key in the key received in the second exchange, and the first result is consistent with the result obtained by decryption using the random key in the first verification, and the second result is consistent with the result obtained by decryption using the processed key in the first verification, then the third verification is successful.
[0091] Since both parties decrypted one ciphertext from each of the other's multiple ciphertext combinations for verification during the first verification, and both parties obtained all of the other's multiple keys during the second exchange, the third verification can decrypt the ciphertext in each of the other's multiple ciphertext combinations that was not decrypted during the first verification based on all of the other's multiple keys.
[0092] In the third verification, both parties decrypt the ciphertext in each ciphertext combination that was not decrypted in the first verification using essentially the same method as in the first verification: decrypting it using the key corresponding to the ciphertext that was not decrypted in each ciphertext combination to obtain the second decryption result. This will not be elaborated further here. For example, if the ciphertext that was not decrypted is... The ciphertext that is decrypted via bi and not decrypted is: The ciphertext that is decrypted by bi′ and not decrypted is... The ciphertext that is decrypted by AI and not decrypted is: Then through a i Decrypt.
[0093] In the second decryption result, if the first result obtained by decryption using the random key received in the second exchange is consistent with the first result obtained by decryption using the random key during the first verification, such as the first verification and the third verification using a... i The decryption result is always H(M) A ), through b i The decryption result is always H(M) B If the second result obtained by decrypting the key after processing the key received in the second exchange is consistent with the result obtained by decrypting the key after processing in the first verification, such as the first verification and the third verification using a... i The decryption result is H(m) B ), through b i The decryption result is H(m) A If the third verification is successful, then the verification will pass.
[0094] The first, second, and third verifications mentioned above are combined into a key correctness verification. If all three verifications pass, the ciphertext to be transmitted from the recipient can be decrypted.
[0095] S150. If the verification is successful, determine the information to be transmitted by the peer based on the multiple sets of keys of the peer and the ciphertext to be transmitted by the peer.
[0096] The technical solution of this invention allows both communicating parties to verify the correctness of each other's keys multiple times during information exchange, without obtaining the symmetric key used to encrypt the information to be transmitted in advance. That is, the ciphertext to be transmitted cannot be decrypted during the verification process. Decryption of the ciphertext can only be performed after successful verification, thus protecting the interests of both communicating parties.
[0097] Example 3
[0098] Figure 3 This is a flowchart of an information synchronization and exchange method provided in Embodiment 3 of the present invention. Figure 3 The illustrated process is an exemplary description of the processes in the above embodiments. For example... Figure 3 As shown, the two communicating parties perform 11 equal steps, as follows:
[0099] The first step is for both parties to encrypt the information to be exchanged and send it to each other.
[0100] 1-A: Device A encrypts M using keyA and Enc(). A Get Enc keyA (M A Then it is transmitted to device B;
[0101] 1-B: Device B uses keyB and Enc() to encrypt M. B Get Enc keyB (M B Then it is transmitted to device A.
[0102] The second step involves both parties generating public and private key pairs for an asymmetric encryption algorithm and sending the public key to the other party.
[0103] 2-A: Device A generates the public / private key pair (pk) for Enc'(). A ,sk A ), where the public key pk A Send to device B, private key sk A Store properly;
[0104] 2-B: Device B generates the public / private key pair (pk) for Enc'(). B ,sk B ), where the public key pk B Send to device A, private key sk B Store properly.
[0105] The third step involves both parties generating random information required for subsequent steps, encrypting it, and sending it to each other.
[0106] 3-A: Device A uses Enc'() and public key pk B Encrypted random information mA Hash value H(m) A )get Transmitted to device B, enabling device B to utilize Dec'() and the private key sk B Decryption We obtain H(m) A );
[0107] 3-B: Device B uses Enc'() and public key pk A Encrypted random information m B Hash value H(m) B )get Transmitted to device A, enabling device A to utilize Dec'() and the private key sk A Decryption We obtain H(m) B ).
[0108] Step 4: Both parties generate n sets of ciphertext combinations using n sets of keys and send them to each other.
[0109] 4-A: Device A generates n sets of keys {(a1,a1′),(a2,a′2),…,(an,a′n)}, where a i A random key. For a i The corresponding key after computation; combined with Enc() and a i Encrypt H(M) A )get Using a i Encryption H(m) B )get Obtain n sets of ciphertext combinations Transmit the obtained n sets of ciphertext combinations to device B;
[0110] 4-B: Device B generates n sets of keys {(b1,b1′),(b2,b2′),…,(bn,bn′)}, where b i A random key. For b i The corresponding key after computation; combined with Enc() and b i Encrypt H(M) B )get Using b i Encryption H(m) A )get Obtain n sets of ciphertext combinations Transmit the obtained n sets of ciphertext combinations to device A.
[0111] Step 5: Both parties perform a 2-choose-1 unintentional transmission protocol on each of the n sets of keys, which is the first exchange in Example 2.
[0112] 5-A: Device A for each key group (a i ,a i Each device B executes a 2-out-of-1 unintentional transmission protocol, allowing device B to selectively receive each key group (a). i ,a i ')one of the;
[0113] 5-B: Device B for each key group (b i ,b i Each device A will selectively receive each key pair (b) via a 2-out-of-charge unintentional transmission protocol. i ,b i ')one of the.
[0114] Step 6: Both parties verify the n keys received in Step 5.
[0115] 6-A: Device A performs the first verification in Example 2;
[0116] 6-B: Device B performs the first verification in Example 2.
[0117] Step 7: Both parties transmit the binary bits of n sets of keys, which is the second exchange in Example 2.
[0118] 7-A: Device A will {(a1,a1′),(a2,a′2),…,(a n ,a′ n Convert all bits to binary, and take the first bit (bit1) of the converted binary data. a,a′ Using Enc'() and device B's public key pk B Encryption obtained Will Transmitted to device B, device B uses Dec'() and private key sk B Decryption Get bit1 a,a′ ;
[0119] 7-B: Device B will {(b1,b1′),(b2,b2′),…,(b n ,b n Convert all bits to binary, and take the first bit (bit1) of the converted binary sequence. b,b′ Using Enc'() and device A's public key pk A Encryption obtained Will Transmitted to device A, device A uses Dec'() and private key sk A Decryption Get bit1 b,b′ .
[0120] Step 8: Both parties continuously transmit n sets of binary bits of the key and perform real-time verification.
[0121] 8-AB: For the second, third, etc. binary bits of the n sets of keys of both devices A and B, repeat step seven in sequence until all binary bits of the n sets of keys of both parties have been transmitted, that is, the second exchange is completed; and during the second exchange, both devices A and B perform the second verification in embodiment two.
[0122] Step 9: Both parties perform complete verification of n sets of keys respectively.
[0123] 9-A: Device A performs the third verification in Example 2;
[0124] 9-B: Device B performs the third verification in Example 2.
[0125] Step 10: Both parties obtain the symmetric key to decrypt the ciphertext to be transmitted.
[0126] 10-A: Equipment A determined
[0127] 10-B: Equipment B determined
[0128] Step 11: Both parties obtain and verify the information to be transmitted exchanged with each other.
[0129] 11-A: Device A uses Dec() and key B Decrypting Enc keyB (M B ) to obtain M B Calculate M B The hash value should be the same as the M obtained during the verification process described above. B If the hash values match, the verification passes.
[0130] 11-B: Device B uses Dec() and key A Decrypting Enc keyA (M A ) to obtain M A Calculate M A The hash value should be the same as the M obtained during the verification process described above. A If the hash values match, the verification passes.
[0131] It should be noted that if the output length of the hash function used in this invention is doubled (e.g., the output is changed from 256 bits to 512 bits), the key length of the symmetric cryptography is doubled (e.g., the key is changed from 128 bits to 256 bits), and lattice cryptography and a secure inadvertent transmission protocol are adopted (e.g., quantum inadvertent transmission or a 2-to-1 inadvertent transmission protocol based on post-quantum cryptography), then this invention will have the ability to resist quantum computing attacks.
[0132] The technical solutions of the embodiments of the present invention have the following advantages:
[0133] 1. Both parties can achieve synchronous data exchange, that is, while one party obtains the other party's key, decrypts the other party's ciphertext and obtains plaintext information, the other party can also complete the same operation simultaneously.
[0134] 2. The entire process involves three verifications of the keys transmitted between the two parties at different levels, which can detect the correctness of the key transmission process in real time and promptly identify any abnormalities in the key transmission process.
[0135] 3. The n sets of ciphertext combinations in the fourth step contain both the hash value of the information to be transmitted by the party and the hash value of the random information randomly generated by the other party, which facilitates the other party to verify the validity of the key decryption and the integrity of the exchanged information.
[0136] 4. In steps five and six, both parties can verify the validity of each other's keys without obtaining the other party's key information in advance, thus protecting the interests of both parties. If A attempts to disrupt the protocol and deceive B to pass this verification, due to the unintentional transmission of the 2-out-of-1 choice, A must correctly guess B's key selection each time and send the corresponding correct key. Therefore, the probability of A successfully deceiving B is 1 / 2. n The larger the value of n, the lower the probability of A succeeding. When n = 7, the probability of A succeeding is already less than 1%. If A guesses B's choice incorrectly even once and sends the wrong key, B can detect A's deception through the verification process in step 6-B, and thus B can take relevant measures to prevent its interests from being harmed. At the same time, since B can only obtain one key from each set, and the keys are unrelated, it is impossible to recover the key for encrypted information exchange through XOR operations, thus protecting A's interests.
[0137] 5. During steps seven and eight, when transmitting the n complete keys, both parties will adhere to the protocol instead of sending random binary bits. If A attempts to break the protocol and deceive B to pass this verification, A must accurately guess which key element B has received. Therefore, the probability of A successfully deceiving B is 1 / 2. n The larger the value of n, the lower the probability of A succeeding, so A will not take the risk.
[0138] 6. This invention is not limited to any specific hash algorithm, symmetric cryptography algorithm, asymmetric cryptography algorithm, or stealth transmission protocol. It is applicable to general security environments and environments resistant to quantum computing attacks. By selecting an asymmetric cryptography technique based on lattice cryptography (or other quantum-resistant cryptography techniques), choosing a quantum stealth transmission or a 2-to-1 stealth transmission protocol based on post-quantum cryptography, and doubling the output length of the hash algorithm (hash function) and the key length of the symmetric cryptography algorithm, the entire information exchange scheme will possess the characteristics of resisting quantum computing attacks.
[0139] Example 4
[0140] Figure 4 This is a schematic diagram of an information synchronization exchange device according to Embodiment 4 of the present invention. This embodiment is applicable to situations where information is exchanged synchronously with a communication peer. Figure 4 As shown, the specific structure of the device includes:
[0141] The first exchange module 41 is used to exchange the ciphertext to be transmitted corresponding to the information to be transmitted with the other end of the communication through a symmetric encryption algorithm.
[0142] The second exchange module 42 is used to exchange the hash values of their respective random information with the peer through an asymmetric encryption algorithm;
[0143] The third exchange module 43 is used to exchange multiple sets of ciphertext combinations with the peer through a symmetric encryption algorithm. Each set of ciphertext combinations is obtained by encrypting the hash value of its own information to be transmitted and the hash value of the random information of the other party through each of its multiple sets of keys. Each set of keys is generated based on the symmetric key used to encrypt the information to be transmitted.
[0144] The fourth exchange module 44 is used to exchange multiple sets of keys with the peer by transmitting the key in a split manner, so that both communicating parties can verify the correctness of the key based on the received key and the received multiple sets of ciphertext.
[0145] The decryption module 45 is used to determine the information to be transmitted by the peer based on multiple sets of keys of the peer and the ciphertext to be transmitted by the peer, if the verification is successful.
[0146] The information synchronization and exchange device provided in this embodiment exchanges ciphertexts corresponding to their respective information to be transmitted with the peer through a first exchange module using a symmetric encryption algorithm; exchanges hash values of their respective random information with the peer through a second exchange module using an asymmetric encryption algorithm; exchanges multiple sets of ciphertext combinations with the peer through a third exchange module using a symmetric encryption algorithm, each of the multiple sets of ciphertext combinations being obtained by encrypting the hash value of their own information to be transmitted and the hash value of the peer's random information using each of their multiple sets of keys; each of their multiple sets of keys is generated based on the symmetric key used to encrypt their information to be transmitted; exchanges their multiple sets of keys with the peer through a key splitting transmission method, so that both communicating parties can verify the correctness of the keys based on the received keys and the received multiple sets of ciphertext combinations; and, if the verification is successful, the decryption module determines the information to be transmitted by the peer based on the peer's multiple sets of keys and the peer's ciphertexts to be transmitted. This scheme enables the synchronous exchange of information to be transmitted. During the information exchange process, the correctness of the key can be verified, ensuring that either party can promptly detect the other party's fraudulent behavior or errors that occur during transmission, thus avoiding the consequence of one party benefiting while the other party suffers losses, thereby ensuring the fairness of information exchange.
[0147] Furthermore, each of the multiple sets of keys includes a random key and a computed key, wherein the computed key is the result of an XOR operation between the random key and the symmetric key used to encrypt the information to be transmitted.
[0148] The random key is used to encrypt the hash value of the information to be transmitted; the processed key is used to encrypt the hash value of the random information of the other party.
[0149] Furthermore, the fourth switching module 44 is specifically used for:
[0150] The two parties exchange one of each of their multiple sets of keys with the peer via an unintentional transmission protocol as the first exchange, so that both parties can perform the first verification based on the received multiple sets of ciphertext combinations and the key received in the first exchange.
[0151] The two parties exchange multiple sets of keys according to binary bits using the asymmetric encryption algorithm as a second exchange, so that both parties can perform a second verification based on the key received in the second exchange and the key received in the first exchange, and perform a third verification based on the multiple sets of ciphertext received and the key received in the second exchange.
[0152] The key correctness verification includes the first verification, the second verification, and the third verification.
[0153] Furthermore, a first verification is performed based on the received multiple sets of ciphertext combinations and the key received in the first exchange, including:
[0154] The first decryption result is obtained by decrypting the corresponding ciphertext in the multiple ciphertext combinations received by the first exchange using the key received in the first exchange.
[0155] In the first decryption result, if the result obtained by decrypting with the random key in the key received in the first exchange is consistent, and the result obtained by decrypting with the processed key in the key received in the first exchange is consistent, then the first verification is successful.
[0156] Furthermore, a second verification is performed based on the key received at the second exchange and the key received at the first exchange, including:
[0157] During the second exchange, the binary bits received in the second exchange are compared with the binary bits of the key received in the first exchange. If there is no corresponding binary bit, the process is skipped. If there is a corresponding binary bit and the corresponding binary bits are consistent, the second verification is successful.
[0158] Furthermore, a third verification is performed based on the received multiple ciphertext combinations and the key received in the second exchange, including:
[0159] Using the key received in the second exchange, the ciphertext that was not decrypted in the first verification among the multiple ciphertext combinations received is decrypted to obtain the second decryption result;
[0160] In the second decryption result, if the first result obtained by decryption using the random key in the key received in the second exchange is consistent with the second result obtained by decryption using the processed key in the key received in the second exchange, and the first result is consistent with the result obtained by decryption using the random key in the first verification, and the second result is consistent with the result obtained by decryption using the processed key in the first verification, then the third verification is successful.
[0161] Furthermore, the decryption module 45 is specifically used for:
[0162] Based on any one of the multiple sets of keys from the other end, including the random key and the processed key, an XOR operation is performed to obtain the symmetric key from the other end for encrypting the information to be transmitted.
[0163] The symmetric key obtained by XOR operation using a symmetric decryption algorithm is used to decrypt the ciphertext to be transmitted from the other end, thus obtaining the information to be transmitted from the other end.
[0164] The information synchronization and exchange device provided in the embodiments of the present invention can execute the information synchronization and exchange method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.
[0165] Example 5
[0166] Figure 5 This is a schematic diagram of the structure of an electronic device implementing embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0167] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0168] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0169] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as information synchronization exchange methods.
[0170] In some embodiments, the information synchronization exchange method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the information synchronization exchange method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the information synchronization exchange method by any other suitable means (e.g., by means of firmware).
[0171] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0172] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0173] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0174] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0175] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0176] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0177] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0178] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for synchronous information exchange, characterized in that, include: They exchange ciphertexts corresponding to their respective information to be transmitted with the other end of the communication through a symmetric encryption algorithm. They exchange hash values of their respective random information with the peer using an asymmetric encryption algorithm; The two parties exchange multiple sets of ciphertext combinations using a symmetric encryption algorithm. Each set of ciphertext combinations is obtained by encrypting the hash value of its own transmitted information and the hash value of the other party's random information using each of its multiple sets of keys. Each set of keys is generated based on its own symmetric key used to encrypt the transmitted information. Each set of keys includes a random key and a post-processed key, where the post-processed key is the result of an XOR operation between the random key and the symmetric key used to encrypt its own transmitted information. The random key is used to encrypt the hash value of its own transmitted information, and the post-processed key is used to encrypt the hash value of the other party's random information. By transmitting the key in segments, multiple sets of keys are exchanged with the peer, enabling both parties to verify the correctness of the key based on the received key and the multiple sets of ciphertext. This includes: The two parties exchange one of each of their multiple sets of keys with the peer via an unintentional transmission protocol as the first exchange, so that both parties can perform the first verification based on the received multiple sets of ciphertext combinations and the key received in the first exchange. The two parties exchange multiple sets of keys according to binary bits using the asymmetric encryption algorithm as a second exchange, so that both parties can perform a second verification based on the key received in the second exchange and the key received in the first exchange, and perform a third verification based on the multiple sets of ciphertext received and the key received in the second exchange. The key correctness verification includes the first verification, the second verification, and the third verification; If the verification is successful, the information to be transmitted by the peer is determined based on the multiple sets of keys of the peer and the ciphertext to be transmitted by the peer.
2. The method according to claim 1, characterized in that, The first verification is performed based on the received multiple ciphertext combinations and the key received in the first exchange, including: The first decryption result is obtained by decrypting the corresponding ciphertext in the multiple ciphertext combinations received by the first exchange using the key received in the first exchange. In the first decryption result, if the result obtained by decrypting with the random key in the key received in the first exchange is consistent, and the result obtained by decrypting with the processed key in the key received in the first exchange is consistent, then the first verification is successful.
3. The method according to claim 1, characterized in that, The second verification is performed based on the key received at the second exchange and the key received at the first exchange, including: During the second exchange, the binary bits received in the second exchange are compared with the binary bits of the key received in the first exchange. If there is no corresponding binary bit, the process is skipped. If there is a corresponding binary bit and the corresponding binary bits are consistent, the second verification is successful.
4. The method according to claim 1, characterized in that, A third verification is performed based on the received multiple ciphertext combinations and the key received in the second exchange, including: Using the key received in the second exchange, the ciphertext that was not decrypted in the first verification among the multiple ciphertext combinations received is decrypted to obtain the second decryption result; In the second decryption result, if the first result obtained by decryption using the random key in the key received in the second exchange is consistent with the second result obtained by decryption using the processed key in the key received in the second exchange, and the first result is consistent with the result obtained by decryption using the random key in the first verification, and the second result is consistent with the result obtained by decryption using the processed key in the first verification, then the third verification is successful.
5. The method according to claim 1, characterized in that, Determining the information to be transmitted by the peer based on the peer's multiple sets of keys and the peer's ciphertext to be transmitted includes: Based on any one of the multiple sets of keys from the other end, including the random key and the processed key, an XOR operation is performed to obtain the symmetric key from the other end for encrypting the information to be transmitted. The symmetric key obtained by XOR operation using a symmetric decryption algorithm is used to decrypt the ciphertext to be transmitted from the other end, thus obtaining the information to be transmitted from the other end.
6. An information synchronization and exchange device, characterized in that, include: The first exchange module is used to exchange the ciphertext to be transmitted corresponding to the information to be transmitted with the other end of the communication through a symmetric encryption algorithm; The second exchange module is used to exchange the hash values of their respective random information with the peer through an asymmetric encryption algorithm. The third exchange module is used to exchange multiple sets of ciphertext combinations with the peer using a symmetric encryption algorithm. Each set of ciphertext combinations is obtained by encrypting the hash value of its own information to be transmitted and the hash value of the peer's random information using each of its multiple sets of keys. Each set of keys is generated based on its own symmetric key used to encrypt the information to be transmitted. Each set of keys includes a random key and a post-processed key, where the post-processed key is the result of an XOR operation between the random key and the symmetric key used to encrypt its own information to be transmitted. The random key is used to encrypt the hash value of its own information to be transmitted, and the post-processed key is used to encrypt the hash value of the peer's random information. The fourth exchange module is used to exchange multiple sets of keys with the peer by transmitting the keys in a split manner, so that both parties can verify the correctness of the keys based on the received keys and the received multiple sets of ciphertext combinations. Specifically, the fourth exchange module is used to: exchange one key from each of the multiple sets of keys with the peer via an unintentional transmission protocol as a first exchange, so that both parties can perform a first verification based on the received multiple sets of ciphertext combinations and the keys received in the first exchange; exchange multiple sets of keys with the peer according to binary bits using the asymmetric encryption algorithm as a second exchange, so that both parties can perform a second verification based on the keys received in the second exchange and the keys received in the first exchange, and a third verification based on the received multiple sets of ciphertext combinations and the keys received in the second exchange; wherein, the key correctness verification includes the first verification, the second verification, and the third verification. The decryption module is used to determine the information to be transmitted by the peer based on multiple sets of keys of the peer and the ciphertext to be transmitted by the peer, if the verification is successful.
7. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Unmanned aerial vehicle flight control and communication data encryption method and system based on quantum key
CN118659879A
Casual transmission method, system and device based on secret sharing and medium
CN119071089A