Key negotiation method based on pseudo-random number
Through a key negotiation method based on pseudo-random numbers, the initial seed is generated using asymmetric encryption and new negotiation keys and seeds are generated through pseudo-random functions, which solves the problem of low key generation efficiency and long-term negotiation response time in the prior art. The problem is to achieve efficient and secure key negotiation.
Patent Information
- Application Number
- CN202411256113.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-11-12
AI Technical Summary
The existing key negotiation method is inefficient in generating keys in frequent negotiation scenarios, and each negotiation requires repeated encryption and decryption processes, resulting in a long response time.
Using a key negotiation method based on pseudo-random numbers, the original seed is generated through asymmetric encryption. Each negotiation is used to exchange random numbers to generate new negotiation keys and new seeds locally from the seed and pseudo-random functions, and pseudo-random functions are used to generate pseudo-random functions. Random arrays are linearly combined to generate negotiation keys and reserve shared seeds.
It improves the efficiency of key generation and the response speed of negotiation, is suitable for frequent negotiation scenarios, and only once asymmetric encryption generates the initial seed can achieve multiple key negotiations in an insecure channel, enhancing security.
Smart Images

Figure CN118944882A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and more particularly to a key negotiation method based on pseudo-random numbers. Background Art
[0002] The existing key negotiation method has low efficiency in generating the negotiation key, and each negotiation needs to repeat the encryption and decryption process. Therefore, it has great limitations when facing frequent negotiations.
[0003] For example, in the invention patent with publication number CN109120649B, after receiving the random request sent by the device, the cloud server generates a first random number and returns the random number to the device. The device signs the random number, sends the signature and the public key to generate a key negotiation request to the cloud server, and the cloud server decrypts the signature data after receiving the request to obtain a second random number. When the first random number is consistent with the second random number, the cloud server and the device conduct a key negotiation. The invention proposes a cloud server and device key negotiation scheme. Each request requires the cloud device to generate a random number, and the device signs to prove its identity. In the case where the same device needs to make multiple negotiation requests, the response time is relatively long.
[0004] Therefore, how to provide a key negotiation method based on pseudo-random numbers that can improve the efficiency of key generation, increase the response speed of negotiation, and be suitable for application scenarios with frequent negotiations is a problem that technical personnel in this field urgently need to solve. Summary of the invention
[0005] In view of this, the present invention provides a key negotiation method based on pseudo-random numbers, which generates an original seed through asymmetric encryption. Each negotiation can generate a new negotiation key and a new seed locally by exchanging random numbers from the seed and the pseudo-random function, which has higher efficiency, and the security of the scheme depends on the security of the seed.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] A key negotiation method based on pseudo-random numbers comprises the following steps:
[0008] Authenticate digital certificates and establish initial shared seeds;
[0009] Based on the initial shared seed, a pseudo-random array is generated by a pseudo-random function;
[0010] Randomly generate a personal string and publish the personal string;
[0011] combining the personal character strings to form a shared character string;
[0012] The pseudo-random number is used to process the shared character string to generate a negotiation key and a reserved shared seed.
[0013] Furthermore, the personal character string is published by forwarding to each other.
[0014] Further, the pseudo-random number is used to process the shared string, the steps comprising:
[0015] Includes two sets of shared strings;
[0016] Pseudo-random numbers are used to linearly combine the two groups of shared character strings to obtain the negotiated key and the reserved shared seed.
[0017] Furthermore, a personal string is generated, including:
[0018] Conversation party A randomly generates a first character string and a second character string;
[0019] Conversation party B randomly generates a third character string and a fourth character string.
[0020] Furthermore, the steps of combining the personal character string to form a shared character string include:
[0021] A set of personal character strings is obtained from conversation party A and conversation party B respectively, and they are combined in pairs to obtain two sets of shared character strings.
[0022] Furthermore, the linear combination step includes:
[0023] Summing corresponding elements in the first string and the third string to obtain a first shared string; multiplying the pseudo-random array by corresponding elements in the first shared string to generate a negotiated key;
[0024] The corresponding elements in the second character string and the fourth character string are summed to obtain a second shared character string; and the corresponding elements in the second shared character string are multiplied by the pseudo-random array to generate a reserved shared seed.
[0025] Further, authenticating the digital certificate and establishing the initial shared seed, the steps include:
[0026] Session party A receives session party B's digital certificate and performs authentication;
[0027] Session party A generates an initial shared seed, and sends the initial shared seed to session party B through asymmetric encryption;
[0028] Session party B receives session party A's digital certificate and the encrypted initial shared seed;
[0029] Session party B authenticates session party A's digital certificate and obtains the initial shared seed by decryption.
[0030] Furthermore, the asymmetric encryption adopts RSA encryption algorithm or SM2 algorithm
[0031] Furthermore, the step also includes: performing secondary negotiation through the reserved shared seed, and during the secondary negotiation, the pseudo-random array is randomly generated by the reserved shared seed according to the pseudo-random function.
[0032] Furthermore, the reserved shared seed is generated and stored in a local server.
[0033] Beneficial effects of the present invention:
[0034] It can be seen from the above technical solution that, compared with the prior art, the present invention discloses a key negotiation method based on pseudo-random numbers, which generates an original seed through asymmetric encryption. Each negotiation can generate a new negotiation key and a new seed locally by exchanging random numbers by the seed and the pseudo-random function. It is more efficient in application scenarios that require multiple negotiations, and the security of the solution depends on the security of the seed. The present invention only needs the first asymmetric encryption to generate the initial seed, and the user does not need to store a large amount of seeds, and can achieve multiple key negotiations in an insecure channel. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0036] Figure 1 The accompanying drawing is a schematic diagram of a key negotiation method based on pseudo-random numbers provided by the present invention;
[0037] Figure 2 The accompanying drawing is a schematic diagram of a method according to another embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in 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.
[0039] See also Figure 1 and Figure 2The embodiment of the present invention discloses a key negotiation method based on pseudo-random numbers, comprising the following steps:
[0040] A key negotiation method based on pseudo-random numbers comprises the following steps:
[0041] Authenticate digital certificates and establish initial shared seeds;
[0042] Among them, the authentication of the digital certificate and the establishment of the initial shared seed can be carried out successively or simultaneously. The establishment of the initial shared seed can be carried out in a non-encrypted manner, such as using the RSA encryption algorithm or SM2, encrypted by one party and passed to the other party for decryption; User A and User B perform identity authentication through the CA digital certificate, and User A randomly generates a seed k with a length of λ. The longer the length of λ, the more secure it is as a key. It can be selected as 128 bits, 256 bits, etc., and the public key is extracted through B's digital certificate to encrypt the seed k. B (k) is sent to user B. User B decrypts and obtains seed k.
[0043] Based on the initial shared seed, a pseudo-random array is generated by a pseudo-random function;
[0044] In one embodiment, users A and B use the seed k as the input F(k|j) of the pseudo-random function PRF, j=1,...,i;
[0045] Among them, j represents the jth group among i groups of random numbers.
[0046] Each seed k needs to generate i groups of pseudo-random numbers. In order to increase the inconsistency of the output results each time, j is added, j=1,…,i, and the length of each group of pseudo-random numbers is consistent with the seed length.
[0047] Randomly generate a personal string and publish it;
[0048] Combine individual strings to form a shared string;
[0049] Pseudo-random numbers are used to process the shared string to generate a negotiation key and reserve a shared seed.
[0050] In another embodiment, the personal character string is published by forwarding to each other.
[0051] In another embodiment, a pseudo-random number is used to process a shared string, and the steps include:
[0052] Includes two sets of shared strings;
[0053] Pseudo-random numbers are used to perform linear combinations on the two sets of shared strings to obtain the negotiated key and the reserved shared seed.
[0054] In another embodiment, generating a personal string includes:
[0055] Conversation party A randomly generates a first character string y1 and a second character string y2;
[0056] Conversation party B randomly generates a third character string z1 and a fourth character string z2.
[0057] In another embodiment, the steps of combining personal strings to form a shared string include:
[0058] A set of personal character strings is obtained from conversation party A and conversation party B respectively, and they are combined in pairs to obtain two sets of shared character strings.
[0059] In another embodiment, the linear combination step comprises:
[0060] Summing corresponding elements in the first string and the third string to obtain a first shared string; multiplying the pseudo-random array by corresponding elements in the first shared string to generate a negotiated key;
[0061] The corresponding elements in the second character string and the fourth character string are summed to obtain a second shared character string; the pseudo-random array is multiplied by the corresponding element in the second shared character string to generate a reserved shared seed.
[0062] Specifically, the linear combination method is: shared string (y 1 +z 1 ) is a 0,1 string of length i (w 1 ,...,w i ), the pseudo-random function generates i sets of pseudo-random numbers (r 1 ,...,r i ), then the final result of the linear combination is r = w 1 *r 1 +,...,+w i *r i The same method is used to linearly combine another set of shared strings. The results of the two linear combinations are the negotiation key, which is used for this negotiation, and the reserved shared seed, which is used for the next negotiation. Through this linear combination method, the final negotiation key will be more uniform, reducing the chance of leaking seed information due to special results generated by special data.
[0063] The negotiation data is uniformly random, which means that the less information is exposed, the more difficult it is to find the seed from the exposed negotiation key. For the method without linear combination, the random number is generated only once, and the attacker may infer the seed based on the existing data. For example, if the attacker has the same pseudo-random function and the output of the function, he can know the input based on the output.
[0064] In another embodiment, the steps of authenticating the CA digital certificate and establishing an initial shared seed include:
[0065] Session A receives session B's digital certificate from CA B , and conduct certification;
[0066] Session party A generates an initial shared seed and sends it to session party B via asymmetric encryption.
[0067] Session B receives session A's digital certificate from CA A and the encrypted initial shared seed;
[0068] Session party B authenticates session party A's digital certificate and obtains the initial shared seed by decryption.
[0069] In another embodiment, the steps further include: performing secondary negotiation by using a reserved shared seed, and during the secondary negotiation, a pseudo-random array is randomly generated by the reserved shared seed according to a pseudo-random function.
[0070] In another embodiment, the reserved shared seed is generated and stored in a local server.
[0071] The present invention discloses a key negotiation method based on pseudo-random numbers, which generates an original seed through asymmetric encryption. Each negotiation can generate a new negotiation key and a new seed locally by exchanging random numbers by the seed and the pseudo-random function. The efficiency is higher in application scenarios that require multiple negotiations, and the security of the scheme depends on the security of the seed. The present invention only needs the first asymmetric encryption to generate an initial seed, and the user does not need to store a large amount of seeds, and multiple key negotiations can be achieved in an insecure channel.
[0072] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0073] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A key negotiation method based on pseudo-random numbers, characterized in that: The following steps are involved: Authenticate digital certificates and establish initial shared seeds; Based on the initial shared seed, generating a pseudo-random array by a pseudo-random function; Randomly generate a personal string and publish the personal string; combining the personal character strings to form a shared character string; The pseudo-random number is used to process the shared character string to generate a negotiation key and a reserved shared seed.
2. A key negotiation method based on pseudo-random numbers according to claim 1, characterized in that: The personal character string is published by forwarding to each other.
3. A key negotiation method based on pseudo-random numbers according to claim 1, characterized in that: The pseudo-random number is used to process the shared string, the steps comprising: Includes two sets of shared strings; Pseudo-random numbers are used to linearly combine the two groups of shared character strings to obtain the negotiated key and the reserved shared seed.
4. A key negotiation method based on pseudo-random numbers according to claim 3, characterized in that: Generate a personal string, including: Conversation party A randomly generates a first character string and a second character string; Conversation party B randomly generates a third character string and a fourth character string.
5. A key negotiation method based on pseudo-random numbers according to claim 4, characterized in that: Combining the personal character string to form a shared character string, the steps include: A set of personal character strings is obtained from conversation party A and conversation party B respectively, and they are combined in pairs to obtain two sets of shared character strings.
6. A key negotiation method based on pseudo-random numbers according to claim 5, characterized in that: The linear combination step comprises: Summing corresponding elements in the first string and the third string to obtain a first shared string; multiplying the pseudo-random array by corresponding elements in the first shared string to generate a negotiated key; The corresponding elements in the second character string and the fourth character string are summed to obtain a second shared character string; and the corresponding elements in the second shared character string are multiplied by the pseudo-random array to generate a reserved shared seed.
7. A key negotiation method based on pseudo-random numbers according to claim 1, characterized in that: Authentication of the digital certificate and establishment of the initial shared seed, the steps include: Session party A receives session party B's digital certificate and performs authentication; Session party A generates an initial shared seed, and sends the initial shared seed to session party B through asymmetric encryption; Session party B receives session party A's digital certificate and the encrypted initial shared seed; Session party B authenticates session party A's digital certificate and obtains the initial shared seed by decryption.
8. A key negotiation method based on pseudo-random numbers according to claim 7, characterized in that: The asymmetric encryption adopts RSA encryption algorithm or SM2 algorithm.
9. A key negotiation method based on pseudo-random numbers according to claim 1, characterized in that: The step also includes: performing secondary negotiation through the reserved shared seed, and during the secondary negotiation, the pseudo-random array is randomly generated by the reserved shared seed according to the pseudo-random function.
10. A key negotiation method based on pseudo-random numbers according to claim 1 or 9, characterized in that: The reserved shared seed is generated and stored in the local server.
