A data security transmission method based on a hash algorithm, a transceiving device and system

By combining hash algorithm generation and hash value verification, the problem of insufficient flexibility in data transmission is solved, enabling timely identification and reliable transmission of data loss or tampering.

CN115168918BActive Publication Date: 2025-11-21CHENGDU ZHONGKE HEXUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210886476.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-07-30
Filing Date
2022-07-26
Publication Date
2025-11-21
Estimated Expiration
2042-07-26

AI Technical Summary

Technical Problem

Existing data encryption methods are insufficient in terms of flexibility and cannot effectively prevent data loss or tampering.

Method used

Hash algorithms are used to generate and verify hash values. By comparing hash values ​​between the receiving and sending devices, the integrity and consistency of data transmission are ensured. This includes generating hash values ​​X and Y and performing periodic verification.

Benefits of technology

It enables timely identification of data loss or tampering during data transmission, improving the flexibility and reliability of data transmission and ensuring that every transmission is traceable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115168918B_ABST
    Figure CN115168918B_ABST
Patent Text Reader

Abstract

The present application relates to the field of data transmission, and provides a method for realizing data secure transmission based on a hash algorithm, a transmitting and receiving device and a system. The method for realizing data secure transmission based on a hash algorithm for a receiving device comprises: receiving original data and a hash value X of a transmitting device, and obtaining receiving data; generating a hash value Y again according to the receiving data, and judging whether the hash value X and the hash value Y are the same; if yes, it is considered that the data transmission is normal; if not, it is considered that the data transmission is abnormal. For some important data, if loss or tampering occurs in the transmission process, it can be discovered or identified in time. Secondly, it has strong application flexibility, and expands the application scene. Moreover, the combination of the hash value X N and the hash value Y N‑1 to generate the hash value X, and the combination of the hash value Y N and the hash value Y N‑1 to generate Y ensures that each data transmission can be traced, and improves the credibility of data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data transmission, in particular to a method for realizing data secure transmission based on a hash algorithm, a transmitting and receiving device and a system. BACKGROUND

[0002] In the process of data transmission, we often pay attention to the problems such as "where does the message come from, and whether the message has been tampered during the transmission process", and we need to ensure the reliable anti-tampering of the message. Therefore, in the prior art, the data transmission is encrypted to improve the security of data transmission. The current data secure transmission generally relies on hardware for encryption, and the main application is data encryption, and the data is not stolen. However, in some scenarios, the concern of data is not lost or tampered, but not stolen, and the above-mentioned method has the defect of poor flexibility. SUMMARY

[0003] The purpose of the present application is to provide a method for realizing data secure transmission based on a hash algorithm, a transmitting and receiving device and a system, which solves the defect of poor flexibility of the existing data encryption method.

[0004] To achieve the above-mentioned purpose, the technical scheme adopted by the present application is: a method for realizing data secure transmission based on a hash algorithm, which is applied to a receiving device, and the method comprises:

[0005] receiving the original data and the hash value X of the transmitting and receiving device, and obtaining the received data, wherein the hash value X is obtained by the transmitting and receiving device performing hash operation on the Nth original data N and the hash value Y obtained by the receiving device performing hash operation on the N-1th received data N-1 are combined;

[0006] generating the hash value Y again according to the received data, wherein the hash value Y is obtained by the receiving device performing hash operation on the Nth received data N and the hash value Y obtained by the receiving device performing hash operation on the N-1th received data N-1 are combined; the value of N is 1, 2, 3, …;

[0007] judging whether the hash value X and the hash value Y are the same, if they are the same, it is considered that the data transmission is normal, and if they are not the same, it is considered that the data transmission is abnormal.

[0008] Preferably, if the data transmission is normal, the receiving device stores the hash value Y of the Nth received data N .

[0009] Preferably, the initial hash value Y0 stored by the receiving device is 0.

[0010] Preferably, the method further includes a periodic verification step, wherein the periodic verification is: obtaining the hash values ​​of all original data from the sending device to form a queue x: [X1, X2, ..., X...] N The hash values ​​of all received data stored are used to form a queue y: [Y1, Y2, ..., Y...]. N The function compares queue x with queue y to check if the data is abnormal.

[0011] A data secure transmission device includes a first data processing unit, a first storage unit, and a first communication unit;

[0012] The first data processing unit is used to perform a hash operation on the original data and generate a hash value X. The hash value X is obtained by the first data processing unit performing a hash operation on the Nth piece of original data. N The hash value Y obtained by the receiving device performing a hash operation on the (N-1)th received data. N-1 Combined generation;

[0013] The first storage unit is used to store the original data and the hash value X. N ;

[0014] The first communication unit is used to establish a communication connection with the receiving device, and simultaneously send the original data and hash value X to the receiving device, while simultaneously obtaining the hash value Y stored in the receiving device. N-1 .

[0015] Preferably, the first storage unit constructs a queue x: [X1, X2, ..., X...] using the hash values ​​of several original data stored in it. N ].

[0016] A receiving device for secure data transmission includes a second data processing unit, a second storage unit, and a second communication unit;

[0017] The second communication unit is used to establish a communication connection with the transmitting device, receive the raw data and hash value X sent by the transmitting device, and obtain the received data;

[0018] The second data processing unit is used to perform a hash operation on the received data, generate a hash value Y, and determine whether the hash value X and the hash value Y are the same;

[0019] The hash value X is obtained by the sending device performing a hash operation on the Nth original data. N The hash value Y obtained by the receiving device performing a hash operation on the (N-1)th received data. N-1 The hash value Y is generated by the receiving device performing a hash operation on the Nth received data. Nand the hash value Y obtained by performing hash operation on the N-1th received data received by the receiving device N-1 combined generation

[0020] The second storage unit is configured to store the Nth received data and the hash value Y N .

[0021] Preferably, the hash values of the several received data stored by the second storage unit constitute a queue y: [Y1, Y2, …, Y N ].

[0022] Preferably, the system further comprises a periodic unit configured to set a time for acquiring the queue x stored by the sending device, and periodically check whether the data is abnormal by comparing the queue x and the queue y by using the second output processing unit.

[0023] A data security transmission system comprises:

[0024] a sending device and a receiving device, wherein

[0025] The sending device comprises:

[0026] a first data processing unit configured to perform hash operation on original data and generate a hash value X;

[0027] a first storage unit configured to store the original data and the hash value X;

[0028] a first communication unit configured to establish a communication connection with the receiving device;

[0029] The receiving device comprises:

[0030] a second data processing unit configured to perform hash operation on received data and generate a hash value Y, and judge whether the hash value X and the hash value Y are the same;

[0031] a second storage unit configured to store the received data and the hash value Y;

[0032] a second communication unit configured to establish a communication connection with the sending device.

[0033] The beneficial effects of the present application are as follows:

[0034] 1. For some important data, if loss or tampering occurs during transmission, it can be discovered or identified in time.

[0035] 2. The data transmission method of the present application has strong application flexibility and expands the application scenarios.

[0036] 3. The present application adopts hash value X N and hash value Y N-1 to generate hash value X and hash value YN and the hash value Y N-1 The way of combining the hash value Y with the data to produce Y ensures that each data transmission is traceable, and improves the credibility of the data transmission. BRIEF DESCRIPTION OF DRAWINGS

[0037] Figure 1 is a system architecture diagram of a data security transmission method based on a hash algorithm according to an embodiment of the present application;

[0038] Figure 2 is a flowchart of a data security transmission method based on a hash algorithm according to an embodiment of the present application;

[0039] Figure 3 is a flowchart of a data security transmission method based on a hash algorithm according to another embodiment of the present application; DETAILED DESCRIPTION

[0040] The specific implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the embodiments of the present application, and is not used to limit the embodiments of the present application.

[0041] Referring to Figure 1 shown is a system architecture diagram of a data security transmission method based on a hash algorithm according to an embodiment of the present application. The application environment of the system includes but is not limited to data transmission of a nuclear power plant. The system includes a sending device and a receiving device. In this embodiment, the sending device can be a reactor and related devices (such as a main pump, a pressurizer, a generator, etc.) of a nuclear power plant. The transmitted data includes but is not limited to reaction data, operating parameters, and control data, etc. The receiving device can be a remote terminal, a PC, a mobile terminal (such as a mobile phone, a computer, etc.). Continue to combine Figure 1 The specific working principle of the system architecture will be described. The sending device sends data one by one. For each data, a hash operation is first performed on the original data to be sent. The hash algorithm is preferably SHA-256. Starting from the first original data, the hash value X1 of the first original data is calculated. The hash value X1 is combined with a reference value. The reference value can come from the sending device or the receiving device. When it comes from the sending device, assuming that there are N original data, the value of N is 1, 2, 3, etc., the reference value is the hash value of the (N-1)th original data. For the hash value of the 0th original data, a fixed setting value is usually used, for example, 0000.

[0042] In this embodiment, the reference value is preferably from the receiving device. At this time, the initial reference value of the receiving device also needs to be set. The initial reference value (Y0) is also usually set to 0000.

[0043] The combination of the hash value X1 and the reference value can be to perform hash operation on the hash value X1 and the reference value again.

[0044] Therefore, before the sending device sends data, the initial reference value (Y0) is acquired, and then the sending device sends the first original data, the combination of the hash value X1 and the reference value to the receiving device. The receiving device performs hash operation on the received first original data (the received original data is hereinafter referred to as received data) to obtain a hash value Y1. The hash value Y1 is combined with the reference value again in the above combination manner to determine whether the combination of Y1 and the reference value is the same as the combination of X1 and the reference value. If yes, the data transmission is normal, and Y1 is taken as a new reference value. If no, the data transmission is abnormal, and the data transmission is interrupted in time to inform the staff, which has high timeliness.

[0045] When the second original data is transmitted, the transmission mode is the same as that of the first data. The sending device stores hash values of all received data, so that each data transmission can be traced, and the credibility of data transmission is improved.

[0046] Referring to Figure 2 The flowchart shows a method for realizing data secure transmission based on a hash algorithm according to an embodiment of the present application. The method comprises the following steps.

[0047] Step 101: The receiving device receives original data and a hash value X of the sending device, and obtains received data. In the embodiment, the original data includes but is not limited to reaction data, operation parameters and control data of a nuclear power plant, and the hash value X is a hash value X obtained by performing hash operation on the Nth original data by the sending device. N The hash value Y is a hash value Y obtained by performing hash operation on the N-1th received data by the receiving device. N-1 The combination is generated. The hash value Y0 can be an initial value set on the sending device, or an initial value set on the receiving device. When the initial value is set on the receiving device, the sending device needs to acquire the hash value Y0 on the receiving device before sending the first original data.

[0048] Step 102: The receiving device generates a hash value Y again according to the received data. The hash value Y is a hash value Y obtained by performing hash operation on the Nth received data by the receiving device. N The hash value Y is a hash value Y obtained by performing hash operation on the N-1th received data by the receiving device. N-1 The combination is generated.

[0049] Step 103: The receiving device checks whether hash value X and hash value Y are the same. If they are the same, the data transmission is considered to be normal, and the receiving device stores the hash value Y of the correctly received data. N Meanwhile, the receiving device will then transmit the hash value Y again. N The data is sent to the transmitting device as a reference value for the next original data transmission; if they are different, the data transmission is considered abnormal, the data transmission is interrupted, and the staff is notified that the data transmission is abnormal.

[0050] In this embodiment, a periodic verification step is also included during data transmission. This involves setting a timer, and upon the timer expires, verifying all transmitted data. Specifically, the periodic verification involves obtaining the hash values ​​of all original data from the sending device to form a queue x: [X1, X2, ..., X...]. N The hash values ​​of all received data stored are used to form a queue y: [Y1, Y2, ..., Y...]. N The system compares queue x with queue y to verify whether the data is abnormal. Since both the receiving and sending devices store data that is not abnormal, it can be proven that each data transmission is traceable, thus improving the reliability of data transmission.

[0051] This embodiment also provides a receiving device for secure data transmission, including a second data processing unit, a second storage unit, and a second communication unit;

[0052] The second communication unit is used to establish a communication connection with the transmitting device, including but not limited to a wireless connection or a wired connection, to receive the raw data and hash value X sent by the transmitting device, and to obtain the received data;

[0053] The second data processing unit is used to perform a hash operation on the received data and determine whether the hash value X and the hash value Y are the same;

[0054] The second storage unit is used to store the Nth received data and the hash value Y. N The hash values ​​of several received data stored in the second storage unit constitute a queue y: [Y1, Y2, ..., Y... N ].

[0055] In this embodiment, the receiving device further includes a periodic unit: used to set the time for acquiring queue x stored by the sending device, and to use the second output processing unit to compare queue x and queue y to periodically check whether the data is abnormal. The specific details and benefits of the receiving device are the same as those described above for the method of implementing secure data transmission based on a hash algorithm, and will not be repeated here.

[0056] See Figure 3A flow chart of a method for realizing data secure transmission based on a hash algorithm is shown, comprising:

[0057] Step 201: The sending device acquires the initial hash value Y generated by the receiving device N-1 ; wherein the initial value Y0 is set artificially on the receiving device, and is preferably set as 0000;

[0058] Step 202: The sending device performs hash operation on the Nth original data to obtain a hash value X N , and then combines the hash value X N with the hash value Y N-1 to obtain a hash value X.

[0059] Step 203: The sending device simultaneously sends the hash value X and the Nth original data to the receiving device.

[0060] It should be noted that the acquisition of the hash value Y1 is performed by the receiving device after receiving the hash value X and the first original data. The receiving device performs hash operation on the received first original data (referred to as the first received data) to obtain Y1, and then combines Y1 with Y0 to obtain Y. The receiving device compares X and Y to determine whether they are the same. If they are the same, Y1 is retained. Before the transmission of the second original data, the sending device acquires Y1 again.

[0061] The transmission of the third original data and the Nth original data is the same as the above processing mode.

[0062] In this embodiment, a sending device for data secure transmission is also provided, comprising a first data processing unit, a first storage unit and a first communication unit.

[0063] The first communication unit is configured to establish a communication connection with the sending device, including but not limited to wireless connection or wired connection, etc. The first data processing unit is configured to perform hash operation on the original data.

[0064] The first storage unit is configured to store the original data and the hash value X N , and also store the hash values of a plurality of original data to form a queue x: [X1, X2, …, X N ] and the hash value Y N . The specific details and benefits of the sending device are the same as those of the above-mentioned method for realizing data secure transmission based on a hash algorithm, and will not be described herein.

[0065] In this embodiment, a data secure transmission system is also provided. The specific details and benefits of the system are the same as those of the above-mentioned method for realizing data secure transmission based on a hash algorithm, and will not be described herein.

[0066] The optional embodiments of the application are described in detail above in combination with the drawings, but the embodiments of the application are not limited to the specific details in the above-described embodiments. Within the technical concept of the embodiments of the application, various simple modifications can be made to the technical solutions of the embodiments of the application, and these simple modifications all belong to the protection scope of the embodiments of the application.

[0067] In addition, it should be noted that each specific technical feature described in the above specific embodiments can be combined in any appropriate manner without contradiction. In order to avoid unnecessary repetition, various possible combinations are not described again in the embodiments of the application.

[0068] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiment methods can be completed by using a program instructing related hardware. The program is stored in a storage medium and includes a plurality of instructions for causing one (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the above-mentioned method of each embodiment of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0069] In addition, various different embodiments of the embodiments of the application can also be combined in any appropriate manner, as long as they do not contradict the idea of the embodiments of the application, and they should also be considered as disclosed by the embodiments of the application.

Claims

1. A method for secure data transmission based on a hash algorithm, applied to a receiving device, characterized in that: The method comprises: Receive the original data of the sending device and the hash value X, and obtain the received data, wherein the hash value X is the hash value obtained by the sending device performing hash operation on the Nth original data N and the hash value Y obtained by the receiving device performing hash operation on the N-1th received data N-1 Combined generation; According to the received data, a hash value Y is generated again, the hash value Y being a hash value Y obtained by performing a hash operation on the Nth received data received by the receiving device N and the hash value Y obtained by performing a hash operation on the (N-1)th received data received by the receiving device N-1 Combined generation; the value of N is: 1, 2, 3… It is judged whether the hash value X and the hash value Y are same, if same, it is considered that data transmission is normal, if not same, it is considered that data transmission is abnormal.

2. The method for realizing data security transmission based on hash algorithm according to claim 1, characterized in that: If the data transmission is normal, the receiving device stores the hash value Y of the Nth received data N .

3. The method for realizing data security transmission based on hash algorithm according to claim 2, characterized in that: The initial hash value Y0 stored by the receiving device is 0.

4. The method for realizing data security transmission based on hash algorithm according to claim 3, characterized in that: It also includes a periodic verification step, wherein the periodic verification is: obtaining the hash values ​​of all raw data from the sending device to form a queue x: [X1, X2, ..., X...] N The hash values ​​of all received data stored are used to form a queue y: [Y1, Y2, ..., Y...]. N The function compares queue x with queue y to check if the data is abnormal.

5. A transmitting device for secure transmission of data, characterized by: It comprises a first data processing unit, a first storage unit and a first communication unit; The first data processing unit is configured to perform a hash operation on the original data and generate a hash value X, the hash value X being obtained by performing a hash operation on the Nth original data by the first data processing unit N and the receiving device performs a hash operation on the N-1th received data to obtain a hash value Y N-1 combined generation; The first storage unit is configured to store the original data and the hash value X N ; The first communication unit is configured to establish a communication connection with the receiving device and simultaneously send the original data and the hash value X to the receiving device, and simultaneously acquire the hash value Y stored by the receiving device N-1 .

6. The data secure transmission sending device according to claim 5, characterized in that: The first storage unit forms a queue x: [X1, X2,..., Xn] of the hash values of the stored original data. N ] 7. A receiving device for secure transmission of data, characterized by: It comprises a second data processing unit, a second storage unit and a second communication unit; The second communication unit is used for establishing a communication connection with the sending device, receiving the original data and the hash value X sent by the sending device, and obtaining the received data; The second data processing unit is used for performing hash operation on the received data to generate a hash value Y, and judging whether the hash value X and the hash value Y are same; Wherein the hash value X is a hash value X obtained by the sending device hashing the Nth original data N and the hash value Y obtained by the receiving device hashing the N-1th received data received by the receiving device N-1 combined generation; the hash value Y is a hash value Y obtained by the receiving device hashing the Nth received data received by the receiving device N and the hash value Y obtained by the receiving device hashing the N-1th received data received by the receiving device N-1 combined generation; The second storage unit is configured to store the Nth received data and the hash value Y N .

8. The data secure transmission receiving device according to claim 7, characterized in that: The hash values ​​of several received data stored in the second storage unit constitute a queue y: [Y1, Y2, ..., Y... N ].

9. The data secure transmission receiving device according to claim 8, characterized in that: It also comprises a periodic unit: for setting the time of obtaining the queue x stored by the sending device, comparing the queue x and the queue y by using the second output processing unit, and periodically checking whether the data is abnormal.

10. A data secure transmission system characterized by: It comprises: The sending device and the receiving device, wherein, The sending device comprises: The first data processing unit is configured to perform a hash operation on the original data and generate a hash value X, wherein the hash value X is obtained by performing a hash operation on the Nth original data by the first data processing unit N and the receiving device performs a hash operation on the N-1th received data to obtain a hash value Y N-1 combined generation; The first storage unit is used to store the original data and the hash value X N ; The first communication unit is configured to establish a communication connection with the receiving device and simultaneously transmit the raw data and the hash value X to the receiving device, while obtaining the hash value Y stored by the receiving device N-1 ; The receiving device comprises: The second data processing unit is used for performing hash operation on the received data to generate a hash value Y, and judging whether the hash value X and the hash value Y are same; wherein the hash value X is a hash value X obtained by the transmitting device hashing the Nth original data N and the hash value Y obtained by the receiving device hashing the N-1th received data received by the receiving device N-1 is combined; the hash value Y is a hash value Y obtained by the receiving device hashing the Nth received data received by the receiving device N and the hash value Y obtained by the receiving device hashing the N-1th received data received by the receiving device N-1 is combined; a second storage unit for storing the Nth received data and the hash value Y N ; The second communication unit is used for establishing a communication connection with the sending device, receiving the original data and the hash value X sent by the sending device, and obtaining the received data.

Citation Information

Patent Citations

  • Method and device for uploading data to blockchain system, equipment and medium

    CN112087530A

  • Hash value generation management method and device and electronic document management method and system and program

    JP2006197150A