An improved method for data transmission encryption
By building the assembly emulator on the client and encrypting symmetric keys using private algorithms, the problem of difficulty in key leakage and update in the C/S service framework is solved, and secure and fast key changes are achieved, improving data security.
Patent Information
- Application Number
- CN202410234951.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-01
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-03-01
AI Technical Summary
In the C/S service framework, data security cannot be guaranteed after the client key is leaked, and it is difficult to update the key in many cases of the client.
The client program is built-in assembler code. The server uses a private algorithm to encrypt the symmetric key, compile it into binary data, and decrypts the client hardware ID and SN information to achieve secure and fast key changes.
The problem of key leakage and difficulty in updating keys is avoided, data security is improved, and communication keys can be safely changed without increasing hardware costs.
Smart Images

Figure CN118118170B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and in particular to an improved method for data transmission encryption. Background Art
[0002] With the continuous development of information technology, data security issues have received more and more attention. Cryptographic algorithms are an effective means to deal with privacy threats and are widely used in various scenarios, such as encrypted storage and network data transmission.
[0003] In the prior art, a public algorithm is generally used to encrypt the transmitted data, and the sending and receiving ends each store the key. In the C / S service framework, once the client key is leaked, the security of the data cannot be guaranteed. On the other hand, when there are many clients, it becomes very difficult to update the new key.
[0004] In order to solve the above problems, we propose an improved method for data transmission encryption. Summary of the invention
[0005] In view of the deficiencies of the prior art, the present invention provides an improved method for data transmission encryption to solve the problems raised in the above background technology.
[0006] To achieve the above object, the present invention provides the following technical solution: an improved method for data transmission encryption, comprising the following steps:
[0007] S1. Built-in assembly simulator code in the client program;
[0008] S2. The server encrypts the symmetric key used in the data communication process with a private algorithm to generate a new key;
[0009] S3, the server compiles the private algorithm in step S2 into binary data corresponding to the simulator as data storage;
[0010] S4, the client sends a data service request to the server;
[0011] S5. After receiving the request, the server verifies the request;
[0012] S6. The server encrypts the binary data in step S3 with a key generated by the client ID and SN information and sends the encrypted data to the client.
[0013] S7. After receiving the binary data, the client decrypts it according to its own hardware ID and SN information to obtain the assembled binary data;
[0014] S8, the client executes the binary data through the assembly simulator and uses the key of the private algorithm originally stored by the client as input to generate a new key;
[0015] S9. The server and the client subsequently exchange data using the new key.
[0016] To further optimize the technical solution, in step S1, the assembly simulator includes but is not limited to a MIPS assembly simulator or a RISC-V assembly simulator built into the ARM program.
[0017] To further optimize the technical solution, in step S2, the encryption private algorithm of the symmetric key includes but is not limited to DES, IDEA, AES, 3DES, RC2, RC4, RC5, Blowtish and CAST.
[0018] To further optimize the technical solution, in step S3, the method of compiling the private algorithm into binary data corresponding to the simulator includes the following specific process:
[0019] Parse the received private algorithm to obtain the target encryption algorithm to be compiled;
[0020] Find the target domain-specific language algorithm program corresponding to the target encryption algorithm from the algorithm program set of the simulator;
[0021] Mapping the target domain-specific language algorithm program into an assembly program of a key using a preset mapping tool of the simulator;
[0022] Compile binary data of the target encryption algorithm based on the assembler.
[0023] To further optimize the technical solution, in step S3, when the private algorithm in step S2 is updated or modified, the original key remains unchanged and the data storage of the client is dynamically updated.
[0024] To further optimize the technical solution, in step S4, the data service request sent by the client includes hardware parameter information including ID and SN.
[0025] To further optimize the technical solution, in steps S4 and S5, both data transmission and data verification use an asymmetric encryption algorithm, and the asymmetric encryption algorithm includes but is not limited to an RSA algorithm, a DSA algorithm, an elliptic encryption ECC algorithm, and a DH algorithm.
[0026] To further optimize the technical solution, in step S5, the server verifies the client ID based on the database and determines the authority of the client.
[0027] To further optimize the technical solution, in step S6, the server dynamically and randomly generates a private encryption and decryption code according to the client ID and SN information. The private algorithm of the encryption and decryption code is the same, but the array involved is randomly generated; an unpredictable random number is first generated by a quantum random number generator, and then the random number is subjected to a large integer prime number screening algorithm to obtain an array that satisfies the encryption and decryption code to generate a public key and a private key pair.
[0028] To further optimize the technical solution, the key generation process is based on a quantum random number generator and a large integer prime number screening algorithm, and is divided into the following steps:
[0029] The quantum random number generator uses the principles of quantum physics to generate unpredictable random numbers. The random numbers obtained from the quantum random number generator are filtered out through the large integer prime number screening algorithm. The screening formula is as follows:
[0030]
[0031] Where (n) is the large integer to be tested, (a) is a random integer less than (n), (d) is the result of removing as many factors of (2) as possible from (n-1), and (r) is the power of (2) in (n-1 = d \times 2^r);
[0032] The encryption and decryption process is based on a public key and a private key pair. The public key and private key are generated as follows:
[0033] The public key is ((e, n)), where (e) is a positive integer less than (φ(n)), and (e) and (φ(n)) are relatively prime, (φ(n) = (p-1)(q-1));
[0034] The private key is ((d, n)), where (d) is the inverse of (e) modulo (φ(n)), that is, (ed \mod φ(n) = 1);
[0035] Assume (M) is the message to be encrypted, converted to an integer, (0 \leq M < n), then the encrypted message (C) is calculated as follows:
[0036]
[0037] Decrypt the ciphertext (C) using the private key (d) and recover the message (M):
[0038] .
[0039] Compared with the prior art, the present invention provides an improved method for data transmission encryption, which has the following beneficial effects:
[0040] The improved method for data transmission encryption improves the encryption method for data transmission in the C / S service framework, compiles the private algorithm into binary data based on an assembly simulator, and uses the binary data to achieve secure and fast key changes. Compared with the existing technology, this method will not cause key leakage and difficulty in updating keys. It greatly improves data security without increasing hardware costs, and can securely change communication keys without the need to update the client. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of a flow chart of an improved method for data transmission encryption proposed by the present invention;
[0042] Figure 2 A schematic diagram of the process of compiling binary data of an improved method for data transmission encryption proposed by the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Example
[0044] See also Figure 1 , an improved method for data transmission encryption, comprising the following steps:
[0045] S1. Built-in assembly simulator code in the client program. It can be simulators of different architectures, such as building a MIPS assembly simulator in an ARM program.
[0046] S2. The server encrypts the symmetric key used in the data communication process with a private algorithm to generate a new key. In this embodiment, the private encryption algorithm of the symmetric key adopts the traditional algorithm of DES, IDEA, AES or 3DES.
[0047] S3. The server compiles the private algorithm in step S2 into binary data corresponding to the simulator as data storage.
[0048] In this embodiment, if Figure 2 As shown, the method of compiling a private algorithm into binary data corresponding to a simulator includes the following specific processes:
[0049] Parse the received private algorithm to obtain the target encryption algorithm to be compiled;
[0050] Find the target domain-specific language algorithm program corresponding to the target encryption algorithm from the algorithm program set of the simulator;
[0051] Mapping the target domain-specific language algorithm program into an assembly program of a key using a preset mapping tool of the simulator;
[0052] Compile binary data of the target encryption algorithm based on the assembler.
[0053] Meanwhile, in this embodiment, when the private algorithm in step S2 is updated or modified, the original key remains unchanged, and the data storage of the client is dynamically updated.
[0054] S4. The client sends a data service request to the server. The data service request sent by the client includes hardware parameter information including ID and SN.
[0055] S5. After receiving the request, the server verifies the request and verifies the client ID based on the database to determine the authority of the client.
[0056] In this embodiment, both data transmission and data verification use an asymmetric encryption algorithm, and the asymmetric encryption algorithm includes an RSA algorithm, a DSA algorithm, and a DH algorithm.
[0057] S6. The server encrypts the binary data in step S3 using a key generated by the client ID and SN information and sends the encrypted data to the client.
[0058] In this embodiment, the server dynamically and randomly generates a private encryption and decryption code according to the client ID and SN information. The private algorithm of the encryption and decryption code is the same, but the arrays involved are randomly generated.
[0059] Furthermore, the random generation of the array in the encryption and decryption code includes the following specific steps:
[0060] First, an unpredictable random number is generated by a quantum random number generator, and then the random number is filtered by a large integer prime number to obtain an array that satisfies the encryption and decryption code to generate a public key and private key pair.
[0061] S7. After receiving the binary data, the client decrypts it according to its own hardware ID and SN information to obtain the assembled binary data.
[0062] S8. The client executes the binary data through the assembly simulator and uses the key of the private algorithm originally stored by the client as input to generate a new key.
[0063] S9. The server and the client subsequently exchange data using the new key.
[0064] In summary, the improved method of data transmission encryption improves the encryption method of data transmission in the C / S service framework, compiles the private algorithm into binary data based on the assembly simulator, and uses the binary data to achieve safe and fast key changes. Compared with the existing technology, this method will not have the problems of key leakage and difficulty in updating keys. It greatly improves data security without increasing hardware costs, and can safely change communication keys without updating the client. Example
[0065] An improved method for data transmission encryption improves the encryption method for data transmission in a C / S service framework, compiles a private algorithm into binary data based on an assembly simulator, and uses the binary data to achieve secure and fast key changes. Compared with the prior art, this method does not cause key leakage and difficulty in updating keys, greatly improves data security without increasing hardware costs, and can securely change communication keys without requiring updates on the client side.
[0066] The method comprises the following steps:
[0067] S1. Built-in assembly simulator code in the client program. It can be simulators of different architectures, such as building a RISC-V assembly simulator in an ARM program.
[0068] S2. The server encrypts the symmetric key used in the data communication process with a private algorithm to generate a new key. In this embodiment, the encryption private algorithm of the symmetric key adopts 3DES, RC2, RC4, RC5, Blowtish and CAST algorithms.
[0069] S3. The server compiles the private algorithm in step S2 into binary data corresponding to the simulator as data storage.
[0070] In this embodiment, if Figure 2 As shown, the method of compiling a private algorithm into binary data corresponding to a simulator includes the following specific processes:
[0071] Parse the received private algorithm to obtain the target encryption algorithm to be compiled;
[0072] Find the target domain-specific language algorithm program corresponding to the target encryption algorithm from the algorithm program set of the simulator;
[0073] Mapping the target domain-specific language algorithm program into an assembly program of a key using a preset mapping tool of the simulator;
[0074] Compile binary data of the target encryption algorithm based on the assembler.
[0075] Meanwhile, in this embodiment, when the private algorithm in step S2 is updated or modified, the original key remains unchanged, and the data storage of the client is dynamically updated.
[0076] S4. The client sends a data service request to the server. The data service request sent by the client includes hardware parameter information including ID and SN.
[0077] S5. After receiving the request, the server verifies the data. The server verifies the client ID based on the database and determines the request of the client.
[0078] In this embodiment, both data transmission and data verification adopt an asymmetric encryption algorithm, and the asymmetric encryption algorithm includes an elliptic encryption ECC algorithm and a DH algorithm.
[0079] S6. The server encrypts the binary data in step S3 using a key generated by the client ID and SN information and sends the encrypted data to the client.
[0080] In this embodiment, the server dynamically and randomly generates a private encryption and decryption code according to the client ID and SN information. The private algorithm of the encryption and decryption code is the same, but the arrays involved are randomly generated.
[0081] Furthermore, the random generation of the array in the encryption and decryption code includes the following specific steps:
[0082] First, an unpredictable random number is generated by a quantum random number generator, and then the random number is filtered by a large integer prime number to obtain an array that satisfies the encryption and decryption code to generate a public key and private key pair.
[0083] The key generation process is based on a quantum random number generator and a large integer prime number screening algorithm and is divided into the following steps:
[0084] The quantum random number generator uses the principles of quantum physics to generate unpredictable random numbers. The random numbers obtained from the quantum random number generator are filtered out through the large integer prime number screening algorithm. The screening formula is as follows:
[0085]
[0086] Where (n) is the large integer to be tested, (a) is a random integer less than (n), (d) is the result of removing as many factors of (2) as possible from (n-1), and (r) is the power of (2) in (n-1 = d \times 2^r);
[0087] The encryption and decryption process is based on a public key and a private key pair. The public key and private key are generated as follows:
[0088] The public key is ((e, n)), where (e) is a positive integer less than (φ(n)), and (e) and (φ(n)) are relatively prime, (φ(n) = (p-1)(q-1));
[0089] The private key is ((d, n)), where (d) is the inverse of (e) modulo (φ(n)), that is, (ed \mod φ(n) = 1);
[0090] Assume (M) is the message to be encrypted, converted to an integer, (0 \leq M < n), then the encrypted message (C) is calculated as follows:
[0091]
[0092] Decrypt the ciphertext (C) using the private key (d) and recover the message (M):
[0093] .
[0094] S7. After receiving the binary data, the client decrypts it according to its own hardware ID and SN information to obtain the assembled binary data.
[0095] S8. The client executes the binary data through the assembly simulator and uses the key of the private algorithm originally stored by the client as input to generate a new key.
[0096] S9. The server and the client subsequently exchange data using the new key.
[0097] The beneficial effects of the present invention are:
[0098] The improved method for data transmission encryption improves the encryption method for data transmission in the C / S service framework, compiles the private algorithm into binary data based on an assembly simulator, and uses the binary data to achieve secure and fast key changes. Compared with the existing technology, this method will not cause key leakage and difficulty in updating keys. It greatly improves data security without increasing hardware costs, and can securely change communication keys without the need to update the client.
[0099] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0100] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An improved method for data transmission encryption, characterized in that: The following steps are involved: S1. Built-in assembly simulator code in the client program; S2. The server encrypts the symmetric key used in the data communication process with a private algorithm to generate a new key; S3, the server compiles the private algorithm in step S2 into binary data corresponding to the simulator as data storage; S4, the client sends a data service request to the server; S5. After receiving the request, the server verifies the request; S6. The server encrypts the binary data in step S3 with a key generated by the client ID and SN information and sends the encrypted data to the client. S7. After receiving the binary data, the client decrypts it according to its own hardware ID and SN information to obtain the assembled binary data; S8, the client executes the binary data through the assembly simulator and uses the key of the private algorithm originally stored by the client as input to generate a new key; S9. The server and the client subsequently exchange data using the new key.
2. The improved method for data transmission encryption according to claim 1, characterized in that: In step S1, the assembly simulator includes but is not limited to a MIPS assembly simulator or a RISC-V assembly simulator built into the ARM program.
3. The improved method for data transmission encryption according to claim 1, characterized in that: In step S2, the encryption private algorithm of the symmetric key includes but is not limited to DES, IDEA, AES, 3DES, RC2, RC4, RC5, Blowtish and CAST.
4. The improved method for data transmission encryption according to claim 1, characterized in that: In step S3, the method of compiling the private algorithm into binary data corresponding to the simulator includes the following specific process: Parse the received private algorithm to obtain the target encryption algorithm to be compiled; Find the target domain-specific language algorithm program corresponding to the target encryption algorithm from the algorithm program set of the simulator; Mapping the target domain-specific language algorithm program into an assembly program of a key using a preset mapping tool of the simulator; Compile binary data of the target encryption algorithm based on the assembler.
5. The improved method for data transmission encryption according to claim 1, characterized in that: In step S3, when the private algorithm in step S2 is updated or modified, the original key remains unchanged and the data storage of the client is dynamically updated.
6. The improved method for data transmission encryption according to claim 1, characterized in that: In step S4, the data service request sent by the client includes hardware parameter information including ID and SN.
7. The improved method for data transmission encryption according to claim 1, characterized in that: In the steps S4 and S5, both data transmission and data verification adopt an asymmetric encryption algorithm, and the asymmetric encryption algorithm includes but is not limited to an RSA algorithm, a DSA algorithm, an elliptic encryption ECC algorithm, and a DH algorithm.
8. The improved method for data transmission encryption according to claim 1, characterized in that: In step S5, the server verifies the client ID based on the database and determines the authority of the client.
9. The improved method for data transmission encryption according to claim 1, characterized in that: In step S6, the server dynamically and randomly generates a private encryption and decryption code according to the client ID and SN information. The private algorithm of the encryption and decryption code is the same, but the array involved is randomly generated; an unpredictable random number is first generated by a quantum random number generator, and then the random number is subjected to a large integer prime number screening algorithm to obtain an array that satisfies the encryption and decryption code to generate a public key and a private key pair.
Citation Information
Patent Citations
Data encryption method and device, data decryption method and device and computer device
CN111245808A
Set top box information secure transmission encryption method
CN115278312A