A data communication encryption method for vehicle networking
By decimal conversion and position transformation of vehicle network data, a key matrix is generated for encryption, the problem of short key length and low security in the prior art is solved, and high-security data transmission is achieved.
Patent Information
- Application Number
- CN202411223400.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-09-03
AI Technical Summary
In the existing Internet of Vehicles data communication encryption technology, the key length is short and the security is low, so it cannot effectively protect the sensitive data transmitted by the vehicle.
Convert binary data into decimal, perform horizontal and vertical position transformation, generate first and second key matrices, and encrypt them according to the data distribution characteristic values to increase the security of encrypted data.
It improves the security of encrypted data, makes it difficult for the thief to crack under the premise of unknown original data and encryption processes, and enhances the security of data transmission.
Smart Images

Figure CN118741495B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data communication encryption, and in particular to a data communication encryption method for an Internet of Vehicles. Background Art
[0002] The Internet of Vehicles (IoV) technology is an important part of the intelligent transportation system. It realizes intelligent traffic management, intelligent dynamic information services, and intelligent vehicle control through all-round connection and information exchange between vehicles, vehicles and people, vehicles and roadside facilities, and vehicles and networks. With the development and application of IoV technology, data security and privacy protection have become an urgent problem to be solved. Because vehicles generate and transmit a large amount of sensitive data during driving, such as location information, speed, direction, etc., the leakage of this information may threaten the privacy of users and even be used maliciously.
[0003] In order to ensure the security of data transmission in the Internet of Vehicles, the use of encryption technology to protect data is an effective means. When the existing encryption technology encrypts the data to be transmitted, a random sequence is used to encrypt the data to be transmitted to obtain encrypted data, which has the problems of short key length and low security. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a data communication encryption method for an Internet of Vehicles, which solves the problems of short key length and low security in the prior art.
[0005] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: a data communication encryption method for an Internet of Vehicles, comprising the following steps:
[0006] S1. Convert the binary data to be encrypted in the Internet of Vehicles into decimal data to be encrypted;
[0007] S2, converting the one-dimensional decimal data to be encrypted into two-dimensional decimal data to be encrypted;
[0008] S3, performing horizontal and vertical position transformation on the two-dimensional decimal data to be encrypted to obtain position-transformed data to be encrypted;
[0009] S4, generating a first key matrix and a second key matrix according to the data distribution characteristic value of the data to be encrypted according to the position transformation;
[0010] S5, using the first key matrix and the second key matrix to encrypt the position-changed data to be encrypted to obtain encrypted data;
[0011] S6. Convert the encrypted data into binary to obtain the encrypted data to be transmitted.
[0012] Furthermore, the S1 specifically includes: converting the binary data to be encrypted in the Internet of Vehicles into a decimal value in units of one byte.
[0013] Furthermore, the S2 comprises the following sub-steps:
[0014] S21, segmenting the one-dimensional decimal data to be encrypted according to a fixed length N to obtain multiple data groups, wherein the length of each data group is N, N is a positive integer, and when the length of the data group is insufficient, 0 is used for padding;
[0015] S22, each data group is formed into two-dimensional decimal data to be encrypted, , where A is the two-dimensional decimal data to be encrypted, a1 is the first row of data group, a i is the i-th row data set, a M is the Mth row of data groups, M is the number of horizontal data groups, and i is a positive integer.
[0016] Furthermore, S3 includes the following sub-steps:
[0017] S31, exchanging the values of the i-th row data group and the M-i+1-th row data group in the two-dimensional decimal data to be encrypted, 1≤i≤M / 2, i is a positive integer, to obtain the data to be encrypted after horizontal transformation;
[0018] S32. Exchange the values of the j-th column data group and the K-i+1-th column data group in the data to be encrypted after the horizontal transformation, 1≤j≤K / 2, j is a positive integer, K is the number of vertical data groups, to obtain the position-transformed data to be encrypted.
[0019] Furthermore, the S4 comprises the following sub-steps:
[0020] S41, taking each value in the data to be encrypted as the center;
[0021] S42, calculating the first data distribution characteristic value at the center according to the difference between the upper and lower values within the neighborhood range of the center, and replacing it with 0 when there is no value at the upper or lower side;
[0022] S43, calculating the second data distribution characteristic value at the center according to the difference between the left and right values within the neighborhood range of the center, and replacing it with 0 when there is no value on the left or right side;
[0023] S44, constructing a first key matrix according to each first data distribution characteristic value;
[0024] S45. Construct a second key matrix according to each second data distribution characteristic value.
[0025] Furthermore, the formula for calculating the first data distribution characteristic value at the center in S42 is:
[0026] , where ξ1 is the first data distribution characteristic value, e is a natural constant, x up is the upper value within the neighborhood of the center, x down is the lower value in the neighborhood at the center, and || is the absolute value.
[0027] Furthermore, the formula for calculating the second data distribution characteristic value at the center in S43 is:
[0028] , where ξ2 is the second data distribution characteristic value, e is a natural constant, and x right is the value on the right side of the neighborhood at the center, x left is the left value in the neighborhood range at the center, and | | is the absolute value.
[0029] Furthermore, the S5 comprises the following sub-steps:
[0030] S51, using a first key matrix to encrypt the position-changed data to be encrypted, to obtain a first encryption matrix;
[0031] S52, using a second key matrix to encrypt the position-changed data to be encrypted, to obtain a second encryption matrix;
[0032] S53: Subtract the first encryption matrix from the second encryption matrix to obtain encrypted data.
[0033] Furthermore, the encryption formula in S51 is: , where S1 is the first encryption matrix, X1 is the first key matrix, G is the position-transformed data to be encrypted, For Hadamard;
[0034] The encryption formula in S52 is: , where S2 is the second encryption matrix and X2 is the second key matrix;
[0035] The subtraction formula in S53 is: , where Y is the encrypted data.
[0036] In summary, the beneficial effects of the present invention are:
[0037] 1. The present invention first converts binary data to be encrypted into decimal data to be encrypted, and the encryption process is performed in decimal to increase the security of encryption. Then, the one-dimensional decimal data to be encrypted is converted into two-dimensional decimal data to be encrypted, and the two-dimensional decimal data to be encrypted is horizontally and vertically transformed to achieve changes in numerical positions. Then, according to the data distribution characteristic values of the position-transformed data to be encrypted, a first key matrix and a second key matrix are generated. The position-transformed data to be encrypted are encrypted using the first key matrix and the second key matrix to obtain encrypted data, and the encrypted data is converted into binary for transmission. The present invention first transforms the position of the two-dimensional data to be encrypted to readjust the numerical distribution. On this basis, the data distribution characteristic values are obtained, and a key matrix is constructed for encryption processing, so that the encryption process depends on the distribution of the numerical values, thereby increasing the security of encryption.
[0038] 2. In the case that the encrypted data is stolen, the thief not only needs to construct a key matrix to crack the position-transformed data to be encrypted, but also needs to perform an inverse position transformation to restore the position of each value in order to accurately obtain the transmitted information. However, constructing the key matrix depends on the distribution of neighborhood values of each value in the position-transformed data to be encrypted. Therefore, the thief cannot crack the data without knowing the original data to be encrypted and the encryption process. The method of the present invention has high security. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 The present invention is a flow chart of a data communication encryption method for an Internet of Vehicles. DETAILED DESCRIPTION
[0040] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0041] like Figure 1 As shown, a data communication encryption method for an Internet of Vehicles includes the following steps:
[0042] S1. Convert the binary data to be encrypted in the Internet of Vehicles into decimal data to be encrypted;
[0043] S2, converting the one-dimensional decimal data to be encrypted into two-dimensional decimal data to be encrypted;
[0044] S3, performing horizontal and vertical position transformation on the two-dimensional decimal data to be encrypted to obtain position-transformed data to be encrypted;
[0045] S4, generating a first key matrix and a second key matrix according to the data distribution characteristic value of the data to be encrypted according to the position transformation;
[0046] S5, using the first key matrix and the second key matrix to encrypt the position-changed data to be encrypted to obtain encrypted data;
[0047] S6. Convert the encrypted data into binary to obtain the encrypted data to be transmitted.
[0048] The S1 specifically includes: converting the binary data to be encrypted in the Internet of Vehicles into a decimal value in units of one byte.
[0049] The S2 comprises the following sub-steps:
[0050] S21, segmenting the one-dimensional decimal data to be encrypted according to a fixed length N to obtain multiple data groups, wherein the length of each data group is N, N is a positive integer, and when the length of the data group is insufficient, 0 is used for padding;
[0051] S22, each data group is formed into two-dimensional decimal data to be encrypted, , where A is the two-dimensional decimal data to be encrypted, a1 is the first row of data group, a i is the i-th row data set, a M is the Mth row of data groups, M is the number of horizontal data groups, and i is a positive integer.
[0052] The fixed length N is greater than or equal to 3. In this embodiment, N is 7, that is, 7 values are divided into one group.
[0053] The S3 comprises the following sub-steps:
[0054] S31, exchanging the values of the i-th row data group and the M-i+1-th row data group in the two-dimensional decimal data to be encrypted, 1≤i≤M / 2, i is a positive integer, to obtain the data to be encrypted after horizontal transformation;
[0055] S32. Exchange the values of the j-th column data group and the K-i+1-th column data group in the data to be encrypted after the horizontal transformation, 1≤j≤K / 2, j is a positive integer, K is the number of vertical data groups, to obtain the position-transformed data to be encrypted.
[0056] In the present invention, the j-th column data group is composed of all values in the j-th column of the data to be encrypted after the horizontal transformation.
[0057] The present invention first performs numerical exchanges on the data group of the i-th row and the data group of the M-i+1-th row through S31, that is, exchanges the data group of the i-th row to the M-i+1-th row, and exchanges the data group of the M-i+1-th row to the i-th row, and then performs numerical exchanges on the j-th column data group and the K-i+1-th column data group for the two-dimensional data exchanged by S31 through S32, that is, exchanges the data group of the j-th column to the K-i+1-th column, and exchanges the data group of the K-i+1-th column to the j-th column, thereby realizing disruption of the transmitted information.
[0058] The S4 comprises the following sub-steps:
[0059] S41, taking each value in the data to be encrypted as the center;
[0060] S42, calculating the first data distribution characteristic value at the center according to the difference between the upper and lower values within the neighborhood range of the center, and replacing it with 0 when there is no value at the upper or lower side;
[0061] S43, calculating the second data distribution characteristic value at the center according to the difference between the left and right values within the neighborhood range of the center, and replacing it with 0 when there is no value on the left or right side;
[0062] S44, constructing a first key matrix according to each first data distribution characteristic value;
[0063] S45. Construct a second key matrix according to each second data distribution characteristic value.
[0064] The formula for calculating the first data distribution characteristic value at the center in S42 is:
[0065] , where ξ1 is the first data distribution characteristic value, e is a natural constant, x up is the upper value within the neighborhood of the center, x down is the lower value in the neighborhood at the center, and || is the absolute value.
[0066] The formula for calculating the second data distribution characteristic value at the center in S43 is:
[0067] , where ξ2 is the second data distribution characteristic value, e is a natural constant, and x right is the value on the right side of the neighborhood at the center, x left is the left value in the neighborhood range at the center, and | | is the absolute value.
[0068] The present invention takes each value in the position-transformed data to be encrypted as the center, first calculates the first data distribution characteristic value at the center based on the difference between the upper and lower values in the neighborhood range of the center, and then calculates the second data distribution characteristic value at the center based on the difference between the left and right values. The first data distribution characteristic value and the second data distribution characteristic value are closely related to the arrangement of the position-transformed data to be encrypted. Therefore, in the case where the construction process of the two-dimensional data of the present invention is unknown, the first key matrix and the second key matrix are difficult to crack.
[0069] In this embodiment, the first data distribution characteristic value at each center replaces the value at the center to form a first key matrix, and the second data distribution characteristic value at each center replaces the value at the center to form a second key matrix.
[0070] In the present invention, the neighborhood range refers to the range in contact with the center.
[0071] The S5 comprises the following sub-steps:
[0072] S51, using a first key matrix to encrypt the position-changed data to be encrypted, to obtain a first encryption matrix;
[0073] S52, using a second key matrix to encrypt the position-changed data to be encrypted, to obtain a second encryption matrix;
[0074] S53: Subtract the first encryption matrix from the second encryption matrix to obtain encrypted data.
[0075] The encryption formula in S51 is: , where S1 is the first encryption matrix, X1 is the first key matrix, G is the position-transformed data to be encrypted, For Hadamard;
[0076] The encryption formula in S52 is: , where S2 is the second encryption matrix and X2 is the second key matrix;
[0077] The subtraction formula in S53 is: , where Y is the encrypted data.
[0078] The present invention performs Hadamard product operation on the first key matrix and the position-transformed data to be encrypted to obtain a first encryption matrix, performs Hadamard product operation on the second key matrix and the position-transformed data to be encrypted to obtain a second encryption matrix, and then subtracts the first encryption matrix from the first encryption matrix to obtain encrypted data, so that the encryption process of the encrypted data integrates the numerical distribution of the upper, lower, left and right sides, thereby improving the encryption accuracy.
[0079] The present invention first converts binary data to be encrypted into decimal data to be encrypted, and the encryption process is performed in decimal to increase the security of encryption. Then, the one-dimensional decimal data to be encrypted is converted into two-dimensional decimal data to be encrypted. The two-dimensional decimal data to be encrypted is horizontally and vertically transformed to achieve changes in numerical positions. Then, according to data distribution characteristic values of the position-transformed data to be encrypted, a first key matrix and a second key matrix are generated. The position-transformed data to be encrypted are encrypted using the first key matrix and the second key matrix to obtain encrypted data, and the encrypted data is converted into binary for transmission. The present invention first transforms the position of the two-dimensional data to be encrypted to readjust the numerical distribution. On this basis, the data distribution characteristic values are obtained, and a key matrix is constructed for encryption processing, so that the encryption process depends on the distribution of the numerical values, thereby increasing the security of encryption.
[0080] In the case that the encrypted data is stolen, the thief not only needs to construct a key matrix to crack the position-transformed data to be encrypted, but also needs to perform an inverse position transformation to restore the position of each value in order to accurately obtain the transmitted information. However, constructing the key matrix depends on the distribution of neighborhood values of each value in the position-transformed data to be encrypted. Therefore, the thief cannot crack the data without knowing the original data to be encrypted and the encryption process. The method of the present invention has high security.
[0081] 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 data communication encryption method for an Internet of Vehicles, characterized in that: The following steps are involved: S1. Convert the binary data to be encrypted in the Internet of Vehicles into decimal data to be encrypted; S2, converting the one-dimensional decimal data to be encrypted into two-dimensional decimal data to be encrypted; S3, performing horizontal and vertical position transformation on the two-dimensional decimal data to be encrypted to obtain position-transformed data to be encrypted; S4, generating a first key matrix and a second key matrix according to the data distribution characteristic value of the position-transformed data to be encrypted, wherein the data distribution characteristic value is to calculate the value difference in the vertical and horizontal directions within the neighborhood of each value center point with each value in the position-transformed data to be encrypted as the center; S5, using the first key matrix and the second key matrix to encrypt the position-changed data to be encrypted to obtain encrypted data; S6. Convert the encrypted data into binary to obtain the encrypted data to be transmitted; The S3 comprises the following sub-steps: S31, exchanging the values of the i-th row data group and the M-i+1-th row data group in the two-dimensional decimal data to be encrypted, 1≤i≤M / 2, i is a positive integer, to obtain the data to be encrypted after horizontal transformation; S32, exchanging the values of the j-th column data group and the K-i+1-th column data group in the data to be encrypted after the horizontal transformation, 1≤j≤K / 2, j is a positive integer, K is the number of the vertical data groups, to obtain the position-transformed data to be encrypted; The S4 comprises the following sub-steps: S41, taking each value in the data to be encrypted as the center; S42, calculating the first data distribution characteristic value at the center according to the difference between the upper and lower values within the neighborhood range of the center, and replacing it with 0 when there is no value at the upper or lower side; S43, calculating the second data distribution characteristic value at the center according to the difference between the left and right values within the neighborhood range of the center, and replacing it with 0 when there is no value on the left or right side; S44, constructing a first key matrix according to each first data distribution characteristic value; S45. Construct a second key matrix according to each second data distribution characteristic value.
2. The data communication encryption method of the Internet of Vehicles according to claim 1, characterized in that: The S1 specifically includes: converting the binary data to be encrypted in the Internet of Vehicles into a decimal value in units of one byte.
3. The data communication encryption method of the Internet of Vehicles according to claim 1, characterized in that: The S2 comprises the following sub-steps: S21, segmenting the one-dimensional decimal data to be encrypted according to a fixed length N to obtain multiple data groups, wherein the length of each data group is N, N is a positive integer, and when the length of the data group is insufficient, 0 is used for padding; S22, each data group is formed into two-dimensional decimal data to be encrypted, , where A is the two-dimensional decimal data to be encrypted, a1 is the first row of data group, a i is the i-th row data set, a M is the Mth row of data groups, M is the number of horizontal data groups, and i is a positive integer.
4. The data communication encryption method of the Internet of Vehicles according to claim 1, characterized in that: The formula for calculating the first data distribution characteristic value at the center in S42 is: , where ξ1 is the first data distribution characteristic value, e is a natural constant, x up is the upper value within the neighborhood of the center, x down is the lower value in the neighborhood at the center, and || is the absolute value.
5. The data communication encryption method of the Internet of Vehicles according to claim 1, characterized in that: The formula for calculating the second data distribution characteristic value at the center in S43 is: , where ξ2 is the second data distribution characteristic value, e is a natural constant, and x right is the value on the right side of the neighborhood at the center, x left is the left value in the neighborhood range at the center, and | | is the absolute value.
6. The data communication encryption method of the Internet of Vehicles according to claim 1, characterized in that: The S5 comprises the following sub-steps: S51, using a first key matrix to encrypt the position-changed data to be encrypted, to obtain a first encryption matrix; S52, using a second key matrix to encrypt the position-changed data to be encrypted, to obtain a second encryption matrix; S53: Subtract the first encryption matrix from the second encryption matrix to obtain encrypted data.
7. The data communication encryption method of the Internet of Vehicles according to claim 6, characterized in that: The encryption formula in S51 is: , where S1 is the first encryption matrix, X1 is the first key matrix, G is the position-transformed data to be encrypted, For Hadamard; The encryption formula in S52 is: , where S2 is the second encryption matrix and X2 is the second key matrix; The subtraction formula in S53 is: , where Y is the encrypted data.
