Waveform data encryption storage and transmission method based on AES algorithm

By using the AES algorithm and SHA1 algorithm to encrypt the initial key and waveform data in radio frequency signal measurement, the problem of data being modified or leaked during the transmission process is solved, the secure transmission and storage of data is realized, and the security of the data is ensured. Integrity and Confidentiality.

CN118337370BActive Publication Date: 2024-10-11CHENGDU ZHONGCHUANG RUIKE INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410772750.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-10-11
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

In radio frequency signal measurement, the collected waveform data is easily modified or leaked during the transmission process. Existing encryption technology cannot effectively guarantee the security of the data, especially in a confidential environment.

Method used

The waveform data encryption method based on the AES algorithm is adopted, including the encryption of the initial key and waveform data, the SHA1 algorithm is used to calculate the hash value to generate the encryption key, and the AES encryption and decryption algorithm is used to encrypt and decrypt the data to construct the encrypted file description. information to ensure the integrity and security of data during transmission.

Benefits of technology

Through the combination of AES encryption algorithm and SHA1 algorithm, the security of waveform data during transmission is achieved, avoiding data modification or leakage, and ensuring data integrity and confidentiality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118337370B_ABST
    Figure CN118337370B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of data encryption transmission, and relates to a waveform data encryption storage and transmission method based on the AES algorithm. The method includes an encryption stage, a decryption stage, a storage stage and a stream transmission stage; the encryption stage includes encryption of an initial key and encryption of waveform data. The present invention uses the AES encryption algorithm and the SHA1 algorithm to encrypt waveform data at the acquisition end, realizes encrypted storage and transmission, and restores the original waveform data by decryption, which can prevent data from being modified or leaked during transmission, and can ensure the security of waveform data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data encryption transmission, and in particular, relates to a waveform data encryption storage and transmission method based on an AES algorithm. Background Art

[0002] In RF signal measurement, it is often necessary to collect a large amount of data and save it for subsequent analysis, or transmit it through the network to a laboratory far away from the test site for analysis and processing. The data is easily modified or leaked during the transmission process, and the security of encrypted files and data cannot be guaranteed. Especially in some environments that require confidentiality, waveform data encryption, storage and transmission are particularly important. Summary of the invention

[0003] In order to solve the above technical problems, the present invention provides a waveform data encryption storage and transmission method based on the AES algorithm, including an encryption stage, a decryption stage, a storage stage and a stream transmission stage;

[0004] The encryption stage includes encryption of the initial key and encryption of the waveform data;

[0005] The encryption of the initial key includes:

[0006] Set the initial key and build an intermediate data of a set size;

[0007] Divide the initial key into several parts, divide the intermediate data into several groups according to the byte size, select the same number of groups as the initial key, and place each part of the initial key into a group respectively;

[0008] The intermediate data after the initial key is placed is encrypted using the AES encryption algorithm to obtain the encrypted header data of the intermediate data;

[0009] Encryption of waveform data includes:

[0010] The SHA1 algorithm is used to calculate the hash value of the intermediate data, the SHA1 algorithm returns the hash value of the first set byte size, and the data of the second set byte size is taken as the encryption key of the waveform data;

[0011] Segmenting the recorded waveform data according to a second set byte size, and encrypting each waveform data segmented by the second set byte size using an AES encryption algorithm to obtain encrypted data of each segmented waveform data;

[0012] The encrypted header data of the intermediate data is stored in the header of the encrypted data of each segmented waveform data and sent;

[0013] The decryption phase includes:

[0014] Decrypt the encrypted header data of the intermediate data according to the initial key to obtain the intermediate data after placing the initial key;

[0015] The SHA1 algorithm is used to calculate the hash value of the intermediate data after the initial key is placed, and the data of the second set byte size is taken to obtain the key of the encrypted data of the waveform data;

[0016] After obtaining the encryption key of the waveform data, the waveform data is grouped according to the second set byte size, and the encrypted data of each group of waveform data is decrypted using the AES decryption algorithm to obtain the original waveform data;

[0017] The storage stage includes: adding encrypted header data and encrypted file description information to the encrypted data of the waveform data for storage;

[0018] The streaming phase consists of:

[0019] Construct a waveform data frame and use the waveform data frame to send data; a waveform data frame refers to a fixed-length data segment consisting of encrypted file description information of set bytes added to the waveform data header; a waveform data frame is a combination of frame header mark information, encrypted header data and encrypted data of waveform data.

[0020] Based on the above technical solution, the present invention can also be improved as follows.

[0021] Furthermore, the byte size of each part of the initial key is the same; after the intermediate data is divided into a number of groups according to the byte size, the byte size of each group is the same as the byte size of each part of the initial key.

[0022] Furthermore, the recorded waveform data is segmented according to a second set byte size, and if the number of bytes in the data segment is less than the second set byte size, it is padded with 0.

[0023] Furthermore, the encrypted file description information includes the version number of the file format, the number of waveform data samples, the instrument information for collecting the waveform data, and the collection date.

[0024] Furthermore, the SHA1 algorithm is used to divide the intermediate data into 512-bit groups to generate a 160-bit hash value.

[0025] Furthermore, in the stream transmission stage, every 1024 bytes are set as a data frame, the first 32 bytes of the data frame are used as frame header mark information, the second 32 bytes are used as bytes of the transmission key, and the remaining bytes transmit the encrypted waveform data.

[0026] Furthermore, the same number of groups as the initial key is selected, and each part of the initial key is placed into a group respectively, and the groups where the initial key is not placed are filled with random byte values.

[0027] Furthermore, in the stream transmission mode, after receiving an encrypted waveform data stream greater than a set length, the starting position of the waveform data frame is obtained according to the frame header mark information of the encrypted waveform data frame, and then the complete encrypted waveform data frame is separated, and then the encryption key of the waveform data is determined by decryption according to the set initial key, and the AES decryption algorithm is used to decrypt the encrypted data to obtain the original waveform data.

[0028] The beneficial effects of the present invention are as follows: the present invention uses the AES encryption algorithm and the SHA1 algorithm to encrypt the waveform data at the acquisition end to achieve encrypted storage and transmission, and restores the original waveform data by decryption, which can prevent the data from being modified or leaked during transmission and ensure the security of the waveform data. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 A schematic diagram of the encryption phase in the waveform data encryption storage and transmission method based on the AES algorithm provided in an embodiment of the present invention;

[0030] Figure 2 A schematic diagram of the decryption phase of the waveform data encryption, storage and transmission method based on the AES algorithm provided in an embodiment of the present invention;

[0031] Figure 3 A schematic diagram of the AES encryption and decryption process provided by an embodiment of the present invention;

[0032] Figure 4 A schematic diagram of a waveform data encryption process provided by an embodiment of the present invention;

[0033] Figure 5 A schematic diagram of a waveform data decryption process provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0035] As an embodiment, in order to solve the above technical problems, this embodiment provides a waveform data encryption storage and transmission method based on the AES algorithm, including an encryption stage, a decryption stage, a storage stage and a stream transmission stage;

[0036] As attached Figure 1 As shown, the encryption stage includes encryption of the initial key and encryption of the waveform data;

[0037] The encryption of the initial key includes:

[0038] Set the initial key and build an intermediate data of a set size;

[0039] Divide the initial key into several parts, divide the intermediate data into several groups according to the byte size, select the same number of groups as the initial key, and place each part of the initial key into a group respectively;

[0040] The intermediate data after the initial key is placed is encrypted using the AES encryption algorithm to obtain the encrypted header data of the intermediate data;

[0041] Encryption of waveform data includes:

[0042] The SHA1 algorithm is used to calculate the hash value of the intermediate data, the SHA1 algorithm returns the hash value of the first set byte size, and the data of the second set byte size is taken as the encryption key of the waveform data;

[0043] Segmenting the recorded waveform data according to a second set byte size, and encrypting each waveform data segmented by the second set byte size using an AES encryption algorithm to obtain encrypted data of each segmented waveform data;

[0044] The encrypted header data of the intermediate data is stored in the header of the encrypted data of each segmented waveform data and sent;

[0045] As attached Figure 2 As shown, the decryption stage includes:

[0046] Decrypt the encrypted header data of the intermediate data according to the initial key to obtain the intermediate data after placing the initial key;

[0047] The SHA1 algorithm is used to calculate the hash value of the intermediate data after the initial key is placed, and the data of the second set byte size is taken to obtain the key of the encrypted data of the waveform data;

[0048] After obtaining the encryption key of the waveform data, the waveform data is grouped according to the second set byte size, and the encrypted data of each group of waveform data is decrypted using the AES decryption algorithm to obtain the original waveform data;

[0049] The storage stage includes: adding encrypted header data and encrypted file description information to the encrypted data of the waveform data for storage;

[0050] The streaming phase consists of:

[0051] Construct a waveform data frame and use the waveform data frame to send data; a waveform data frame refers to a fixed-length data segment consisting of encrypted file description information of set bytes added to the waveform data header; a waveform data frame is a combination of frame header mark information, encrypted header data and encrypted data of waveform data.

[0052] In actual application, AES (Advanced Encryption Standard) is a symmetric encryption algorithm. The encryption process is as follows: Figure 3 As shown in the figure, the AES encryption function uses a key to encrypt plain text into cipher text for transmission, and the AES decryption function uses a key to decrypt cipher text and restore it to plain text.

[0053] A hash value is a fixed-length value calculated from the original data through a hash algorithm to ensure the integrity and consistency of data transmission. The same input data will generate the same hash value, and different input data will generate different hash values.

[0054] The SHA1 algorithm is a secure hash algorithm that divides the input data into 512-bit groups and processes each group to generate a 160-bit hash value. For different data, the SHA1 algorithm will generate different 160-bit hash values.

[0055] The waveform data file or the waveform data transmission stream contains the initial key and the waveform data. The encryption process of the present invention includes encryption of the initial key and encryption of the waveform data.

[0056] First, the encryption header data of the waveform data and the encryption key of the waveform data are constructed, including the following steps:

[0057] A 16-bit initial key is set, denoted as Init_key. The initial key is set according to actual needs or changed regularly. For example, the initial key is set to [240, 225, 210, 195, 180, 165, 150, 135, 120, 105,90, 75, 60, 45, 30, 15]. On this basis, a 32-byte intermediate data is constructed, denoted as Plain_header. The intermediate data is divided into 4 groups, each with 8 bytes. The first group contains the value of the first 8 bytes of the initial key, the third group contains the value of the last 8 bytes of the initial key, and the second and fourth groups each contain 8 bytes of random values. The format of the intermediate data Plain_header is shown in Table 1.

[0058] Table 1 Format of intermediate data Plain_header

[0059]

[0060] Random byte values ​​are used in the second and fourth groups of the intermediate data Plain_header data, so that even if the same initial key Init_key is used, it can be ensured that the keys of the Crypt_header data and the waveform data calculated each time are different, which can significantly improve the encryption effect of the data.

[0061] The intermediate data Plain_header is encrypted using the AES encryption algorithm to generate 32 bytes of encrypted data, and the encrypted header data of the intermediate data is obtained, which is recorded as Crypt_header;

[0062] The SHA1 algorithm is used to calculate the hash value of the intermediate data Plain_header. The SHA1 algorithm returns a 20-byte hash value. The first 16 bytes of data are taken as the key for waveform data encryption, recorded as Data_key.

[0063] After obtaining the waveform data key Data_key, the recorded waveform data is segmented into 16 bytes according to the requirements of the AES algorithm. If the number of bytes in the data segment is less than 16 bytes, it is padded with 0 according to the method specified by the AES algorithm. AES encryption is performed on each 16 bytes of waveform data to generate encrypted data of the waveform data, which is recorded as Crypt_data. Figure 4 The waveform data encryption process is shown.

[0064] The decryption process is the reverse operation of the encryption process, which recovers the original waveform data from the encrypted data file or encrypted data stream. Figure 5 As shown, the specific steps include:

[0065] Decrypt the encrypted header data Crypt_header of the intermediate data according to the initial key Init_key and restore it to the 32-byte intermediate data Plain_header. Then use the SHA1 algorithm to calculate the hash value of the intermediate data Plain_header, and take the value of the first 16 bytes to obtain the key Data_key for waveform data encryption.

[0066] The encrypted data Crypt_data of the waveform data is decrypted using the AES algorithm in groups of 16 bytes to restore the original waveform data.

[0067] The byte size of each part of the initial key is the same; after the intermediate data is divided into a number of groups according to the byte size, the byte size of each group is the same as the byte size of each part of the initial key.

[0068] The recorded waveform data is segmented according to the second set byte size. If the number of bytes in the data segment is less than the second set byte size, it is padded with 0.

[0069] The encrypted file description information includes the version number of the file format, the number of waveform data samples, the instrument information for collecting the waveform data, and the collection date.

[0070] The storage format of the encrypted file is shown in Table 2.

[0071] Table 2 Storage format of encrypted files

[0072]

[0073] When encrypting and storing files, the encryption process is as follows:

[0074] According to the initial key Init_key, the key Data_key for encrypting the waveform data is obtained, and the header information containing the initial key, namely the intermediate data Plain_header, is constructed using the initial key Init_key. Then, the intermediate data Plain_header is encrypted using AES with the initial key Init_key to obtain the encrypted header data Crypt_header of the intermediate data.

[0075] The file description information is recorded as Plain_desc, and the encrypted file description information is recorded as Crypt_desc. The file description information Plain_desc is encrypted using the AES encryption method according to the key Data_key of the waveform data to obtain the encrypted file description information Crypt_desc.

[0076] The waveform data is encrypted using the AES encryption method according to the waveform data's key Data_key to obtain encrypted data Crypt_data of the waveform data.

[0077] The data obtained above is stored in the storage format of the encrypted file in Table 2 to obtain the final encrypted file.

[0078] When decrypting an encrypted file, the key Data_key of the waveform data is determined according to the initial key Init_key; the key Data_key of the waveform data is used to decrypt the file description information using the AES decryption method to extract the file description information; the key Data_key of the waveform data is used to decrypt the waveform data using the AES decryption method to extract the waveform data.

[0079] The SHA1 algorithm is used to divide the intermediate data into 512-bit groups to generate a 160-bit hash value.

[0080] In the streaming stage, every 1024 bytes is set as a data frame, the first 32 bytes of the data frame are used as the frame header mark information, the second 32 bytes are used as the bytes of the transmission key, and the remaining bytes are used to transmit the encrypted waveform data. As shown in Table 3, the encrypted waveform data frame during streaming transmission.

[0081] Table 3 Encrypted waveform data frame during streaming

[0082]

[0083] Select the same number of groups as the initial key, place each part of the initial key into a group, and fill the groups without the initial key with random byte values.

[0084] In the stream transmission mode, after receiving the encrypted waveform data stream longer than the set length (such as longer than the length of two encrypted waveform data frames), the starting position of the waveform data frame is obtained according to the frame header mark information of the encrypted waveform data frame, and then the complete encrypted waveform data frame is separated, and then the encryption key of the waveform data is determined by decryption according to the set initial key, and the AES decryption algorithm is used to decrypt and obtain the original waveform data.

[0085] Specifically, the waveform data frame encryption process includes the following steps:

[0086] According to the initial key Init_key, the key Data_key of the waveform data is obtained, and the initial key Init_key is used to construct the intermediate data Plain_header containing the initial key, and then the initial key Init_key is used to encrypt the intermediate data Plain_header of the initial key using AES to obtain the encrypted header data Crypt_header of the encrypted intermediate data; the waveform data key Data_key is used to encrypt the waveform data using the AES encryption method to obtain the encrypted data Crypt_data of the waveform data; a waveform data frame is constructed using the data frame format in Table 3 and sent out.

[0087] Specifically, the waveform data frame decryption process includes the following steps:

[0088] An encrypted waveform data frame is obtained according to the frame header tag information; the key Data_key of the waveform data is obtained according to the initial key Init_key; the waveform data key Data_key is used to decrypt the waveform data using the AES decryption method to extract the waveform data.

[0089] The present invention adopts AES encryption algorithm and SHA1 algorithm to encrypt waveform data at the acquisition end to realize encrypted storage and transmission. The original waveform data can be restored by decryption, which can avoid data modification or leakage during transmission and ensure the security of waveform data.

[0090] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A waveform data encryption storage and transmission method based on the AES algorithm, characterized in that: It includes encryption stage, decryption stage, storage stage and streaming stage; The encryption stage includes encryption of the initial key and encryption of the waveform data; The encryption of the initial key includes: Set the initial key and build an intermediate data of a set size; Divide the initial key into several parts, divide the intermediate data into several groups according to the byte size, select the same number of groups as the initial key, place each part of the initial key into a group, fill the group without the initial key with a random byte value, and use the data of all the groups of the intermediate data as the intermediate data Plain_header; Use the initial key to encrypt the intermediate data Plain_header using the AES encryption algorithm to obtain the encrypted header data of the intermediate data; Encryption of waveform data includes: The intermediate data Plain_header is calculated using the SHA1 algorithm. The SHA1 algorithm returns a hash value of the first set byte size, and the data of the second set byte size is taken as the encryption key of the waveform data. Segmenting the recorded waveform data according to a second set byte size, and encrypting each waveform data segmented by the second set byte size using an AES encryption algorithm to obtain encrypted data of each segmented waveform data; The encrypted header data of the intermediate data is stored in the header of the encrypted data of each segmented waveform data and sent; The decryption phase includes: Decrypt the encrypted header data of the intermediate data according to the initial key to obtain the intermediate data Plain_header; The SHA1 algorithm is used to calculate the hash value of the intermediate data Plain_header, and the data of the first second set byte size is taken to obtain the key of the encrypted data of the waveform data; After obtaining the encryption key of the waveform data, the waveform data is grouped according to the second set byte size, and the encrypted data of each group of waveform data is decrypted using the AES decryption algorithm to obtain the original waveform data; The storage stage includes: adding encrypted header data of intermediate data and encrypted file description information to the encrypted data of the waveform data for storage; The streaming phase consists of: Construct a waveform data frame and use the waveform data frame to send data; a waveform data frame refers to a fixed-length data segment consisting of encrypted file description information of set bytes added to the waveform data header; a waveform data frame is a combination of frame header mark information, encrypted header data of intermediate data, and encrypted data of waveform data.

2. The waveform data encryption storage and transmission method based on the AES algorithm according to claim 1 is characterized in that: The byte size of each part of the initial key is the same; after the intermediate data is divided into a number of groups according to the byte size, the byte size of each group is the same as the byte size of each part of the initial key.

3. The waveform data encryption storage and transmission method based on the AES algorithm according to claim 1 is characterized in that: The recorded waveform data is segmented according to the second set byte size. If the number of bytes in the data segment is less than the second set byte size, it is padded with 0.

4. The waveform data encryption storage and transmission method based on the AES algorithm according to claim 1 is characterized in that: The encrypted file description information includes the version number of the file format, the number of waveform data samples, the instrument information for collecting the waveform data, and the collection date.

5. The waveform data encryption storage and transmission method based on the AES algorithm according to claim 1 is characterized in that: The SHA1 algorithm is used to divide the intermediate data into 512-bit groups to generate a 160-bit hash value.

6. The waveform data encryption storage and transmission method based on the AES algorithm according to claim 1 is characterized in that: In the streaming transmission stage, every 1024 bytes are set as a data frame, the first 32 bytes of the data frame are used as frame header mark information, the second 32 bytes are used as bytes of the transmission key, and the remaining bytes transmit the encrypted waveform data.

7. The waveform data encryption storage and transmission method based on the AES algorithm according to claim 1 is characterized in that: In the streaming transmission mode, after receiving the encrypted waveform data stream longer than the set length, the starting position of the waveform data frame is obtained according to the frame header mark information of the encrypted waveform data frame, and then the complete encrypted waveform data frame is separated. Then, the encryption key of the waveform data is determined by decryption according to the set initial key, and the AES decryption algorithm is used to decrypt it to obtain the original waveform data.