Password-based authentication key negotiation method and electronic equipment
By using hash-calculated password files and temporary keys in the password file generation stage, the problems of password leakage and pre-computation attacks in the prior art are solved, and identity privacy protection and efficient session key negotiation are achieved.
Patent Information
- Application Number
- CN202410940459.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-07-12
AI Technical Summary
The existing password-based authentication key negotiation protocol has the risk of password leakage in the symmetric PAKA protocol, there is pre-computation attack in the asymmetric PAKA protocol, and the application of solutions in an asymmetric environment is limited, and most protocols do not provide identity privacy protection.
By using password, salt value and identity information during the password file generation stage, a password file containing hash calculation is generated, and using temporary key and password file to generate the same temporary secret value during the session key negotiation stage, verify the identity of both parties and generate the Session keys avoid the storage of plaintext passwords and bilinear pairing operations, and rely on lightweight operations such as hashing.
Implement identity privacy protection for symmetric password authentication key negotiation, resist information leakage attacks and pre-computing attacks, simplify the computing process, and improve security and efficiency.
Smart Images

Figure CN118944867A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of key technology, and in particular to a password-based authentication key negotiation method and electronic device. Background Art
[0002] The Password-based Authenticated Key Agreement (PAKA) protocol allows the parties to authenticate each other through a pre-shared low-entropy secret value (i.e., password) and then jointly negotiate the final session key. This type of protocol is flexible to deploy, easy to maintain, and the password is simple and easy to remember. In addition, the PAKA protocol does not require the participation of public key infrastructure and key distribution center, and does not have excessive security assumptions.
[0003] The PAKA protocol can be divided into two categories: symmetric PAKA protocol and asymmetric PAKA protocol. Among them, the symmetric PAKA protocol has the risk of password leakage; the asymmetric PAKA protocol has pre-calculation attacks, and the application of the scheme in an asymmetric environment is relatively limited.
[0004] Therefore, it is particularly important to obtain a symmetric password-authenticated key agreement scheme that protects the participants from information attacks and pre-computation attacks. Summary of the invention
[0005] In an exemplary embodiment of the present application, a password-based authentication key negotiation method and electronic device are provided to negotiate a session key, thereby protecting the participants from information attacks and pre-computation attacks.
[0006] According to a first aspect of an exemplary implementation, a password-based authentication key negotiation method is provided, which is applied to a client and includes:
[0007] Generate a first target password according to the first random number and the first reference password in the first password file, and generate a first prime order group associated random number according to the first random number and a generator in a set prime order group; wherein the first password file is determined according to the first password associated with the client, the first identity identifier, and the first random salt value;
[0008] Sending the first target password, the first prime order group associated random number and the first timestamp to the server;
[0009] Receiving from the server a second target password generated according to a second reference password and a second random number, a second prime order group-associated random number generated according to the second random number and a generator in a set prime order group, a second timestamp, and a second ciphertext calculated according to the second timestamp, the second reference password and the second random number;
[0010] Calculate a first intermediate secret value according to the received second target password and the random number associated with the second prime order group, as well as the pre-stored first reference identity, the first identity, and the first random number; wherein the first reference identity is obtained by performing a hash calculation on the first identity;
[0011] The second ciphertext is decrypted, and if the decryption verification is passed, a first session key is calculated according to the first intermediate secret value, the first target password, the random number associated with the first prime order group, the second target password, and the random number associated with the second prime order group.
[0012] According to a second aspect of the exemplary implementation, a password-based authentication key negotiation method is provided, which is applied to a server, and the method includes:
[0013] Receiving a first target password, a first prime order group associated random number, and a first timestamp from a client;
[0014] Generate a second target password according to the second random number and the second reference password in the second password file, and generate a second prime order group-associated random number according to the second random number and a generator in a set prime order group; wherein the second password file is determined according to the second password associated with the server, the second identity identifier, and the second random salt value;
[0015] Calculate a second intermediate secret value according to the received first target password and the random number associated with the first prime order group, as well as the pre-stored second reference identifier, the second identity identifier, and the second random number; wherein the second reference identifier is obtained by performing a hash calculation on the second identity identifier;
[0016] Calculate a second ciphertext according to the second timestamp, the second reference password and the second random number;
[0017] Sending the second target password, the second prime order group associated random number, the second timestamp, and the second ciphertext to the client;
[0018] Receiving a first ciphertext generated from a client according to a first timestamp, a first target password and a first random number;
[0019] The first ciphertext is decrypted, and if the decryption verification is passed, a second session key is calculated according to the second intermediate secret value, the second target password, the second prime order group associated random number, the first target password, and the first prime order group associated random number.
[0020] According to a third aspect of an exemplary implementation, a password-based authentication key agreement device is provided, which is a user client, including:
[0021] A first processing unit is configured to: generate a first target password according to a first random number and a first reference password in a first password file, and generate a first prime order group-associated random number according to the first random number and a generator in a set prime order group; wherein the first password file is determined according to a first password associated with a client, a first identity identifier, and a first random salt value;
[0022] A first transmission unit is used to: send a first target password, a first prime order group associated random number and a first timestamp to a server;
[0023] The first transmission unit is further used to: receive from the server a second target password generated according to the second reference password and the second random number, a second prime order group associated random number generated according to the second random number and a generator in a set prime order group, a second timestamp, and a second ciphertext calculated according to the second timestamp, the second reference password and the second random number;
[0024] The first processing unit is further configured to: calculate a first intermediate secret value according to the received second target password and the random number associated with the second prime order group, as well as the pre-stored first reference identity, the first identity, and the first random number; wherein the first reference identity is obtained by performing a hash calculation on the first identity;
[0025] The first processing unit is also used to: decrypt the second ciphertext, and when the decryption verification is passed, calculate the first session key according to the first intermediate secret value, the first target password, the random number associated with the first prime order group, the second target password, and the random number associated with the second prime order group.
[0026] According to a fourth aspect of the exemplary implementation, there is provided a password-based authentication key agreement device, which is applied to a server and includes:
[0027] The second transmission unit is used to: receive a first target password, a first prime order group associated random number and a first timestamp from a client;
[0028] a second processing unit, configured to: generate a second target password according to a second random number and a second reference password in a second password file, and generate a second prime order group-associated random number according to the second random number and a generator in a set prime order group; wherein the second password file is determined according to a second password associated with the server, a second identity identifier, and a second random salt value;
[0029] The second transmission unit is further used to calculate a second intermediate secret value according to the received first target password and the random number associated with the first prime order group, as well as the pre-stored second reference identifier, the second identity identifier, and the second random number; wherein the second reference identifier is obtained by performing a hash calculation on the second identity identifier;
[0030] The second processing unit is further used to: calculate a second ciphertext according to the second timestamp, the second reference password and the second random number;
[0031] The second transmission unit is further used to: send the second target password, the second prime order group associated random number, the second timestamp and the second ciphertext to the client;
[0032] The second transmission unit is further used to: receive a first ciphertext generated from the client according to the first timestamp, the first target password and the first random number;
[0033] The second processing unit is also used to: decrypt the first ciphertext, and when the decryption verification is passed, calculate the second session key according to the second intermediate secret value, the second target password, the second prime order group associated random number, the first target password, and the first prime order group associated random number.
[0034] According to a fifth aspect of the exemplary implementation, there is provided an electronic device, including a processor and a memory;
[0035] a memory for storing computer program instructions;
[0036] The processor executes the computer program instructions in the memory to perform the method provided in any one of the aforementioned aspects or any possible implementation manner of any one of the aspects.
[0037] According to the sixth aspect of the exemplary implementation, a computer-readable storage medium is also provided in an embodiment of the present application, in which a software program is stored. When the software program is read and executed by one or more processors, it can implement any method provided by any design in any aspect.
[0038] According to a seventh aspect of the exemplary implementation, the present application provides a computer program product, the computer program product includes computer instructions, when executed by a computing device, the computing device performs the method provided in any of the aforementioned aspects or any possible implementation of any of the aspects. The computer program product can be a software installation package, and when it is necessary to use the method provided in any of the aforementioned aspects or any possible implementation of any of the aspects, the computer program product can be downloaded and executed on a computing device.
[0039] In the embodiment of the present application, the client generates a first password file according to the associated first password, the first identity identifier and the first random salt value, and then generates a first target password according to the first random number and the first reference password in the first password file, and generates a random number associated with the first prime order group according to the first random number and a generator in the set prime order group. Such a design stores a password file instead of a plaintext password, and the password file includes elements such as passwords, identity identifiers and random salt values. Since the attacker does not know the random salt value, even if the password file is leaked, the protocol can resist pre-calculation attacks and prevent the attacker from obtaining the password. In other words, when the electronic device where the client is located is attacked, it can still protect both parties from the impact of information leakage and pre-calculation attacks. In addition, the client sends the first target password, the first prime order group associated random number and the first timestamp to the server; receives the second target password generated from the server according to the second reference password and the second random number, the second prime order group associated random number generated according to the second random number and a generator in the set prime order group, the second timestamp, and the second ciphertext calculated according to the second timestamp, the second reference password and the second random number; calculates the first intermediate secret value according to the received second target password and the second prime order group associated random number, and the pre-stored first reference identity, the first identity, and the first random number; wherein the first reference identity is obtained by hashing the first identity; decrypts the second ciphertext, and when the decryption verification passes, calculates the first session key according to the first intermediate secret value, the first target password, the first prime order group associated random number, the second target password, and the second prime order group associated random number. With this design, the client and the server do not need bilinear pairing operations in the process of establishing the session key, and rely on lightweight operations such as hash operations, so it is simple and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0041] Figure 1 An example diagram of an application scenario of a password-based authentication key negotiation method provided in an embodiment of the present application is shown;
[0042] Figure 2 The flowchart of a password-based authentication key negotiation method provided in an embodiment of the present application is exemplarily shown;
[0043] Figure 3The flowchart of another password-based authentication key negotiation method provided in an embodiment of the present application is exemplarily shown;
[0044] Figure 4 A signaling diagram of a password-based authentication key negotiation method provided in an embodiment of the present application is exemplarily shown;
[0045] Figure 5 The following is a schematic diagram showing the structure of a password-based authentication key negotiation device provided in an embodiment of the present application;
[0046] Figure 6 The following is a schematic diagram showing the structure of another password-based authentication key agreement device provided in an embodiment of the present application;
[0047] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is exemplarily shown. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0049] Among them, "first" represents the relevant concept of the client, and "second" represents the relevant concept of the server. For the convenience of understanding, the concepts involved in the embodiments of the present application are explained as follows:
[0050]
[0051] Password-authenticated key negotiation can be divided into two categories: symmetric password-authenticated key exchange negotiation and asymmetric password-authenticated key exchange negotiation. In a symmetric setting, the client and server authenticate each other by sharing the same password. However, there is a potential problem. For example, if the server is compromised, the other party can obtain the local password database and then use any password to impersonate other users to communicate. In order to reduce the risk of password leakage, the concept of asymmetric password-authenticated key exchange was proposed. It allows the server to store verification elements related to the password instead of the plaintext password. If the verification element is leaked, it will take more time for the other party to recover the password. However, Jarecki pointed out that these asymmetric PAKA schemes may be subject to pre-computation attacks. Since the verification elements in these protocols are generated by converting the password through a deterministic one-way function, and the salt value is publicly transmitted during the key negotiation phase. In this way, the attacker can pre-compute and list the function values of all possible passwords, that is, to establish a table corresponding to all passwords. Once the server is compromised, it will find the password of the corresponding user.
[0052] In order to prevent pre-computation attacks, Jarecki et al. proposed a strong asymmetric PAKA scheme. An inadvertent pseudo-random function is used to generate a password file for the server. During the interaction, the salt value does not need to be transmitted from the server to the user, and the server information leakage will not cause the password to be immediately leaked. Bradley et al. proposed another universal and combinable strong asymmetric PAKA scheme. The algorithm uses a new conditional key encapsulation mechanism and a universal smooth projection hash function as tools. The interaction only involves two message transmissions and avoids hashing operations on the group.
[0053] However, in practical applications, it is very common for passwords to be stored on the client or device. For example, many users allow their browsers to save passwords, and any program running under the same user can access these passwords, which makes them easy targets for malware. Therefore, if the client is hacked, the security of the protocol will be threatened. Although the above-mentioned strong asymmetric password authentication key agreement scheme can resist information leakage attacks and pre-computation attacks, the client will become vulnerable under the above attacks. Therefore, protecting both parties from information leakage attacks and pre-computation attacks is an issue that cannot be ignored. In addition, the asymmetric PAKA protocol is not suitable for all environments.
[0054] In summary, the existing password-based authenticated key agreement protocols still face the following problems: (1) The existing symmetric PAKA protocol has the risk of password leakage; (2) In the existing strong asymmetric PAKA protocol, the client still has pre-computation attacks, and the application of the scheme in an asymmetric environment is limited; (3) Most PAKA protocols do not provide identity privacy protection. Therefore, how to design a symmetric password-authenticated key agreement scheme that protects both parties from information leakage attacks and pre-computation attacks and satisfies identity privacy protection is an issue that deserves close attention.
[0055] To this end, an embodiment of the present application provides a password-based authentication key negotiation method, in which, in the initialization phase, the system sets public parameters. In the password file generation phase, since this phase is in the offline phase, the participating parties calculate the password file in advance. The password file is derived from the password, the salt value and the identity. It contains two elements, one of which is calculated by the password hash and the salt value, and the other is calculated by the salt value hash and the identity of the participating party. In the session key negotiation phase, the interaction between user devices is carried out online. Each user device selects a temporary key, then retrieves its own password file, generates the same temporary secret value through the password file and the temporary key, and then verifies the identities of both parties and generates a shared session key. Such a design provides identity privacy protection and can resist information leakage attacks and pre-calculation attacks.
[0056] After introducing the design ideas of the embodiments of the present application, the following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.
[0057] refer to Figure 1 , shows an application scenario diagram of a password-based authentication key negotiation method, wherein 11 is an electronic device with a client deployed, and 12 is a server. Optionally, in a scenario where the client negotiates a key with the server, the negotiated key can be used to verify the user's access to the client. In addition, the embodiment of the present application can also be applied to two clients for key negotiation, and the negotiated key can be used for data transmission, etc. Figure 1 This is just an example and does not constitute a specific limitation.
[0058] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided in the embodiment of the present application.
[0059] Combine the following Figure 1 The application scenario shown is shown in Figure 2 A flowchart of a password-based authentication key negotiation method is shown, which is applied to a client to illustrate the technical solution provided in an embodiment of the present application.
[0060] S201: The client generates a first target password according to a first random number and a first reference password in a first password file, and generates a first prime order group-associated random number according to the first random number and a generator in a set prime order group.
[0061] The first password file is determined according to the first password, the first identity identifier and the first random salt value associated with the client.
[0062] S202: The client sends the first target password, the first prime order group associated random number and the first timestamp to the server.
[0063] S203: The client receives from the server a second target password generated according to the second reference password and the second random number, a second prime order group-associated random number generated according to the second random number and a generator in a set prime order group, a second timestamp, and a second ciphertext calculated according to the second timestamp, the second reference password and the second random number.
[0064] S204: The client calculates a first intermediate secret value according to the received second target password and the random number associated with the second prime order group, as well as the pre-stored first reference identity, the first identity, and the first random number.
[0065] The first reference identity identifier is obtained by performing a hash calculation on the first identity identifier.
[0066] S205: The client decrypts the second ciphertext, and if the decryption verification is successful, calculates the first session key according to the first intermediate secret value, the first target password, the random number associated with the first prime order group, the second target password, and the random number associated with the second prime order group.
[0067] In the embodiment of the present application, the client generates a first password file according to the associated first password, the first identity identifier and the first random salt value, and then generates a first target password according to the first random number and the first reference password in the first password file, and generates a random number associated with the first prime order group according to the first random number and a generator in the set prime order group. Such a design stores a password file instead of a plaintext password, and the password file includes elements such as passwords, identity identifiers and random salt values. Since the attacker does not know the random salt value, even if the password file is leaked, the protocol can resist pre-calculation attacks and prevent the attacker from obtaining the password. In other words, when the electronic device where the client is located is attacked, it can still protect both parties from the impact of information leakage and pre-calculation attacks. In addition, the client sends the first target password, the first prime order group associated random number and the first timestamp to the server; receives the second target password generated from the server according to the second reference password and the second random number, the second prime order group associated random number generated according to the second random number and a generator in the set prime order group, the second timestamp, and the second ciphertext calculated according to the second timestamp, the second reference password and the second random number; calculates the first intermediate secret value according to the received second target password and the second prime order group associated random number, and the pre-stored first reference identity, the first identity, and the first random number; wherein the first reference identity is obtained by hashing the first identity; decrypts the second ciphertext, and when the decryption verification passes, calculates the first session key according to the first intermediate secret value, the first target password, the first prime order group associated random number, the second target password, and the second prime order group associated random number. With this design, the client and the server do not need bilinear pairing operations in the process of establishing the session key, and rely on lightweight operations such as hash operations, so it is simple and efficient.
[0068] In the description Figure 2 Before the negotiation phase, the initialization phase and the password file generation phase are explained first.
[0069] In the initialization phase, a prime order group is set to be represented by G, the order is represented by q, and g is a generator in the prime order group G. G Denote the unit element in G by G / 1 G Indicates to remove 1 G κ represents a security parameter, p(κ) represents a polynomial in κ and is the length of the session key. Set 4 hash functions as follows: H:{0,1} * →{0,1} p(κ) ; Among them, H, H 1 and H 3 represents the cryptographic hash function modeled as a random oracle, H 2 express - Linear hash function. {0,1} * Represents a string of 0 or 1 bits of any length, {0,1} p(κ) represents a string of 0 or 1 bits of length p(κ); represents any integer less than q.
[0070] In addition, in the embodiment of the present application, the PAKA protocol includes a matching client-server list, allowing the user The identity identifier is ID i , has a password file, which consists of his password pw i , ID i and a private random salt value. For each client-server pair (C A ,S B ), their passwords are equal, namely pw A =pw B .
[0071] During the password file generation phase, client C A Randomly select a salt value, called the first random salt value The first random salt value can randomize the password and hash. Calculate the first reference password Calculate the first reference identity The first password file includes the first reference password hw A and the first reference identity D A .
[0072] During the password file generation phase, client C B Randomly select a salt value, called the second random salt value The second random salt value can randomize the password and hash. Calculate the second reference password Calculate the second reference identifier The second password file includes the second reference password hw B and the second reference identity D B .
[0073] In combination with the above initialization phase and password file generation phase, the negotiation phase is described below.
[0074] When the client detects the operation of inputting a password and an identity, the client can identify the password and the identity indicated by the operation, and retrieve the first password file <File=(hw A ,D A )> to verify the security of the operation. If the password indicated by the operation is the same as the password indicated by the first password file, and the identity identifier of the operation is the same as the identity identifier indicated by the first password file, it is ensured that the current operation is safe.
[0075] This design provides identity privacy protection, and the transmitted data will not leak any identity-related information. Even if the password file is leaked, there is no way to obtain the identity information without knowing the salt value.
[0076] Involving S201, Client C A Pick a random number (first random number) Calculate the first target password Calculate the random number associated with the first prime order group
[0077] Involving S202, Client C A Set the first target password to X A 、The first prime order group associated random number Y A and the first timestamp T A Send to server S B , that is, (X A ,Y A ,T A ) is sent to the server S B .
[0078] Involving S203, server S B Receive from client C A (X A ,Y A ,T A ), can identify the input password and the input identity, and retrieve the second password file <File = (hw B ,D B )> to perform security verification. When the password entered is the same as the password indicated by the first password file, and the identity identifier entered is the same as the identity identifier indicated by the first password file, it is ensured that the current environment is secure.
[0079] ServerS B Randomly select a random number (second random number) Calculate the second target password Calculate the random number associated with the second prime order group ServerS B Check the first timestamp T A Is it fresh, that is, check whether the current time is fresh and the first timestamp T A Is the time difference less than the set time difference threshold? If less than, determine the first timestamp T A Fresh.
[0080] ServerS B The second intermediate secret value is calculated based on the received first target password and the random number associated with the first prime order group, as well as the pre-stored second reference identifier, the second identity identifier, and the second random number. For example, the second intermediate secret value can be calculated using the following formula:
[0081] ServerS B The second ciphertext is calculated according to the second timestamp, the second reference password and the second random number. For example, the second ciphertext can be calculated by the following formula:
[0082] ServerS B The second target password, the second prime order group associated random number, the second timestamp and the second ciphertext are sent to the client, that is, (X B ,Y B ,T B ,E B ) is sent to the client.
[0083] Involving S203, the client receives from the server a second target password generated according to the second reference password and the second random number, a second prime order group associated random number generated according to the second random number and a generator in the set prime order group, a second timestamp, and a second ciphertext calculated according to the second timestamp, the second reference password and the second random number.
[0084] Among them, the client receives (X B ,Y B ,T B ,E B ), it can be verified whether the time is fresh. Exemplarily, it is determined that the time difference between the moment when the second target password, the second prime order group associated random number, the second timestamp and the second ciphertext are received and the time difference between the received second timestamp is less than the set time difference threshold.
[0085] In S204, the client calculates a first intermediate secret value based on the received second target password and the random number associated with the second prime order group, as well as the pre-stored first reference identity, the first identity, and the first random number. For example, the first intermediate secret value can be calculated using the following formula:
[0086] In S205, the client decrypts the second ciphertext. Specifically, when decrypting the second ciphertext, if conditions 1 to 3 are met at the same time, it can be determined that the decryption verification is successful:
[0087] Condition 1: The timestamp obtained by decryption is equal to the second timestamp received.
[0088] The client decrypts the second ciphertext and obtains a decryption result including a timestamp, a random number, and a reference password. In this condition, it is confirmed that the timestamp obtained by decryption is the same as the second timestamp T B equal.
[0089] Condition 2: The prime order group-associated random number calculated based on the decrypted random number is equal to the received second prime order group-associated random number.
[0090] Among them, the client can calculate the prime order group associated random number based on the decrypted random number. In this condition, it is determined that the random number is associated with the second prime order group random number Y B equal.
[0091] Condition 3: The target password calculated based on the decrypted random number and the decrypted reference password is equal to the received second target password
[0092] The client applies the hash function H 2 The decrypted random number and the reference password are calculated to determine the obtained target password and the second target password X B Are they equal?
[0093] When the decryption verification is passed, the client calculates the first session key according to the first intermediate secret value, the first target password, the random number associated with the first prime order group, the second target password, and the random number associated with the second prime order group.
[0094] For example, the client sets the sid A =X A ||Y A ||X B ||Y B , and calculate the first session key K 1 :=H(tk A ||sid A ). In addition, the client calculates the first ciphertext Finally, in order to avoid excessive data storage or subsequent data call errors, the client can delete the intermediate parameters or variables used in the initial stage, password file generation stage, and negotiation stage.
[0095] After receiving the first ciphertext, the server obtains the decryption result including the timestamp, random number and reference password, referring to the judgment process of conditions 1-3 when the client decrypts the second ciphertext. If the decryption verification is passed, the server calculates the second session key according to the second intermediate secret value, the second target password, the random number associated with the second prime order group, the first target password, and the random number associated with the first prime order group.
[0096] For example, the server sets the sid B =X A ||Y A ||X B ||Y B , and calculate the second session key K 2 :=H(tk B ||sid B ). Finally, in order to avoid excessive data storage or subsequent data call errors, the server can delete the intermediate parameters or variables used in the initialization phase, password file generation phase, and negotiation phase.
[0097] refer to Figure 3 A flowchart of a password-based authentication key negotiation method is shown, which is applied to a server to illustrate the technical solution provided in an embodiment of the present application.
[0098] S301: The server receives a first target password, a first prime order group associated random number and a first timestamp from a client.
[0099] S302: The server generates a second target password according to the second random number and the second reference password in the second password file, and generates a second prime order group-associated random number according to the second random number and a generator in a set prime order group.
[0100] The second password file is determined according to the second password, the second identity identifier and the second random salt value associated with the server.
[0101] S303: The server calculates a second intermediate secret value according to the received first target password and the random number associated with the first prime order group, as well as the pre-stored second reference identifier, the second identity identifier, and the second random number.
[0102] The second reference identifier is obtained by performing a hash calculation on the second identity identifier.
[0103] S304: The server calculates a second ciphertext according to the second timestamp, the second reference password and the second random number.
[0104] S305: The server sends the second target password, the second prime order group associated random number, the second timestamp and the second ciphertext to the client.
[0105] S306: The server receives a first ciphertext generated from the client according to the first timestamp, the first target password and the first random number.
[0106] S307: The server decrypts the first ciphertext, and if the decryption verification is successful, calculates a second session key based on the second intermediate secret value, the second target password, the second prime order group associated random number, the first target password, and the first prime order group associated random number.
[0107] In the embodiment of the present application, the transmitted information will not disclose the identity of the participants, so the identity of the participants in the protocol is protected, and symmetric password key negotiation with identity privacy protection is realized. It can protect both parties from information leakage attacks and pre-calculation attacks. In addition, it mainly relies on lightweight operations such as hashing, XOR and a small amount of exponential operations, which is simple and efficient. In addition, the method also has the following advantages: resistance to counterfeiting attacks and replay attacks, forward secrecy, forward security and two-way authentication.
[0108] Before S301, in order to ensure the security of the operating environment, the server determines that the input password is the same as the password indicated by the second password file, and that the input identity is the same as the identity indicated by the second password file.
[0109] Before calculating the second intermediate secret value in S307, the server determines that the time difference between the time of receiving the first target password, the first prime order group associated random number, the first timestamp and the first ciphertext and the first timestamp is less than the set time difference threshold.
[0110] In S307, when decrypting the first ciphertext, if conditions 1 to 3 are met at the same time, it can be determined that the decryption verification is successful:
[0111] Condition 1: The timestamp obtained by decryption is equal to the first timestamp received; and
[0112] Condition 2: The prime order group associated random number calculated based on the decrypted random number is equal to the first prime order group associated random number received; and
[0113] Condition 3: The target password calculated based on the decrypted random number and the decrypted reference password is equal to the received first target password.
[0114] It should be noted that Figure 3 The implementation of each step can be found in Figure 2 The steps are not described here.
[0115] In order to make the technical solution of this application more perfect, Figure 4 A signaling diagram of a password-based authentication key negotiation method provided in an embodiment of the present application, Figure 4 At least the following steps are included:
[0116] S401: The client generates a first password file according to the associated first password, first identity identifier and first random salt value.
[0117] S402: The client generates a first target password according to the first random number and the first reference password in the first password file, and generates a first prime order group-associated random number according to the first random number and a generator in a set prime order group.
[0118] S403: The client sends the first target password, the first prime order group associated random number and the first timestamp to the server.
[0119] S404: The server generates a second password file according to the second password, the second identity identifier and the second random salt value associated with the server.
[0120] S405: The server generates a second target password according to the second random number and the second reference password in the second password file, and generates a second prime order group-associated random number according to the second random number and a generator in the set prime order group.
[0121] S406: The server calculates a second intermediate secret value according to the received first target password and the random number associated with the first prime order group, as well as the pre-stored second reference identifier, the second identity identifier, and the second random number.
[0122] S407: The server calculates a second ciphertext according to the second timestamp, the second reference password and the second random number.
[0123] S408: The server sends the second target password, the second prime order group associated random number, the second timestamp and the second ciphertext to the client.
[0124] S409: The client decrypts the second ciphertext, and if the decryption verification is successful, calculates the first session key based on the first intermediate secret value, the first target password, the random number associated with the first prime order group, the second target password, and the random number associated with the second prime order group.
[0125] S410: The client generates a first ciphertext according to the first timestamp, the first target password and the first random number.
[0126] S411: The client sends the first ciphertext to the server.
[0127] S412: The server decrypts the first ciphertext, and if the decryption verification is successful, calculates a second session key based on the second intermediate secret value, the second target password, the second prime order group associated random number, the first target password, and the first prime order group associated random number.
[0128] It should be noted that the order of the steps is only an example and does not constitute an obvious limitation. For example, the client and the server can generate the password file one after the other or at the same time.
[0129] The embodiments of the present application, from the perspective of functional characteristics and security, the method of the present invention can resist offline password guessing attacks, replay attacks, server leakage attacks, information leakage attacks on both sides and pre-computation attacks, and provides two-way authentication, perfect forward security and identity privacy protection functions. From the perspective of computational overhead, whether in the password file generation stage or the key negotiation stage, this method mainly uses lightweight operations, including a few exponential operations, ordinary hash operations and XOR operations. Compared with the pairing operations and hash operations mapped to points on the group used by most PAKA protocols, this method greatly reduces the amount of calculation and the time consumption of calculation. Therefore, this method has good advantages and practicality in terms of security and computational cost.
[0130] like Figure 5 As shown, based on the same inventive concept, the embodiment of the present application provides a password-based authentication key negotiation device, which is a user client. The device includes a first processing unit 51 and a first transmission unit 52.
[0131] The first processing unit 51 is used to: generate a first target password according to the first random number and the first reference password in the first password file, and generate a first prime order group associated random number according to the first random number and a generator in a set prime order group; wherein the first password file is determined according to the first password associated with the client, the first identity identifier and the first random salt value;
[0132] The first transmission unit 52 is used to send the first target password, the first prime order group associated random number and the first timestamp to the server;
[0133] The first transmission unit 52 is further used to: receive from the server a second target password generated according to the second reference password and the second random number, a second prime order group associated random number generated according to the second random number and a generator in a set prime order group, a second timestamp, and a second ciphertext calculated according to the second timestamp, the second reference password and the second random number;
[0134] The first processing unit 51 is further configured to calculate a first intermediate secret value according to the received second target password and the random number associated with the second prime order group, as well as the pre-stored first reference identity, the first identity, and the first random number; wherein the first reference identity is obtained by performing a hash calculation on the first identity;
[0135] The first processing unit 51 is further used to: decrypt the second ciphertext, and when the decryption verification is passed, calculate the first session key according to the first intermediate secret value, the first target password, the random number associated with the first prime order group, the second target password, and the random number associated with the second prime order group.
[0136] In an optional implementation manner, the first processing unit 51 is specifically configured to, when decrypting the second ciphertext, determine whether the decryption verification is successful by:
[0137] The timestamp obtained by decryption is equal to the second timestamp received; and
[0138] The prime order group associated random number calculated based on the decrypted random number is equal to the received second prime order group associated random number; and
[0139] The target password calculated based on the decrypted random number and the decrypted reference password is equal to the received second target password.
[0140] In an optional implementation manner, before generating the first target password according to the first random number and the first reference password in the first password file, the first processing unit 51 is further configured to:
[0141] In response to the operation of inputting a password and an identity, the client determines that the password indicated by the operation is the same as the password indicated by the first password file, and that the identity indicated by the operation is the same as the identity indicated by the first password file.
[0142] In an optional implementation, before calculating the first intermediate secret value, the first processing unit 51 is further configured to:
[0143] It is determined that the time difference between the moment when the second target password, the second prime order group associated random number, the second timestamp and the second ciphertext are received and the received second timestamp is less than a set time difference threshold.
[0144] Since the device is the device in the method in the embodiment of the present application, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0145] like Figure 6As shown, based on the same inventive concept, the embodiment of the present application provides a password-based authentication key negotiation device, which is applied to a server. The device includes a second transmission unit 61 and a second processing unit 62.
[0146] The second transmission unit 61 is used to: receive a first target password, a first prime order group associated random number and a first timestamp from a client;
[0147] The second processing unit 62 is used to: generate a second target password according to the second random number and the second reference password in the second password file, and generate a second prime order group associated random number according to the second random number and a generator in the set prime order group; wherein the second password file is determined according to the second password associated with the server, the second identity identifier, and the second random salt value;
[0148] The second transmission unit 61 is further used to calculate a second intermediate secret value according to the received first target password and the random number associated with the first prime order group, as well as the pre-stored second reference identifier, the second identity identifier, and the second random number; wherein the second reference identifier is obtained by performing a hash calculation on the second identity identifier;
[0149] The second processing unit 62 is further used to: calculate a second ciphertext according to the second timestamp, the second reference password and the second random number;
[0150] The second transmission unit 61 is further used to: send the second target password, the second prime order group associated random number, the second timestamp and the second ciphertext to the client;
[0151] The second transmission unit 61 is further used to: receive a first ciphertext generated from the client according to the first timestamp, the first target password and the first random number;
[0152] The second processing unit 62 is further used to: decrypt the first ciphertext, and if the decryption verification is passed, calculate the second session key according to the second intermediate secret value, the second target password, the second prime order group associated random number, the first target password, and the first prime order group associated random number
[0153] In an optional implementation manner, the second processing unit 62 is specifically configured to, when decrypting the first ciphertext, determine whether the decryption verification is successful by:
[0154] The timestamp obtained by decryption is equal to the first timestamp received; and
[0155] The prime order group associated random number calculated based on the decrypted random number is equal to the received first prime order group associated random number; and
[0156] The target password calculated according to the decrypted random number and the decrypted reference password is equal to the received first target password.
[0157] In an optional implementation, before generating the second target password according to the second random number and the second reference password in the second password file, the second processing unit 62 is further configured to:
[0158] The server determines that the input password is the same as the password indicated by the second password file, and that the input identity is the same as the identity indicated by the second password file.
[0159] In an optional implementation, before calculating the second intermediate secret value, the second processing unit 62 is further configured to:
[0160] It is determined that a time difference between a time when a first target password, a first prime order group associated random number, a first timestamp, and a first ciphertext are received and the first timestamp is less than a set time difference threshold.
[0161] Since the device is the device in the method in the embodiment of the present application, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0162] Based on the same inventive concept as the above-mentioned password-based authentication key negotiation method, the embodiment of the present application also provides an electronic device, which can be a control device or control system inside a smart device, or an external device that communicates with the smart device, such as a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), a server, etc. For example, if the electronic device is a desktop computer, the client can be deployed on the desktop computer. Figure 7 As shown, the electronic device may include a processor 71 and a memory 72 .
[0163] The processor 71 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and may implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0164] The memory 72 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic memory, disk, optical disk, etc. The memory is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 72 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0165] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; the above computer storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to: mobile storage devices, random access memory (RAM, Random Access Memory), magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO)), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)) and other media that can store program codes.
[0166] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: a mobile storage device, a random access memory (RAM, Random Access Memory), a magnetic storage device (such as a floppy disk, a hard disk, a magnetic tape, a magneto-optical disk (MO), etc.), an optical storage device (such as CD, DVD, BD, HVD, etc.), and a semiconductor memory (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), a solid-state drive (SSD)) and other various media that can store program codes.
[0167] Based on the same inventive concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any of the page switching methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of the page switching method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.
[0168] The above embodiments are only used to introduce the technical solutions of the present application in detail, but the description of the above embodiments is only used to help understand the methods of the embodiments of the present application and should not be understood as limiting the embodiments of the present application. Any changes or substitutions that can be easily thought of by technicians in this technical field should be included in the protection scope of the embodiments of the present application.
Claims
1. A password-based authentication key negotiation method, characterized in that: include: Generate a first target password according to a first random number and a first reference password in a first password file, and generate a first prime order group associated random number according to the first random number and a generator in a set prime order group; wherein the first password file is determined according to a first password associated with the client, a first identity identifier, and a first random salt value; Sending the first target password, the first prime order group associated random number and a first timestamp to a server; Receiving from the server a second target password generated according to a second reference password and a second random number, a second prime order group-associated random number generated according to the second random number and a generator in the set prime order group, a second timestamp, and a second ciphertext calculated according to the second timestamp, the second reference password and the second random number; Calculate a first intermediate secret value according to the received second target password and the random number associated with the second prime order group, as well as the pre-stored first reference identity, the first identity, and the first random number; wherein the first reference identity is obtained by performing a hash calculation on the first identity; Decrypt the second ciphertext, and if the decryption verification passes, calculate the first session key according to the first intermediate secret value, the first target password, the first prime order group associated random number, the second target password, and the second prime order group associated random number.
2. The method according to claim 1, characterized in that The method further includes, when decrypting the second ciphertext, determining that the decryption verification is passed by: The timestamp obtained by decryption is equal to the second timestamp received; and The prime order group associated random number calculated according to the decrypted random number is equal to the second prime order group associated random number received; and The target password calculated based on the decrypted random number and the decrypted reference password is equal to the received second target password.
3. The method according to claim 1, characterized in that Before generating the first target password according to the first random number and the first reference password in the first password file, the method further includes: In response to the operation of inputting a password and an identity, the client determines that the password indicated by the operation is the same as the password indicated by the first password file, and that the identity indicated by the operation is the same as the identity indicated by the first password file.
4. The method according to claim 1, characterized in that: Before calculating the first intermediate secret value, the method further includes: Determine that a time difference between a moment when the second target password, the second prime order group associated random number, the second timestamp, and the second ciphertext are received and the received second timestamp is less than a set time difference threshold.
5. A password-based authentication key negotiation method, characterized in that: include: Receiving a first target password, a first prime order group associated random number, and a first timestamp from a client; Generate a second target password according to the second random number and the second reference password in the second password file, and generate a second prime order group-associated random number according to the second random number and a generator in a set prime order group; wherein the second password file is determined according to the second password associated with the server, the second identity identifier, and the second random salt value; Calculate a second intermediate secret value according to the received first target password and the random number associated with the first prime order group, as well as the pre-stored second reference identifier, the second identity identifier, and the second random number; wherein the second reference identifier is obtained by performing a hash calculation on the second identity identifier; Calculate a second ciphertext according to the second timestamp, the second reference password and the second random number; Sending the second target password, the second prime order group associated random number, the second timestamp and the second ciphertext to the client; Receiving a first ciphertext generated from the client according to the first timestamp, the first target password and the first random number; Decrypt the first ciphertext, and if the decryption verification passes, calculate the second session key according to the second intermediate secret value, the second target password, the second prime order group associated random number, the first target password, and the first prime order group associated random number.
6. The method according to claim 5, characterized in that The method further includes, when decrypting the first ciphertext, determining that the decryption verification is passed by: The timestamp obtained by decryption is equal to the first timestamp received; and The prime order group associated random number calculated according to the decrypted random number is equal to the received first prime order group associated random number; and The target password calculated based on the decrypted random number and the decrypted reference password is equal to the first target password received.
7. The method according to claim 5, characterized in that Before generating the second target password according to the second random number and the second reference password in the second password file, the method further includes: The server determines that the input password is the same as the password indicated by the second password file, and that the input identity is the same as the identity indicated by the second password file.
8. The method according to claim 5, characterized in that Before calculating the second intermediate secret value, the method further includes: It is determined that a time difference between a time when the first target password, the first prime order group associated random number, the first timestamp and the first ciphertext are received and the first timestamp is less than a set time difference threshold.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 and 5 to 8 is implemented.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 4 and 5 to 8 are implemented.
Citation Information
Patent Citations
An identity authentication and key negotiation method and device suitable for mobile application signatures
CN109714167A
Two-factor authentication and key agreement method suitable for low-entropy-rate biological characteristics
CN116668019A
Identity authentication method and apparatus based on SM9 algorithm, and computer device
WO2021143457A1
