Disclosure of Invention
The embodiment of the application provides a data transmission processing method and system based on Glink bus protocol, which are used for solving the problem of poor data transmission security in the prior art.
In a first aspect, an embodiment of the present application provides a data transmission processing method based on Glink bus protocol, which is applied to a transmitting end, and includes:
determining a plurality of data messages to be sent under Glink bus protocol;
For each data message, acquiring a plurality of first masks which are randomly generated and a plurality of second masks which are generated through preset fixed rules;
Masking each of the data messages by the plurality of first masks and the plurality of second masks to generate a masked message;
And encrypting the masked message to obtain an encrypted message, and sending the encrypted message to a receiving end so that the receiving end can decrypt the encrypted message to obtain the masked message, and decoding the masked message through the plurality of first masks and the plurality of second masks to obtain a plurality of data messages.
Optionally, the generating a plurality of second masks through a preset fixed rule includes:
randomly generating a first key and a second key, and initializing an confusion matrix;
Splitting each data message into a plurality of message blocks, and encrypting the message blocks by using the first key aiming at each message block to obtain a first encryption result;
Encrypting the first encryption result by using the second key to obtain a second encryption result;
applying a hash function to the second encryption result to obtain a hash value corresponding to each message block;
And performing exclusive OR operation on the hash values corresponding to the acquired message blocks and the confusion matrix to obtain a plurality of second masks.
Optionally, said masking each of said data messages by said plurality of first masks and said plurality of second masks to generate a masked message, including:
splitting each data message into a plurality of message blocks;
determining the generation time and the sending time of each data message;
Calculating a masking parameter of each data message corresponding to each message block by performing exclusive OR operation on the plurality of first masks, the generation time and the sending time of each data message according to a preset calculation mode, wherein the masking parameter is used for masking the data message;
according to the dividing sequence of the message blocks of each data message, respectively carrying out an alternative exclusive-or operation on the masking parameter of each data message corresponding to each message block, carrying out an exclusive-or operation on alternative exclusive-or operation results of a plurality of data messages, and calculating a first intermediate masking message;
Performing a cyclic left shift operation on the first intermediate masking message by a first preset bit number, performing a cyclic left shift operation on the plurality of second masks by a first preset bit number, and performing an exclusive or operation on a left shift result of the first intermediate masking message and a left shift result of the plurality of second masks to obtain a second intermediate masking message;
Performing cyclic left shift operation on the plurality of first masks by a second preset bit number, and performing exclusive OR operation on the left shift results of the plurality of first masks and the second intermediate masking message to obtain a third intermediate masking message;
And performing cyclic left shift operation on the plurality of second masks by a first preset bit number, and performing exclusive or transportation on the left shift results of the plurality of second masks and the third intermediate masking message to obtain the masking message.
Optionally, the plurality of data messages comprises m1, m2, & mn;
Each of the data messages mi is split into k message blocks, a plurality of message blocks including mi1, mi2,.. mik, where i=1, 2,..n;
the plurality of first masks includes p1, p2, pn;
the plurality of second masks includes S1, S2,;
The generation time of each data message comprises mi_t1, and the transmission time comprises mi_t2;
The calculating the masking parameter of each data message corresponding to each message block by performing exclusive-or operation on the plurality of first masks, the generation time and the sending time of each data message according to a preset calculation mode includes:
For each message block of each of the data messages, the data message is stored by the formula: mij= (mij = (mij + pi + mi_t1+ mi_t2) mod 2), and calculating masking parameters of each data message corresponding to each message block by performing exclusive-or operation on the plurality of first masks, the generation time and the transmission time of each data message according to a preset calculation mode;
where i=1, 2,..n, j=1, 2,..k.
Optionally, according to the dividing sequence of the message blocks of each data message, performing an alternate exclusive-or operation on the masking parameter of each data message corresponding to each message block, and performing an exclusive-or operation on the results of the alternate exclusive-or operation on a plurality of data messages, to calculate a first intermediate masking message, including:
By the formula: result1=m11.m21 @ m21 @ m12 @ mn 1@ m22 @ mn 2@ m1k @ m2k @ mnk, performing an alternate exclusive-or operation on the masking parameters of each data message corresponding to each message block according to the division order of the message blocks of each data message, and performing an exclusive-or operation on the results of the alternate exclusive-or operation on the plurality of data messages to calculate a first intermediate masking message.
Wherein result1 is denoted as a first intermediate masked message, m11, m21, mn1 represents a plurality of data messages m1, m2, mn, a first message block of mn, m12, m22, mn2 represents a plurality of data messages m1, m2, mn, a second message block of mn, m1k, m2k, mnk represents a plurality of data messages m1, m2, mn.
Optionally, the operation of circularly shifting the first intermediate masking message by a first preset number of bits left, the operation of circularly shifting the plurality of second masks by a first preset number of bits left, and the exclusive-or operation of the left shift result of the first intermediate masking message and the left shift result of the plurality of second masks, to obtain a second intermediate masking message, include:
By the formula: result 2= ((result 1< < w) ((S2 < < w) >) No.,) mod2n, with the first intermediate masking message being left-shifted by a first preset number of bits, the plurality of second masks being circularly left-shifted by a first preset number of bits, and the left-shifted result of the first intermediate masking message and the left-shifted result of the plurality of second masks being exclusive-ored to obtain a second intermediate masking message;
Wherein result2 is represented as a second intermediate masking message, and w is represented as a left shift by a first preset number of bits;
Performing cyclic left shift operation on the plurality of first masks by a second preset bit number, and performing exclusive or operation on the left shift results of the plurality of first masks and the second intermediate masking message to obtain a third intermediate masking message;
By the formula: the result 3=result 2 # (p 1< < (w+1)) # (p 2< < (w+1)) # (pn < (w+1)), performing cyclic left shift operation on the plurality of first masks by a first preset number of bits, and performing exclusive or operation on left shift results of the plurality of first masks and the second intermediate masking message to obtain a third intermediate masking message;
Wherein result3 is represented as a third intermediate mask message, (w+1) is represented as a left shift by a second preset number of bits;
The operation of circularly shifting the plurality of second masks left by a first preset bit number, and performing exclusive or transportation on the left shift results of the plurality of second masks and the third intermediate masking message to obtain a masking message, including:
By the formula: final _ result=result 3 _ (s1 < < w) ((S2 < < w) > a @ is a @ and @ is a (Sn < < w)), the plurality of second masks are subjected to a cyclic left-shift operation by a first preset number of bits, exclusive or transportation is carried out on the left shift results of the plurality of second masks and the third intermediate masking message, so that a masking message is obtained;
Wherein final_result is denoted as mask message, and w is denoted as left-shifted by a first preset number of bits.
Optionally, the plurality of first masks includes at least: a random binary number or a random string.
In a second aspect, an embodiment of the present application provides a data transmission processing system based on Glink bus protocol, including:
a determining module, configured to determine a plurality of data messages to be sent under Glink bus protocol;
An acquisition module, configured to acquire, for each of the data messages, a plurality of first masks generated randomly and a plurality of second masks generated by a preset fixed rule;
A generating module, configured to mask each of the data messages by using the plurality of first masks and the plurality of second masks, so as to generate a masked message;
And the sending module is used for encrypting the masked message to obtain an encrypted message, sending the encrypted message to the receiving end, enabling the receiving end to decrypt the encrypted message to obtain the masked message, and decoding the masked message through the plurality of first masks and the plurality of second masks to obtain a plurality of data messages.
In a third aspect, embodiments of the present application provide a computing device, comprising a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are configured to be invoked and executed by the processing component to implement the Glink bus protocol-based data transfer processing method according to the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer storage medium storing a computer program, where the computer program when executed by a computer implements a data transmission processing method based on Glink bus protocol as described in the first aspect
In the embodiment of the application, a plurality of data messages to be sent under Glink bus protocol are determined; for each data message, acquiring a plurality of first masks which are randomly generated and a plurality of second masks which are generated through preset fixed rules; masking each of the data messages by the plurality of first masks and the plurality of second masks to generate a masked message; and encrypting the masked message to obtain an encrypted message, and sending the encrypted message to a receiving end so that the receiving end can decrypt the encrypted message to obtain the masked message, and decoding the masked message through the plurality of first masks and the plurality of second masks to obtain a plurality of data messages.
The Glink bus protocol-based data transmission processing method has the beneficial effects that:
And (3) improving data security: by masking and encrypting each data message, the security of the data in the transmission process can be effectively protected. The generation rules of the first mask and the second mask are preset, so that the mask message has confusion, and the risk of unauthorized access or tampering of data is reduced.
Data privacy enhancement: the first mask generated randomly and the second mask generated through the fixed rule can be used for carrying out confusion processing on the data, so that the privacy of the data is improved. The original data information can be obtained only after decryption and decoding by the receiving end, so that the privacy of the data is effectively protected.
Data transmission reliability is improved: through the transmission of the encrypted message, the possibility that the data is interfered or destroyed in the transmission process can be effectively reduced, and the reliability of the data transmission is improved.
Data transmission efficiency optimization: through processing steps such as covering, encrypting and decoding, redundant information in the data transmission process can be effectively reduced, and the efficiency and speed of data transmission are improved.
In general, the method combines Glink bus protocol and masking and encrypting technologies, improves the safety, privacy, reliability and efficiency of data transmission, and is suitable for scenes with higher requirements on the safety of data transmission.
These and other aspects of the application will be more readily apparent from the following description of the embodiments.
Detailed Description
In order to enable those skilled in the art to better understand the present application, the following description will make clear and complete descriptions of the technical solutions according to the embodiments of the present application with reference to the accompanying drawings.
In some of the flows described in the specification and claims of the present application and in the foregoing figures, a plurality of operations occurring in a particular order are included, but it should be understood that the operations may be performed out of order or performed in parallel, with the order of operations such as 101, 102, etc., being merely used to distinguish between the various operations, the order of the operations themselves not representing any order of execution. In addition, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first" and "second" herein are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, and are not limited to the "first" and the "second" being different types.
The Glink bus protocol-based data transmission processing method provided by the embodiment of the application is applicable to the following applicable scenes:
Confidential data transmission: when confidential data transmission such as personal identification information, financial data and the like is involved, the security and privacy of the data can be effectively protected by adopting the method, and the data is prevented from being revealed and unauthorized access is prevented.
Data transmission between communication devices: when data transmission is carried out between communication devices, the reliability and the safety of the data transmission can be improved by adopting the method, and the data is ensured not to be tampered or lost in the transmission process.
Data transmission of the Internet of things: in the application of the Internet of things, data transmission and communication are needed between devices, and the method can encrypt and protect the transmitted data, prevent the data from being illegally accessed or tampered, and ensure the safety of the Internet of things system.
Financial transaction data transmission: for transaction data transmission in the financial industry, such as online payment, bank transfer and the like, the method can improve the safety and reliability of data transmission and protect financial information of a user from being stolen or tampered.
And (3) transmitting data in enterprises: in the data transmission and communication in enterprises, the method can protect the security of sensitive data and prevent data leakage and confidential information from being leaked to competitors.
In general, the data transmission processing method based on Glink bus protocol is suitable for the scene of needing to protect the data security and privacy, and has wide application prospect especially in the fields and industries with higher requirements on the data transmission security.
The invention researches find that at present, in the process of using Glink bus protocol to transmit data, a symmetric encryption algorithm is generally used to ensure the security of the data. The symmetric encryption algorithm uses the same key to encrypt and decrypt the data, so as to ensure that the data is not accessed or tampered by unauthorized personnel in the transmission process.
While symmetric encryption algorithms can provide a degree of data security, such schemes also present a risk of being hacked. Since the symmetric encryption algorithm uses the same key for encryption and decryption, once the key is compromised, the security of the data is compromised. Therefore, in order to further enhance the security of data transmission, new data transmission processing schemes are required, such as introducing more complex encryption algorithms, using multi-layer encryption techniques, or employing quantum cryptography to secure data.
In view of this, an embodiment of the present application provides a data transmission processing method based on Glink bus protocol, where the method is applied to a transmitting end, and the method includes: determining a plurality of data messages to be sent under Glink bus protocol; for each data message, acquiring a plurality of first masks which are randomly generated and a plurality of second masks which are generated through preset fixed rules; masking each of the data messages by the plurality of first masks and the plurality of second masks to generate a masked message; and encrypting the masked message to obtain an encrypted message, and sending the encrypted message to a receiving end so that the receiving end can decrypt the encrypted message to obtain the masked message, and decoding the masked message through the plurality of first masks and the plurality of second masks to obtain a plurality of data messages.
The method combines Glink bus protocol and masking and encrypting technologies, improves the safety, privacy, reliability and efficiency of data transmission, and is suitable for scenes with higher requirements on the safety of data transmission.
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
Fig. 1 is a flowchart of a data transmission processing method based on Glink bus protocol according to an embodiment of the present application, where the method is applied to a transmitting end as shown in fig. 1;
The method comprises the following steps:
s11, determining a plurality of data messages to be sent under Glink bus protocol;
In this step, a plurality of data messages to be sent under Glink bus protocol are determined: it is first necessary to determine a plurality of data messages, including information such as data content, data format, data size, etc., that need to be transmitted via Glink bus protocols. The data messages may be any information that needs to be transmitted and communicated.
In the embodiment of the present application, it is assumed that there is a system that needs to be transmitted through Glink bus protocols, where three data messages need to be sent: message 1 contains temperature sensor data, message 2 contains humidity sensor data, and message 3 contains illumination sensor data. The three data messages respectively include information of sensor type, sensor value, etc.
The data message is encoded and encapsulated as specified by Glink protocol: each data message is encoded and packaged according to the Glink protocol, including adding masking, encryption and other processes, so as to ensure the security and integrity of the data. Meanwhile, the encapsulation needs to be carried out according to the Glink bus protocol format, including information such as frame header, frame tail, check bit and the like.
The three data messages are encoded and encapsulated according to the Glink protocol, mask and encryption are added, and meanwhile encapsulation is carried out according to the Glink bus protocol format, wherein the information comprises that the frame head is 0xAA, the frame tail is 0xBB, the check bit is CRC check and the like.
Sending the encapsulated data message to Glink bus: the coded, encrypted and encapsulated data message is sent to Glink bus, and transmitted to the receiving end through bus, so as to ensure reliable transmission and reception of data.
And the three data messages processed and packaged by Glink protocol are respectively sent to Glink buses, and are transmitted to a receiving end through the buses, and the receiving end can decode, decrypt and analyze the data messages to obtain the sensor data information.
Through the steps, transmission and communication of a plurality of data messages to be sent under Glink bus protocol can be realized. The method can ensure the safety, the integrity and the reliability of the data and has wide application prospect in practical application.
S12, for each data message, acquiring a plurality of first masks which are randomly generated and a plurality of second masks which are generated through a preset fixed rule;
in this step, a plurality of first masks randomly generated are acquired: for each data message, a plurality of different first masks need to be generated. The first mask may be a randomly generated binary number or a random string for encrypting and confusing the data message, increasing the security and confidentiality of the data.
Generating a plurality of second masks through preset fixed rules: in addition to the randomly generated first mask, a plurality of second masks are also required to be generated according to preset fixed rules, wherein the second masks can be generated according to the fixed rules and used for encrypting and protecting the data message to ensure the integrity and the correctness of the data, and the fixed rules can be set according to requirements.
In the embodiment of the present application, for the aforementioned three data messages, a plurality of first masks and a plurality of second masks are generated, respectively.
Data message 1 (temperature sensor data):
a first mask: randomly generated binary numbers: 11001100;
A second mask: binary numbers generated by preset rules: 10101010;
data message 2 (humidity sensor data):
a first mask: randomly generated character strings: "abc123";
a second mask: character strings generated by preset rules: "xyz456";
data message 3 (light sensor data):
a first mask: randomly generated binary numbers: 10101010;
a second mask: binary numbers generated by preset rules: 11001100;
Through the above embodiment, a plurality of first masks and a plurality of second masks can be generated for each data message, and are used for encrypting and protecting the data, so that the safety and the integrity of the data are ensured. Thus, the security in the data transmission process can be enhanced, and the data is prevented from being accessed or tampered without authorization.
S13, masking each data message through the plurality of first masks and the plurality of second masks to generate a masking message;
in this step, the data message is masked by a plurality of first masks and a plurality of second masks: in this step, the first masks and the second masks generated previously are applied to the corresponding data messages, and the data are masked. This process may include exclusive-or, encryption, or other obfuscation of the data to generate a masked message.
Generating a masking message: and integrating the masked data message with the corresponding first mask and the second mask to generate a final masked message. The masking message contains encrypted, obfuscated data, and masking information for decrypting and restoring the data.
In the embodiment of the application, each data message is subjected to masking processing according to the first mask and the second mask which are generated before, so as to generate a masking message.
Data message 1 (temperature sensor data):
a first mask: 11001100;
a second mask: 10101010;
Temperature sensor data: 25 ℃;
masking treatment: and performing exclusive OR operation on the temperature sensor data and the first mask, and then performing encryption processing on the temperature sensor data and the second mask to generate a masked message.
Data message 2 (humidity sensor data):
a first mask: abc123;
a second mask: xyz456;
humidity sensor data: 50%;
Masking treatment: and encrypting the humidity sensor data with the first mask, and performing exclusive OR operation with the second mask to generate a masked message.
Data message 3 (light sensor data):
a first mask: 10101010;
a second mask: 11001100;
Illumination sensor data: 800lux;
masking treatment: and performing exclusive OR operation and encryption processing on the illumination sensor data and the first mask, and performing confusion processing on the illumination sensor data and the second mask to generate a masked message.
By the above embodiment, masking processing is performed by applying a plurality of first masks and a plurality of second masks to each data message, and a masked message is generated. Therefore, the security and confidentiality of the data can be enhanced, and the data is ensured not to be stolen or tampered in the transmission process.
S14, encrypting the masked message to obtain an encrypted message, and sending the encrypted message to a receiving end.
In this step, the mask message that has been generated is subjected to encryption processing to generate an encrypted message, and the encrypted message is transmitted to the receiving end. The receiving end can decrypt the received encrypted message to obtain an original covering message, then decode the covering message according to the first masks and the second masks, and finally obtain the original information of the data messages.
Encrypting the masked message: the generated masked message is encrypted using an encryption algorithm to generate an encrypted message. The encryption can adopt a symmetrical encryption algorithm or an asymmetrical encryption algorithm, so that the security of the data in the transmission process is ensured.
Sending the encrypted message to the receiving end: and sending the encrypted message to the receiving end so that the receiving end receives and decrypts the encrypted message.
The receiving end decrypts the encrypted message: after receiving the encrypted message, the receiving end uses a corresponding decryption algorithm to decrypt the encrypted message to obtain the original masked message.
Decoding the masked message: and decoding the decrypted masked message according to the first masks and the second masks to restore the original information of the data messages.
In the embodiment of the present application, it is assumed that a mask message has been generated and is the following example data:
masking message 1: the encrypted_message_1;
Masking message 2: the encrypted_message_2;
Masking message 3: the encrypted_message_3;
encrypting the masked message:
Encrypting masked message 1, generating encrypted message 1: the encrypted_message_1_encrypted;
Encrypting masked message 2, generating encrypted message 2: the encrypted_message_2_encrypted;
encrypting the masked message 3, generating an encrypted message 3: the encrypted_message_3_encrypted;
And sending the encrypted message to the receiving end.
The receiving end decrypts the encrypted message:
The receiving end receives the encrypted message 1, the encrypted message 2 and the encrypted message 3 and respectively carries out decryption operation.
Decoding the masked message:
and decoding the decrypted masked message according to the first masks and the second masks to obtain the original information of the data messages.
Through the embodiment, the process of encrypting the masked message and then sending the encrypted masked message to the receiving end, decrypting the encrypted masked message by the receiving end and then decoding the decrypted encrypted masked message to obtain the original data message can be realized, and the safety and the integrity of data transmission are ensured.
Optionally, in the embodiment of the present application, the process of acquiring "the plurality of second masks generated by the preset fixed rule" in S12 may include:
s121, randomly generating a first key and a second key, and initializing an confusion matrix;
in this step, for example, two keys are randomly generated: a first key K1 and a second key K2, and initializes the confusion matrix M.
S122, splitting each data message into a plurality of message blocks, and encrypting the message blocks by using the first key aiming at each message block to obtain a first encryption result;
In this step, the plurality of data messages includes m1, m2, & mn; each of the data messages mi is split into k message blocks, a plurality of message blocks including mi1, mi2,.. mik, where i=1, 2,..n;
For example, for each message block m11, m12, m1K of the data message m1, the message blocks m11, m12, m1K are each symmetrically encrypted (e.g. advanced encryption standard algorithm (Advanced Encryption Standard, AES)) using the first key K1, resulting in a first encryption result.
S123, encrypting the first encryption result by using the second key to obtain a second encryption result;
in this step, the first encryption result is encrypted using a second key K2 by an asymmetric encryption algorithm, such as a public key cryptosystem algorithm (RIVEST SHAMIR ADLEMAN, RSA), to obtain a second encryption result.
S124, applying a hash function to the second encryption result to obtain a hash value corresponding to each message block;
In this step, a hash function (e.g., SHA-256) is applied to the second encryption result corresponding to each message block to obtain hash values H1 to Hn, respectively.
Wherein the hash function (e.g., SHA-256) is an algorithm that converts input data of arbitrary length into a fixed-length hash value. By applying a hash function to the second encryption result for each message block separately, a corresponding hash value can be generated, which helps to ensure the integrity and security of the message. The hash value may be used to verify whether the message was tampered with and to check for errors or data corruption during data transmission.
S125, performing exclusive OR operation on the hash values corresponding to the acquired message blocks and the confusion matrix to obtain a plurality of second masks.
In this step, H1 to Hn are exclusive-ored with the confusion matrix M, respectively, to obtain a plurality of second masks S1 to Sn, that is, s1=h1 #, s2=h2 #, and sn=hn.
Optionally, in the embodiment of the present application, the process of "masking each data message by the plurality of first masks and the plurality of second masks to generate a masked message" in S13 specifically includes the following steps, as shown in fig. 2:
S131, splitting each data message into a plurality of message blocks;
In this step, the plurality of data messages includes m1, m2, & mn; each of the data messages mi is split into k message blocks, a plurality of message blocks including mi1, mi2,.. mik, where i=1, 2,..n;
Wherein the plurality of first masks includes p1, p2, pn; the plurality of second masks includes S1, S2,;
S132, determining the generation time and the sending time of each data message;
in this step, the generation time of each of the data messages includes mi_t1, and the transmission time includes mi_t2;
S133, calculating a masking parameter of each data message corresponding to each message block by performing exclusive OR operation on the plurality of first masks, the generation time and the sending time of each data message according to a preset calculation mode, wherein the masking parameter is used for masking the data message;
Specifically, for each message block of each of the data messages, the following formula is used: mij= (mij = (mij + pi + mi_t1+ mi_t2) mod 2), and calculating masking parameters of each data message corresponding to each message block by performing exclusive-or operation on the plurality of first masks, the generation time and the transmission time of each data message according to a preset calculation mode;
where i=1, 2,..n, j=1, 2,..k.
For example: assuming that there are two data messages m1 and m2, each data message is split into 3 message blocks, i.e. k=3. Meanwhile, each data message has a corresponding first mask p1 and p2, and the generation time and the transmission time are m1_t1, m1_t2, m2_t1, and m2_t2, respectively.
Now we do exclusive or operation according to the preset calculation mode, and calculate the masking parameter of each data message corresponding to each message block. Assuming that the preset calculation mode is an exclusive or operation:
for the first message block m11 of the data message m1:
m11=(m11⊕p1)+((m11+p1+m1_t1+m1_t2)mod2);
for the second message block m12 of the data message m1:
m12=(m12⊕p1)+((m12+p1+m1_t1+m1_t2)mod2);
for the third message block m13 of the data message m1:
m13=(m13⊕p1)+((m13+p1+m1_t1+m1_t2)mod2);
for the first message block m21 of the data message m2:
m21=(m21⊕p2)+((m21+p2+m2_t1+m2_t2)mod2);
for the second message block m22 of the data message m2:
m22=(m22⊕p2)+((m22+p2+m2_t1+m2_t2)mod2);
for the third message block m23 of data message m2:
m23=(m23⊕p2)+((m23+p2+m2_t1+m2_t2)mod2);
Through the calculation, the masking parameter of each data message corresponding to each message block can be obtained and used for masking the data message so as to enhance the safety and the integrity of the data.
S134, according to the dividing sequence of the message blocks of each data message, respectively performing an alternative exclusive OR operation on the masking parameter of each data message corresponding to each message block, and performing an exclusive OR operation on the alternative exclusive OR operation results of a plurality of data messages to calculate a first intermediate masking message;
Specifically, by the formula: result1=m11.m21 @ m21 @ m12 @ mn 1@ m22 @ mn 2@ m1k @ m2k @ mnk, performing an alternate exclusive-or operation on the masking parameters of each data message corresponding to each message block according to the division order of the message blocks of each data message, and performing an exclusive-or operation on the results of the alternate exclusive-or operation on the plurality of data messages to calculate a first intermediate masking message.
Wherein result1 is denoted as a first intermediate masked message, m11, m21, mn1 represents a plurality of data messages m1, m2, mn, a first message block of mn, m12, m22, mn2 represents a plurality of data messages m1, m2, mn, a second message block of mn, m1k, m2k, mnk represents a plurality of data messages m1, m2, mn.
For example: assuming that there are two data messages m1 and m2, each data message is split into 3 message blocks, i.e. k=3. We have now calculated the masking parameters for each data message for each message block, i.e. m11, m12, m13, m21, m22, m23.
According to the dividing sequence of the message blocks of each data message, performing an alternate exclusive OR operation, and performing an exclusive OR operation on the alternate exclusive OR operation results of a plurality of data messages to calculate a first intermediate masking message result1: result1 = m11, m21 @ m12 @ m22 @ m13 @ m23;
the following masking parameter values are assumed to be known:
m11=1011;
m21=1100;
m12=0101;
m22=1110;
m13=0010;
m23=1001;
and performing an alternating exclusive OR operation:
result1=1011⊕1100⊕0101⊕1110⊕0010⊕1001
result1=0110⊕1011⊕1110⊕1001
result1=0011⊕0110⊕1001
result1=1101⊕1001
result1=0100
Therefore, according to the above embodiment, the calculation result of the first intermediate mask message result1 is 0100. This result will be used for subsequent data message masking operations.
S135, performing a cyclic left shift operation on the first intermediate masking message by a first preset bit number, performing a cyclic left shift operation on the plurality of second masks by the first preset bit number, and performing an exclusive OR operation on a left shift result of the first intermediate masking message and a left shift result of the plurality of second masks to obtain a second intermediate masking message;
Specifically, by the formula: result 2= ((result 1< < w) ((S2 < < w) >) No.,) mod2n, with the first intermediate masking message being left-shifted by a first preset number of bits, the plurality of second masks being circularly left-shifted by a first preset number of bits, and the left-shifted result of the first intermediate masking message and the left-shifted result of the plurality of second masks being exclusive-ored to obtain a second intermediate masking message;
Wherein result2 is represented as a second intermediate masking message, and w is represented as a left shift by a first preset number of bits;
for example: let the first intermediate mask message result1 be 0100 and the preset left shift number w be 1. Meanwhile, there are three second masks S1, S2, S3, and a left shift operation is required.
First, the first intermediate masking message result1 is circularly shifted left by a first preset number of bits:
result1 shift left by 1 bit = 1000;
next, each second mask is circularly shifted left by a first preset number of bits:
S1 shift left by 1 bit=1101;
s2 shift left by 1 bit=0011;
S3 shift left by 1 bit=1010;
finally, exclusive OR operation is carried out on the left shift result of the first intermediate masking message and the left shift results of the plurality of second masks, so as to obtain a second intermediate masking message result2:
result 2= ((result 1 left shift by 1 bit) ((S2 left shift by 1 bit) ((S3 left shift by 1 bit)) mod 2-3)
result2=(1000⊕1101⊕0011⊕1010)mod8
result2=1100mod8
result2=4
Thus, according to the above embodiment, the calculation result of the second intermediate mask message result2 is 4. This result will be used for subsequent data message masking operations.
S136, performing cyclic left shift operation on the plurality of first masks by a second preset bit number, and performing exclusive OR operation on left shift results of the plurality of first masks and the second intermediate masking message to obtain a third intermediate masking message;
Specifically, by the formula: the result 3=result 2 # (p 1< < (w+1)) # (p 2< < (w+1)) # (pn < (w+1)), performing cyclic left shift operation on the plurality of first masks by a first preset number of bits, and performing exclusive or operation on left shift results of the plurality of first masks and the second intermediate masking message to obtain a third intermediate masking message;
Wherein result3 is represented as a third intermediate mask message, (w+1) is represented as a left shift by a second preset number of bits;
for example: assuming that the second intermediate mask message result2 is 4, the preset left shift number w is 1. Meanwhile, there are three first mask parameters p1, p2, p3, which require a left shift operation, and the second preset number of bits is 1.
First, performing a cyclic left shift operation on each first masking parameter by a second preset number of bits:
p1 left shift by 2 bits = 1010;
p2 left shift by 2 bits = 0110;
p3 shift left by 2 bits = 1101;
then, exclusive OR operation is carried out on the left shift result of each first masking parameter and the second intermediate masking message result2, so as to obtain a third intermediate masking message result3:
result 3= (result 2) x (p 1 left shift 2 bits) (p 2 left shift 2 bits) (p 3 left shift 2 bits)
result3=4⊕1010⊕0110⊕1101
result3=0000⊕1010⊕0110⊕1101
result3=0001⊕0110⊕1101
result3=1110⊕1101
result3=0011
Thus, according to the above embodiment, the calculation result of the third intermediate mask message result3 is 0011. This result will be used for subsequent data message masking operations.
It should be noted that in the Glink protocol, the shift w+1 bit and the shift w bit have respective roles and differences, and are not merely set according to the requirements.
The main purpose of shifting the w+1 bits is to increase the confusion and security of the data. The data is circularly shifted left by k+1 bits and then is exclusive-or operated with the mask, so that the data and the mask are more confused, and the confidentiality of the data is improved. Meanwhile, as the mask is shifted one bit more left than the data, more complex operation results can be generated, and the difficulty of an attacker in cracking the data is increased.
Moving w bits relatively reduces the confusion and security of the data. Although the bit order of the data may still be changed, the result of exclusive-or operation with the mask may be relatively easy to restore or analyze. Thus, to enhance the security and confidentiality of data, the Glink protocol selects the operation of shifting w+1 bits.
Therefore, the selection of the shift w+1 bits (+2, +n, etc. may be added according to the requirement in practical application), and the shift w bits are not only set according to the requirement, but also in consideration of increasing the confusion and confidentiality of the data, so as to improve the security of the data. By such operation, the data can be more difficult to crack or analyze, thereby effectively protecting the privacy and safety of the data.
S137, performing cyclic left shift operation on the plurality of second masks by a first preset bit number, and performing exclusive or transportation on the left shift results of the plurality of second masks and the third intermediate masking message to obtain the masking message.
Specifically, by the formula: final _ result=result 3 _ (s1 < < w) ((S2 < < w) > a @ is a @ and @ is a (Sn < < w)), the plurality of second masks are subjected to a cyclic left-shift operation by a first preset number of bits, exclusive or transportation is carried out on the left shift results of the plurality of second masks and the third intermediate masking message, so that a masking message is obtained;
Wherein final_result is denoted as mask message, and w is denoted as left-shifted by a first preset number of bits.
For example: let the third intermediate mask message result3 be 0011 and the preset left shift number w be 2. Meanwhile, there are three second masks S1, S2, S3, a left shift operation is required, and the first preset number of bits is 2.
First, each second mask is circularly left-shifted by a first preset number of bits:
S1 shift left by 2 bits=1011;
s2 shift left by 2 bits = 0110;
s3 shift left by 2 bits = 1100;
then, exclusive OR operation is carried out on the left shift result of each second mask and the third intermediate masking message result3, so as to obtain a final masking message final_result:
final_result= (result 3) ((S1 left-shifted by 2 bits)/(S2 left-shifted by 2 bits)/(S3 left-shifted by 2 bits)) and (S1 left-shifted by 2 bits)
final_result=0011⊕1011⊕0110⊕1100
final_result=1000⊕0110⊕1100
final_result=1110⊕1100
final_result=0010
Thus, according to the above embodiment, the calculation result of the final mask message final_result is 0010. This result indicates that the masked message calculation step in the Glink protocol is complete.
Based on the above S131 to S137, an effect of data encryption and confusion can be achieved. By performing multiple masking, left shifting, and exclusive-or operations on the data, the security and hackability of the data can be increased.
The specific effects include:
Data confusion: the original data can be converted into the mixed data subjected to multiple encryption processing through multiple masking and exclusive-or operations, so that the complexity and the unintelligible property of the data are increased.
Data encryption: the data are encrypted through the left shift and exclusive OR operation, so that an unauthorized user cannot easily read the original data content, and the confidentiality of the data is improved.
Data protection: through steps S133-S137 in Glink protocol, data can be encrypted and covered in multiple layers, so that the safety of the data is improved, and the risk of data theft or tampering is reduced.
In general, based on the implementation of the steps, the efficient encryption, confusion and protection of the data can be realized, and the security and privacy protection in the data transmission process are enhanced
Fig. 3 is a schematic structural diagram of a data transmission processing system based on Glink bus protocol according to an embodiment of the present application, where, as shown in fig. 3, the system includes:
A determining module 31, configured to determine a plurality of data messages to be sent under Glink bus protocol;
An acquisition module 32, configured to acquire, for each of the data messages, a plurality of first masks generated randomly and a plurality of second masks generated by a preset fixed rule;
A generating module 33, configured to mask each of the data messages by using the first masks and the second masks, so as to generate a masked message;
and the sending module 34 is configured to encrypt the masked message to obtain an encrypted message, send the encrypted message to the receiving end, so that the receiving end decrypts the encrypted message to obtain the masked message, and decode the masked message through the plurality of first masks and the plurality of second masks to obtain a plurality of data messages.
Optionally, in the embodiment of the present application, the obtaining module 32 is specifically configured to split each data message into a plurality of message blocks, and encrypt, for each message block, the message block with the first key to obtain a first encryption result; encrypting the first encryption result by using the second key to obtain a second encryption result; applying a hash function to the second encryption result to obtain a hash value corresponding to each message block; and performing exclusive OR operation on the hash values corresponding to the acquired message blocks and the confusion matrix to obtain a plurality of second masks.
Optionally, in the embodiment of the present application, the generating module 33 is specifically configured to split each of the data messages into a plurality of message blocks; determining the generation time and the sending time of each data message; calculating a masking parameter of each data message corresponding to each message block by performing exclusive OR operation on the plurality of first masks, the generation time and the sending time of each data message according to a preset calculation mode, wherein the masking parameter is used for masking the data message; according to the dividing sequence of the message blocks of each data message, respectively carrying out an alternative exclusive-or operation on the masking parameter of each data message corresponding to each message block, carrying out an exclusive-or operation on alternative exclusive-or operation results of a plurality of data messages, and calculating a first intermediate masking message; performing a cyclic left shift operation on the first intermediate masking message by a first preset bit number, performing a cyclic left shift operation on the plurality of second masks by a first preset bit number, and performing an exclusive or operation on a left shift result of the first intermediate masking message and a left shift result of the plurality of second masks to obtain a second intermediate masking message; performing cyclic left shift operation on the plurality of first masks by a second preset bit number, and performing exclusive OR operation on the left shift results of the plurality of first masks and the second intermediate masking message to obtain a third intermediate masking message; and performing cyclic left shift operation on the plurality of second masks by a first preset bit number, and performing exclusive or transportation on the left shift results of the plurality of second masks and the third intermediate masking message to obtain the masking message.
Optionally, in an embodiment of the present application, the plurality of data messages includes m1, m2, & mn;
Each of the data messages mi is split into k message blocks, a plurality of message blocks including mi1, mi2,.. mik, where i=1, 2,..n;
the plurality of first masks includes p1, p2, pn;
the plurality of second masks includes S1, S2,;
The generation time of each data message comprises mi_t1, and the transmission time comprises mi_t2;
The generating module 33 is specifically configured to, for each message block of each data message, apply the following formula: mij= (mij = (mij + pi + mi_t1+ mi_t2) mod 2), and calculating masking parameters of each data message corresponding to each message block by performing exclusive-or operation on the plurality of first masks, the generation time and the transmission time of each data message according to a preset calculation mode;
where i=1, 2,..n, j=1, 2,..k.
Optionally, in an embodiment of the present application, the generating module 33 is specifically configured to use the formula: result1=m11.m21 @ m21 @ m12 @ mn 1@ m22 @ mn 2@ m1k @ m2k @ mnk, performing an alternate exclusive-or operation on the masking parameters of each data message corresponding to each message block according to the division order of the message blocks of each data message, and performing an exclusive-or operation on the results of the alternate exclusive-or operation on the plurality of data messages to calculate a first intermediate masking message.
Wherein result1 is denoted as a first intermediate masked message, m11, m21, mn1 represents a plurality of data messages m1, m2, mn, a first message block of mn, m12, m22, mn2 represents a plurality of data messages m1, m2, mn, a second message block of mn, m1k, m2k, mnk represents a plurality of data messages m1, m2, mn.
Optionally, in an embodiment of the present application, the generating module 33 is specifically configured to use the formula: result 2= ((result 1< < w) ((S2 < < w) >) No.,) mod2n, with the first intermediate masking message being left-shifted by a first preset number of bits, the plurality of second masks being circularly left-shifted by a first preset number of bits, and the left-shifted result of the first intermediate masking message and the left-shifted result of the plurality of second masks being exclusive-ored to obtain a second intermediate masking message;
Wherein result2 is represented as a second intermediate masking message, and w is represented as a left shift by a first preset number of bits;
Optionally, in an embodiment of the present application, the generating module 33 is specifically configured to use the formula: the result 3=result 2# (p 1< < (w+1)) # (p 2< < (w+1)) # (pn < (w+1)), performing cyclic left shift operation on the plurality of first masks by a first preset number of bits, and performing exclusive or operation on left shift results of the plurality of first masks and the second intermediate masking message to obtain a third intermediate masking message;
Wherein result3 is represented as a third intermediate mask message, (w+1) is represented as a left shift by a second preset number of bits;
Optionally, in an embodiment of the present application, the generating module 33 is specifically configured to use the formula: final _ result=result 3 _ (s1 < < w) ((S2 < < w) > a @ is a @ and @ is a (Sn < < w)), the plurality of second masks are subjected to a cyclic left-shift operation by a first preset number of bits, exclusive or transportation is carried out on the left shift results of the plurality of second masks and the third intermediate masking message, so that a masking message is obtained;
Wherein final_result is denoted as mask message, and w is denoted as left-shifted by a first preset number of bits.
Optionally, in an embodiment of the present application, the plurality of first masks includes at least: a random binary number or a random string.
The data transmission processing system based on Glink bus protocol described in fig. 3 may execute the data transmission processing method based on Glink bus protocol described in the embodiment shown in fig. 1, and its principle and technical effects are not repeated. The specific manner in which the respective modules and units perform the operations in the data transmission processing system based on Glink bus protocol in the above embodiment has been described in detail in the embodiment related to the method, and will not be described in detail here.
In one possible design, the Glink bus protocol-based data transfer processing system of the embodiment shown in FIG. 3 may be implemented as a computing device, which may include a storage component 41 and a processing component 42, as shown in FIG. 4;
The storage component 41 stores one or more computer instructions for execution by the processing component 42.
The processing component 42 is configured to: determining a plurality of data messages to be sent under Glink bus protocol; for each data message, acquiring a plurality of first masks which are randomly generated and a plurality of second masks which are generated through preset fixed rules; masking each of the data messages by the plurality of first masks and the plurality of second masks to generate a masked message; and encrypting the masked message to obtain an encrypted message, and sending the encrypted message to a receiving end so that the receiving end can decrypt the encrypted message to obtain the masked message, and decoding the masked message through the plurality of first masks and the plurality of second masks to obtain a plurality of data messages.
Wherein the processing component 42 may include one or more processors to execute computer instructions to perform all or part of the steps of the methods described above. Of course, the processing component may also be implemented as one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic elements for executing the methods described above.
The storage component 41 is configured to store various types of data to support operations at the terminal. The memory component may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
Of course, the computing device may necessarily include other components, such as input/output interfaces, communication components, and the like.
The input/output interface provides an interface between the processing component and a peripheral interface module, which may be an output device, an input device, etc.
The communication component is configured to facilitate wired or wireless communication between the computing device and other devices, and the like.
The computing device may be a physical device or an elastic computing host provided by the cloud computing platform, and at this time, the computing device may be a cloud server, and the processing component, the storage component, and the like may be a base server resource rented or purchased from the cloud computing platform.
The embodiment of the application also provides a computer storage medium, which stores a computer program, and the computer program can realize the data transmission processing method based on Glink bus protocol in the embodiment shown in fig. 1 when being executed by a computer.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.