A data integrity checking method and device based on a quantum network and a storage medium
By using a quantum network-based data integrity verification method, the transmitting end generates and splices verification data and then performs quantum encryption, while the receiving end performs verification and comparison. This solves the problem of cumbersome and time-consuming processes in existing technologies, achieves fast and effective data integrity verification, and improves the computing efficiency of the receiving end.
Patent Information
- Application Number
- CN202311599363.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-28
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-11-28
AI Technical Summary
Existing data integrity verification methods are too cumbersome, resulting in high computational burden and extremely low efficiency at the receiving end.
A quantum network-based data integrity verification method is adopted. The transmitting end generates and splices the verification data and then performs quantum encryption. The receiving end uses the same verification calculation process to verify the data integrity. By comparing the verification data after quantum decryption, the data integrity can be quickly determined.
Under high traffic and high concurrency conditions, it significantly improves the verification rate, saves resources, optimizes the user experience, and improves data reception efficiency.
Smart Images

Figure CN117579360B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quantum security technology, specifically to a data integrity verification method, device, and storage medium based on quantum networks. Background Technology
[0002] During data transmission over the network, hackers, driven by economic gain or personal interest, often target specific groups or sensitive users, stealing their online identities or bank account information. They then impersonate legitimate users to further intrude into information systems and illegally steal economic, political, and military secrets. To ensure internet security and fully realize its value in commercial information exchange, data encryption technology has been chosen to authenticate users accessing the network. Therefore, data encryption and decryption are essential in the data transmission process.
[0003] The essence of data encryption is to transform plaintext data into ciphertext data using a certain algorithm, thereby achieving the purpose of data confidentiality. Encryption essentially changes the form of data, removing or hiding the meaning of the plaintext data, increasing the complexity of the encrypted data, so that it can only be correctly restored using a specific decryption method. Simply put, it's a kind of data obfuscation. Currently, the basic methods of encryption technology include symmetric key encryption and asymmetric key encryption. The decryption process is exactly the reverse of the encryption process, that is, restoring the ciphertext data to plaintext data, which usually requires using the same key used for encryption.
[0004] Depending on the encryption algorithm and key, data decryption can be achieved using different methods. Symmetric-key encryption algorithms typically use the same key for both encryption and decryption, while asymmetric-key encryption algorithms require a private key for decryption. Regardless of whether it's symmetric-key or asymmetric-key encryption, the principle of data decryption is the same: reverse the operation on the ciphertext data based on the encryption algorithm and key, removing noise, transformations, or randomness added during encryption, and restoring the ciphertext data to its original plaintext state.
[0005] Meanwhile, to further ensure the accuracy of data transmission, we should use verification data to confirm whether the data has been tampered with. In actual data transmission, after the receiving end decrypts the data, it also needs to verify the integrity of the data. However, existing data integrity verification methods are too cumbersome and time-consuming, thus putting a lot of computational pressure on the receiving end and ultimately resulting in extremely low data reception efficiency. Considering the large traffic and high flow rate at the receiving end, it is necessary to find a more efficient verification method to verify the integrity of the data. Summary of the Invention
[0006] Purpose of the invention: The purpose of this invention is to provide a data integrity verification method, device and storage medium based on quantum networks, which solves the problem that existing data integrity verification methods are too cumbersome and time-consuming, thus putting a lot of computational pressure on the receiving end and ultimately resulting in extremely low data reception efficiency.
[0007] Technical solution: This invention provides a data integrity verification method based on quantum networks, comprising the following steps:
[0008] (1) The sending end performs verification calculation on the plaintext data to generate the first verification data, then concatenates the plaintext data with the first verification data, and then performs quantum encryption on the concatenated plaintext data and the first verification data together to form quantum ciphertext and transmits it to the receiving end.
[0009] (2) The receiving end decrypts the quantum ciphertext to obtain the decrypted plaintext data and the first verification data. Then, it uses the same verification calculation process as the sending end to perform verification calculation on the decrypted plaintext data to generate the second verification data. The receiving end then compares the second verification data with the decrypted first verification data. If the two are the same, the integrity authentication of the plaintext data is passed and the receiving end receives the plaintext data. Otherwise, the integrity authentication fails and the sending end is notified to retransmit.
[0010] Furthermore, the length of the first verification data and the length of the second verification data are both two bytes.
[0011] Furthermore, the specific process of performing verification calculations on the plaintext data to generate the first verification data is as follows:
[0012] 1) Obtain the byte length a of the plaintext data, divide the byte length a of the plaintext data by the preset split byte length b to obtain the quotient c and the remainder d, and then split the plaintext data into c bytes of split data with a length of b and 1 byte of first remaining data with a length of d in the order from front to back;
[0013] 2) Accumulate the c bytes of split data of length b in sequence to obtain the first intermediate data, and then remove the high-order bits of the accumulated first intermediate data to obtain the second intermediate data of length b (1 byte).
[0014] 3) Split the second intermediate data into multiple two-byte third intermediate data in front-to-back order, and split the first remaining data into fourth intermediate data; then accumulate the multiple two-byte third intermediate data and fourth intermediate data in sequence to obtain the fifth intermediate data, and finally remove the high-order bits of the fifth intermediate data to obtain one two-byte first final data, which is the first check data.
[0015] Furthermore, the specific process of performing verification calculations on the plaintext data to generate the first verification data is as follows:
[0016] 1) Obtain the byte length a of the plaintext data, divide the byte length a of the plaintext data by the preset split byte length b to obtain the quotient c and the remainder d, and then split the plaintext data into c bytes of length b in the order from front to back;
[0017] 2) Next, split the plaintext data into a second remaining data of length b in reverse order; accumulate the split data of length b of length c bytes and the second remaining data of length b bytes to obtain the sixth intermediate data; then remove the high-order bits of the accumulated sixth intermediate data to obtain the seventh intermediate data of length b of length b.
[0018] 3) Split the seventh intermediate data into multiple two-byte eighth intermediate data in front-to-back order. Then, accumulate the multiple two-byte eighth intermediate data to obtain the ninth intermediate data. Finally, remove the high-order bits of the ninth intermediate data to obtain a two-byte second final data. This second final data is the first check data.
[0019] Furthermore, the preset split byte length b is an integer power of 2, and the byte length b is greater than or equal to 2. 3 .
[0020] Furthermore, the specific process of splitting the first remaining data into the fourth intermediate data is as follows:
[0021] If the byte length d of the first remaining data is a multiple of 2, then the first remaining data is split into multiple two-byte first blocks of data in order from front to back. These multiple two-byte first blocks of data are the fourth intermediate data. If the byte length d of the first remaining data is not a multiple of 2, then the first remaining data is split into multiple two-byte second blocks of data and one one-byte third block of data in order from front to back. These multiple two-byte second blocks of data and one one-byte third block of data are the fourth intermediate data.
[0022] The present invention also includes a computer device comprising at least a processor and a memory, the processor being configured to implement the data integrity verification method based on a quantum network as described in any of the preceding claims when executing a computer program stored in the memory.
[0023] The present invention also includes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the data integrity verification method based on a quantum network as described in any of the preceding claims.
[0024] The beneficial effects of this invention are as follows: First, the plaintext is verified to generate verification data. Then, the plaintext data and the verification data are concatenated and encrypted to form quantum ciphertext, which is transmitted to the receiving end. After receiving the data, the receiving end uses the same verification calculation process as the sending end to verify the decrypted plaintext data, thereby determining the integrity of the plaintext data. This invention splits the plaintext data, adds the split data together, and then removes the high-order bits to obtain the final verification data. This not only allows for faster calculation of the verification data, thus verifying data integrity, but also has a very significant effect under high traffic and high concurrency conditions, saving resources, improving efficiency, and greatly optimizing the user experience. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of the quantum network-based data integrity verification method of the present invention;
[0026] Figure 2 This is a schematic diagram of plaintext data splitting in Example 1;
[0027] Figure 3 This is a schematic diagram of plaintext data splitting in Example 2. Detailed Implementation
[0028] The present invention will be further described below with reference to the accompanying drawings and embodiments:
[0029] Example 1
[0030] In a quantum network, regardless of the type of data, the integrity of the data needs to be verified upon transmission to the receiving end. This quantum network could be the quantum security network deployed by Matrix Time Digital Technology Co., Ltd. Current verification methods generate fixed-length verification data based on the plaintext data using algorithms. Assuming the verification data is two bytes long, the current method involves splitting the plaintext data into many two-byte segments, adding these segments together, and discarding the high-order bits. This results in a single two-byte verification data. However, in a quantum network, quantum-encrypted data is a combination of plaintext and verification data. If the ciphertext is tampered with during transmission, quantum decryption may fail. Therefore, the precision requirement for the verification bits is not very high, and the high-order bits after addition can be discarded. However, the current two-byte splitting and addition verification method consumes more resources and is very time-consuming for large amounts of data, resulting in extremely low data reception efficiency. Since the receiving end, especially the server, often faces high traffic and high flow rate, the efficiency requirements for verification data processing are even higher. Obviously, it is necessary to optimize the verification method and improve the verification rate.
[0031] like Figure 1As shown, the proposed solution of this invention is an optimized verification method that can improve the verification rate; its specific steps are as follows:
[0032] (1) The sending end performs verification calculation on the plaintext data to generate the first verification data, which has a length of two bytes. Then, the plaintext data and the first verification data are concatenated together, that is, concatenated after the plaintext data. The concatenated plaintext data and the first verification data are then quantum encrypted together to form quantum ciphertext and transmitted to the receiving end.
[0033] The specific process of generating the first verification data by performing verification calculations on the plaintext data is as follows:
[0034] 1) Obtain the byte length 'a' of the plaintext data. Divide the byte length 'a' of the plaintext data by the preset split byte length 'b' to obtain the quotient 'c' and the remainder 'd'. The preset split byte length 'b' is an integer power of 2, and the byte length 'b' is greater than or equal to 2. 3 Then, the plaintext data is split into c bytes of data of length b and 1 byte of the first remaining data of length d, in order from front to back.
[0035] 2) Accumulate the c bytes of split data of length b in sequence to obtain the first intermediate data, and then remove the high-order bits of the accumulated first intermediate data to obtain the second intermediate data of length b (1 byte).
[0036] 3) The second intermediate data is split into multiple two-byte third intermediate data in front-to-back order, and the first remaining data is split into fourth intermediate data. Specifically, the process of splitting into fourth intermediate data is as follows: If the byte length d of the first remaining data is a multiple of 2, then the first remaining data is split into multiple two-byte first blocks in front-to-back order; these multiple two-byte first blocks constitute the fourth intermediate data. If the byte length d of the first remaining data is not a multiple of 2, then the first remaining data is split into multiple two-byte second blocks and one one-byte third block in front-to-back order; these multiple two-byte second blocks and one one-byte third blocks constitute the fourth intermediate data. Then, the multiple two-byte third and fourth intermediate data are sequentially accumulated to obtain the fifth intermediate data. Finally, the high-order bits of the fifth intermediate data are removed to obtain one two-byte first final data, which is the first checksum data.
[0037] For example: Suppose the sender wants to transmit 1500 bytes of plaintext data to the receiver, with a two-byte checksum and a preset split byte length of 32. First, obtain the plaintext data length of 1500 bytes. Divide the plaintext data length of 1500 bytes by the preset split byte length of 32 to obtain a quotient of 46 and a remainder of 28. Then, split the plaintext data in front-to-back order into 46 bytes of 32-byte split data and 1 byte of 28-byte first remaining data, as follows: Figure 2 The diagram illustrates the plaintext data splitting process. If we were to use the existing two-byte splitting and addition method, it would require splitting the data into 750 parts for addition, which would be cumbersome and time-consuming.
[0038] Next, the 46 bytes of split data, each with a length of 32, are sequentially accumulated to obtain the first intermediate data. Then, the high-order bits of the accumulated first intermediate data are removed to obtain a second intermediate data with a length of 1 byte. The second intermediate data with a length of 32 bytes is split into 16 two-byte third intermediate data in front-to-back order, and the first remaining data is split into the fourth intermediate data. Since the length of the first remaining data is 28 bytes, it is split into 14 two-byte first blocks of data in front-to-back order, which is the fourth intermediate data. Then, the 16 two-byte third intermediate data and the 14 two-byte first blocks of data are sequentially accumulated to obtain the fifth intermediate data. Finally, the high-order bits of the fifth intermediate data are removed to obtain a final two-byte data, which is the first check data. If 1501 bytes of plaintext data are transmitted, the length of the first remaining data is 29 bytes. The first remaining data is then split into the fourth intermediate data by dividing it sequentially into 14 two-byte second blocks and 1 one-byte third block. These 14 two-byte second blocks and 1 one-byte third block constitute the fourth intermediate data. Next, the 16 two-byte third intermediate data, the 14 two-byte second blocks, and the 1 one-byte third block are sequentially accumulated and their high-order bits removed to obtain a final two-byte data, which is the first checksum. Finally, the calculated two-byte checksum is concatenated to the 1500 bytes of plaintext data, forming 1502 bytes of data. This data is then quantum encrypted to form quantum ciphertext and transmitted to the receiving end.
[0039] Of course, we can change the preset splitting byte length to 8 bytes, 16 bytes, or even 64 bytes, which greatly reduces the number of loop operations generated by splitting. The final step is still the same: add the bytes, remove the high-order bits, and obtain the corresponding byte data; then continue splitting to finally obtain a two-byte checksum. Due to the reduction in loop operations, the complexity and time consumption of the checksum are reduced, and the efficiency of checksum data processing is improved.
[0040] (2) The receiving end decrypts the quantum ciphertext to obtain the decrypted plaintext data and the decrypted first verification data. Then, it uses the same verification calculation process as the sending end to perform verification calculation on the decrypted plaintext data to generate the second verification data. Of course, the second verification data is also two bytes long. Then, the receiving end compares the second verification data with the decrypted first verification data. If the two are the same, the integrity authentication of the plaintext data is passed, proving the integrity of the plaintext data during the transmission process, and the receiving end receives the plaintext data. Otherwise, the integrity authentication fails, proving that the plaintext data has been attacked during the transmission process, and the sending end is notified to retransmit.
[0041] In other words, when the aforementioned quantum ciphertext is transmitted to the receiving end, the receiving end will first perform quantum decryption. If the quantum ciphertext is tampered with or there are any omissions during transmission, quantum decryption may fail. If quantum decryption is successful, 1502 bytes of decrypted data will be obtained. According to the agreement, the last two bytes of check data are extracted. Then, the same check calculation process as at the sending end is used to perform check calculations on the decrypted 1500 bytes of plaintext data to generate second check data. Finally, the newly calculated second check data is compared with the first check data after decryption and splitting. If they are the same, it proves that the data is complete and error-free; otherwise, it is erroneous data.
[0042] Therefore, the data integrity verification method based on quantum networks proposed in this invention can calculate the verification data more quickly, and has a very significant effect on the receiving end with high traffic and high concurrency, especially on the server end. It can not only save resources and improve efficiency, but also quickly verify the integrity of data, greatly optimizing the user experience.
[0043] Example 2
[0044] This embodiment is basically the same as Embodiment 1, except that the specific process of generating the first verification data by performing verification calculation on the plaintext data in this embodiment is as follows:
[0045] 1) Obtain the byte length 'a' of the plaintext data. Divide the byte length 'a' of the plaintext data by the preset split byte length 'b' to obtain the quotient 'c' and the remainder 'd'. The preset split byte length 'b' is an integer power of 2, and the byte length 'b' is greater than or equal to 2. 3 Then, the plaintext data is split into c bytes of length b in front-to-back order.
[0046] 2) Next, split the plaintext data into a second remaining data of length b in reverse order; accumulate the split data of length b of length c bytes and the second remaining data of length b bytes to obtain the sixth intermediate data; then remove the high-order bits of the accumulated sixth intermediate data to obtain the seventh intermediate data of length b of length b.
[0047] 3) Split the seventh intermediate data into multiple two-byte eighth intermediate data in front-to-back order. Then, accumulate the multiple two-byte eighth intermediate data to obtain the ninth intermediate data. Finally, remove the high-order bits of the ninth intermediate data to obtain a two-byte second final data. This second final data is the first check data.
[0048] For example: Suppose the sender wants to transmit 1500 bytes of plaintext data to the receiver, with a two-byte checksum and a preset split byte length of 32. First, obtain the plaintext data length of 1500 bytes. Divide the plaintext data length of 1500 bytes by the preset split byte length of 32, obtaining a quotient of 46 and a remainder of 28. Then, split the plaintext data into 46 bytes of 32 bytes each, in front-to-back order. Next, split the plaintext data into a second, 32-byte remainder, in back-to-front order, as shown below. Figure 3 The diagram illustrates the plaintext data splitting process. If we were to use the existing two-byte splitting and addition method, it would require splitting the data into 750 parts for addition, which would be cumbersome and time-consuming.
[0049] Next, the 46 bytes of split data (32 bytes each) and the second remaining data (32 bytes each) are sequentially accumulated to obtain the sixth intermediate data. Then, the high-order bits of the accumulated sixth intermediate data are removed to obtain a 1-byte seventh intermediate data. This 32-byte seventh intermediate data is split into 16 two-byte eighth intermediate data units in sequential order. These 16 two-byte eighth intermediate data units are then sequentially accumulated to obtain the ninth intermediate data. Finally, the high-order bits of the ninth intermediate data are removed to obtain a 1-byte final data, which is the first check data. Finally, the calculated two-byte check data is concatenated with the 1500 bytes of plaintext data to form 1502 bytes of data. This data is then quantum encrypted to form quantum ciphertext and transmitted to the receiving end.
[0050] The data integrity verification method based on quantum networks proposed in this embodiment calculates the verification data at a faster rate. Therefore, it also solves the problem that existing data integrity verification methods are too cumbersome and time-consuming, thus placing a heavy computational burden on the receiving end and ultimately resulting in extremely low data reception efficiency.
[0051] The present invention also provides a computer device, which includes at least a processor and a memory. The memory stores a computer program, and the processor executes the computer program stored in the memory to implement the steps in the quantum network-based data integrity verification method of the present invention.
[0052] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the quantum network-based data integrity verification method of the present invention.
Claims
1. A data integrity verification method based on quantum networks, characterized in that, Includes the following steps: (1) The sending end performs verification calculation on the plaintext data to generate the first verification data, then concatenates the plaintext data with the first verification data, and then performs quantum encryption on the concatenated plaintext data and the first verification data together to form quantum ciphertext and transmits it to the receiving end. (2) The receiving end decrypts the quantum ciphertext to obtain the decrypted plaintext data and the first verification data. Then, it uses the same verification calculation process as the sending end to perform verification calculation on the decrypted plaintext data to generate the second verification data. The receiving end then compares the second verification data with the decrypted first verification data. If the two are the same, the integrity authentication of the plaintext data is passed and the receiving end receives the plaintext data. Otherwise, the integrity authentication fails and the sending end is notified to retransmit. The first and second verification data are both two bytes in length. The specific process of performing verification calculations on plaintext data to generate the first verification data is as follows: 1) Obtain the byte length a of the plaintext data, divide the byte length a of the plaintext data by the preset split byte length b to obtain the quotient c and the remainder d, and then split the plaintext data into c bytes of split data with a length of b and 1 byte of first remaining data with a length of d in the order from front to back; 2) Accumulate the c bytes of split data of length b in sequence to obtain the first intermediate data, and then remove the high-order bits of the accumulated first intermediate data to obtain the second intermediate data of length b (1 byte). 3) Split the second intermediate data into multiple two-byte third intermediate data in front-to-back order, and split the first remaining data into fourth intermediate data; then accumulate the multiple two-byte third intermediate data and fourth intermediate data in sequence to obtain the fifth intermediate data, and finally remove the high-order bits of the fifth intermediate data to obtain one two-byte first final data, which is the first check data; The specific process of performing verification calculations on plaintext data to generate the first verification data may be as follows: 1) Obtain the byte length a of the plaintext data, divide the byte length a of the plaintext data by the preset split byte length b to obtain the quotient c and the remainder d, and then split the plaintext data into c bytes of length b in the order from front to back; 2) Next, split the plaintext data into a second remaining data of length b in reverse order; accumulate the split data of length b of length c bytes and the second remaining data of length b bytes to obtain the sixth intermediate data; then remove the high-order bits of the accumulated sixth intermediate data to obtain the seventh intermediate data of length b of length b. 3) Split the seventh intermediate data into multiple two-byte eighth intermediate data in front-to-back order. Then, accumulate the multiple two-byte eighth intermediate data to obtain the ninth intermediate data. Finally, remove the high-order bits of the ninth intermediate data to obtain a two-byte second final data. This second final data is the first check data.
2. The data integrity verification method based on quantum networks according to claim 1, characterized in that: The preset split byte length b is an integer power of 2, and the byte length b is greater than or equal to 2. 3 .
3. The data integrity verification method based on quantum networks according to claim 1, characterized in that, The specific process of splitting the first remaining data into the fourth intermediate data is as follows: If the byte length d of the first remaining data is a multiple of 2, then the first remaining data is split into multiple two-byte first blocks of data in order from front to back. These multiple two-byte first blocks of data are the fourth intermediate data. If the byte length d of the first remaining data is not a multiple of 2, then the first remaining data is split into multiple two-byte second blocks of data and one one-byte third block of data in order from front to back. These multiple two-byte second blocks of data and one one-byte third block of data are the fourth intermediate data.
4. A computer device, characterized in that: The computer device includes at least a processor and a memory, wherein the processor is used to implement the data integrity verification method based on quantum net as described in any one of claims 1-3 when executing a computer program stored in the memory.
5. A computer-readable storage medium, characterized in that: It stores a computer program that, when executed by a processor, implements the data integrity verification method based on quantum networks as described in any one of claims 1-3.
Citation Information
Patent Citations
Method and device for generating checksum and electronic equipment
CN114499757A
Method for realizing data correctness and consistency in big data quantum encryption and decryption
CN114499857A
