A multi-factor authentication method and system based on the national cryptographic SM2 algorithm
By constructing a multi-factor authentication method within the framework of the national cryptographic SM2 algorithm, and combining factors such as user port passwords and biometrics, the ciphertext and signature of registration and authentication messages are generated, solving the problems of high computational overhead and low efficiency in existing technologies, and achieving a balance between security and efficiency.
Patent Information
- Application Number
- CN202510118636.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-01-24
AI Technical Summary
Existing multi-factor authentication schemes rely on foreign cryptographic algorithm standards, resulting in high computational and communication costs, reduced operational efficiency, and failure to meet the national development needs for independent and controllable cyberspace security.
A multi-factor authentication method is constructed based on the national cryptographic SM2 algorithm. By encrypting and signing registration and authentication messages within the framework of the national cryptographic SM2 encryption and signature algorithm, and combining multiple authentication factors such as user port passwords and biometrics, the encrypted registration and authentication messages and signatures are generated to ensure message confidentiality and integrity.
It improves the security and reliability of identity authentication, while reducing computational overhead and increasing the operational efficiency of the authentication scheme.
Smart Images

Figure CN119945675B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of Internet security technology, specifically relating to an authentication method and system based on the national cryptographic algorithm SM2. Background Technology
[0002] Identity authentication is the first line of defense for information system security, effectively preventing unauthorized access. It has been widely deployed and applied in important fields such as smart homes, autonomous driving, and national defense. Identity authentication typically uses three types of information to verify user identity: 1) known information, such as passwords; 2) biometric information, such as iris scans and fingerprints; and 3) physical information held, such as smart cards. Multi-factor authentication uses two or more authentication factors to verify user identity, ensuring security and reliability even if some of these factors are compromised. Current multi-factor authentication schemes often rely on foreign cryptographic algorithm standards, which does not align with the national strategy of independent and controllable cyberspace security. With the increasingly severe international situation, maintaining cyberspace security sovereignty and achieving independent control over core technologies are urgent issues to be addressed. Constructing a multi-factor authentication scheme based on the national cryptographic algorithm SM2 meets the development requirements of independent and controllable core technologies; however, directly deploying the SM2 algorithm would result in expensive computational and communication costs, reducing the scheme's operational efficiency. Therefore, how to construct a multi-factor authentication scheme based on the national cryptographic algorithm SM2 while improving security and ensuring operational efficiency is a critical issue that urgently needs to be addressed. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention aims to propose a multi-factor authentication method and system based on the Chinese national cryptographic algorithm SM2. Within the framework of the SM2 encryption and signature algorithm, a signature-cryptography algorithm based on SM2 is constructed. Registration and authentication messages are simultaneously encrypted and signed, generating ciphertexts of the registration and authentication messages along with a signature. This ensures both the confidentiality and integrity of the messages. Furthermore, by using multiple authentication factors to authenticate the user's identity, the security and reliability of identity authentication are improved.
[0004] To achieve the above-mentioned objectives, the present invention provides the following technical solution:
[0005] In a first aspect, the present invention proposes a multi-factor authentication method based on the national cryptographic SM2 algorithm, characterized by the following process:
[0006] Step S1: Input security parameters from the server to the key generation end, obtain public parameters based on the security parameters received from the server, input user terminal identifier, authentication gateway identifier and server terminal identifier from the user terminal, authentication gateway identifier and server terminal respectively to the key generation end, receive user terminal identifier, authentication gateway identifier and server terminal identifier, and then combine with public parameters to generate user terminal key, authentication gateway key and server terminal key, and output user terminal key, authentication gateway key and server terminal key;
[0007] Step S2: After the user terminal generates the user terminal key from the self-key generation terminal, it receives public parameters, user port password, user terminal identifier, user terminal biometrics, and user terminal key. Based on the public parameters and user terminal key received by the self-key generation terminal, it combines the user port password, user terminal identifier, and user terminal biometrics to generate a user terminal registration request, a user terminal login authentication request, and a session key, and outputs the user terminal registration request.
[0008] Step S3: After receiving the authentication request from the user, the authentication gateway receives the user's registration request, public parameters, and authentication gateway key. Based on the public parameters and authentication gateway key received from the key generator, it generates an authentication gateway registration response and an authentication gateway authentication request, and outputs the authentication gateway registration response.
[0009] Step S4: The user terminal receives the public parameters, the authentication gateway's registration response, and the user terminal's key from the authentication gateway, and outputs the user terminal smart card;
[0010] Step S5: The client receives the client port password, client identifier, client biometrics, client identifier and client key, and outputs a client login authentication request;
[0011] Step S6: The authentication gateway receives the authentication request from the user, the authentication gateway key, and public parameters from the user, and outputs the authentication gateway authentication request.
[0012] Step S7: The server-side authentication gateway receives the authentication request, server-side key, and public parameters from the authentication gateway, generates a server-side authentication response and session key, and outputs the server-side authentication response and session key.
[0013] Step S8: The client receives the server authentication response, client key, and public parameters from the server and outputs the session key.
[0014] In some implementations, step S1 specifically includes the following process:
[0015] Step S1.1: From the security parameter λ on the server side, generate a large prime number p and an elliptic curve E, where |p|=λ, |p| is the absolute value of p. Randomly select a base point of order q on the elliptic curve E to obtain the graphical representation of the base point G=(x G ,y G ),in, Where, x G ,y G Let x and y represent the x and y coordinates of point G, respectively. Let {1,2,…,p-1} be the set of integers 1,2,…,p-1.
[0016] Step S1.2: Select three cryptographic hash functions H1:{0,1} * →{0,1} * , H3:{0,1} * →{0,1} v ;where H1 will {0,1} * The elements on are mapped to {0,1} * Random elements on; H2 will {0,1} * The elements on are mapped to The elements on; H3 will {0,1} * The elements on are mapped to {0,1} v Elements on; {0,1} * This represents a string of arbitrary length, where v represents the length of the session key, {0,1}. v This represents a string of length v; select the fuzzy extraction function (Gen(), Rep()), where Gen() and Rep() extract the strings from {0,1} respectively. * The element mapping is {0,1} * The elements are defined such that the public parameter params = {G,p,H1,H2,H3,Gen(·),Rep(·)};
[0017] Step S1.3: Input the public parameters params={G,p,H1,H2,H3,Gen(·),Rep(·)} and the user terminal identifier ID to the key generation terminal. UE Authentication gateway identifier ID AG and server-side identifier ID SR Random selection Calculate the client key PK UE =d UE G=(x UE ,y UE ), authentication gateway key PK AG =d AG G=(x AG ,yAG ) and server-side key PK SR =d SR G=(x SR ,y SR Output the user terminal key (PK) UE SK UE )=((x UE ,y UE ),d UE ), authentication gateway key (PK) AG SK AG )=((x AG ,y AG ),d AG ) and server key (PK) SR SK SR )=((x SR ,y SR ),d SR Let params = {G, p, H1, H2, H3, PK} UE PK AG PK SR}; where d UE ,d AG ,d SR Let x represent integers randomly selected from the set {1, 2, ..., p-1}; UE ,y UE They represent points d respectively UE The x and y coordinates of G; x AG ,y AG They represent points d respectively AG The x and y coordinates of G; x SR ,y SR They represent points d respectively SR The x-coordinate and y-coordinate of G.
[0018] In some implementations, step S2 specifically includes the following process:
[0019] Step S2.1: The user terminal receives the user terminal key (PK). UE SK UE After defining the fuzzy extraction function (Gen, Rep) and the public parameters params, the biometric features are mapped to... Elements on;
[0020] Step S2.2: Perform fuzzy extraction of user-side biometric features (Gen(BIO)) on the user end. UE )=(σ UE ,θ UE User port command hash password HPWUE =H1(PW UE ||σ UE User-side identifier hash password MID UE =H1(ID) UE ||σ UE ) calculate, where σ UE Biometrics (BIO) UE The secret string θ is obtained after being processed by the fuzzy extraction function Gen(·). UE Biometrics (BIO) UE The public string obtained after calculation using the fuzzy extraction function Gen(·); PW UE ||σ UE The password is PW UE With secret string σ UE The value after cascading operations, HPW UE PW UE ||σ UE The hash value obtained after hashing using hash function H1, ID UE ||σ UE Indicates the identifier ID UE With secret string σ UE Cascaded operation; MID UE Indicates ID UE ||σ UE The hash value obtained after hashing with hash function H1; ∥ indicates a concatenation operation;
[0021] Step S2.3: Randomly select Y UE ∈{0,1} * , Let M1 = Y UE ||MID UE ||HPW UE Calculate e1 = H3(M1, r1), C1 = r1G = (x1, y1), k1 = (e1 + x1) mod p, s1 = (1 + d UE ) -1 (r1-k1d UE )mod p,r1PK AG =(x A1 ,y A1 ), t1=H2(x A1 ||y A1 ,p), Where T1 represents the current timestamp; let CT1 = C1||C2||C3, MT1 = {CT1,k1,s1,T1}; where Y UE This indicates that from the set {0,1} *Any string of any length randomly selected from the set, r1 represents the string from the set. A randomly selected integer, M1, represents Y. UE MID UE and HPW UE After the cascaded operation, e1 represents the value of M1 and r1 after the hash function H3, C1 represents a point on the elliptic curve, x1 and y1 represent the x and y coordinates of point C1 respectively, k1 represents the sum of e1 and x1 after modulo p, and s1 represents the sum of 1 and d. UE The inverse element of the sum and (r1-k1d) UE The value of x after multiplication and modulo p operation A1 ,y A1 Representing points r1 and pk respectively AG The x and y coordinates, where t1 represents x. A1 and y A1 The concatenated value of M1 and T1 is the value obtained after hashing p with the hash function H2. C2 represents the value obtained after XORing the concatenated value of M1 and T1 with t1. H2(x A1 ||M1||y A1 ) represents x A1 M1 and y A1 C3 represents the hash value H2(x) after the concatenated operation value has been processed by the hash function H2. A1 ||M1||y A1 The value obtained by XORing C1 and e1, where CT1 represents the value obtained by cascading C1, C2, and C3. `x` represents the XOR operation, and `mod` represents the modulo operation.
[0022] In some implementations, step S3 specifically includes the following process:
[0023] Step S3.1: The authentication gateway receives the user's registration request MT1 and the authentication gateway key (PK). AG SK AG ) and public parameters params;
[0024] Step S3.2: Verify the freshness of T1 through the authentication gateway; if T1 does not meet the freshness requirement, the authentication gateway rejects the user's registration request MT1; otherwise, calculate d. AG C1=(x A1 ,y A1 ), t1=H2(x A1 ||y A1 ,p), w1=(k1+s1)mod p,(x1,y1)=s1G+w1PK UE , where t1 represents xA1 The concatenated value of M1 and the hash value of p after being processed by the hash function H2, where e1 represents the hash value H2(x) A1 ||M1||y A1 The value of C1 and C3 after XOR operation, w1 represents the value of the sum of k1 and s1 modulo p, and (x1, y1) represents the point s1G+w1PK. UE The x and y coordinates;
[0025] Step S3.3: Verify whether the equation k1 = (e1 + x1) mod p holds true through the authentication gateway. If the equation holds true, then {M1, k1, s1} is successfully restored. The authentication gateway randomly selects a. UE ,PID UE ∈{0,1} * , calculate Among them, a UE ,PID UE They represent the sets {0,1} respectively. * A string of arbitrary length randomly selected from the set, where r2 represents the string from the set. A randomly selected integer, H1(MID) UE ) indicates MID UE The hash value after hashing by hash function H1, H1(HPW) UE ) indicates HPW UE The hash value after hashing with hash function H1, CR1 represents the hash value H1(MID). UE ) and hash value H1 (HPW UE After XOR operation and modulo n p The value after the operation is processed again by the hash function H1, and CR2 represents a. UE The value obtained by XORing CR1;
[0026] Step S3.4: Create an identifier (MID) through the authentication gateway. UE List UE ={MID UE ,a UE Honeyword = {}}, let M2 = CR1||CR2, and randomly select... Calculate e2 = H3(M2, r3), C4 = r3G = (x2, y2), k2 = (e2 + x2) mod p, s2 = (1 + d AG ) -1 (r3-k2d AG )mod p,r3PK UE =(x U1 ,y U1), t2=H2(x U1 ||y U1 ,p), Where T2 represents the current timestamp; let CT2 = C4||C5||C6, MT2 = {CT2,k2,s2,T2}, where M2 represents the value of CR1 and CR2 after the concatenation operation, and r3 represents the value from set A randomly selected integer, e2 represents the value of M2 and r3 after hash function H3, x2 and y2 represent the x and y coordinates of point C4 respectively, k2 represents the value of the sum of e2 and x2 modulo p, and s2 represents the sum of 1 and d. AG The inverse element of the sum and (r1-k1d) UE The value of x after multiplication and modulo p operation U1 ,y U1 Represents point r3PK UE The x and y coordinates, t2 represents x U1 With y U1 The concatenated value of M1 and T2 and the hash value of p after hash function H2, C5 represents the value of the concatenated value of M1 and T2 and the XOR operation of t2, H2(x U1 ||M2||y U1 ) represents x U1 M2 and y U1 The concatenated operation value is the result of the hash function H2, where C6 represents the hash value H2(x). A1 ||M1||y A1 CT2 represents the value of C4, C5, and C6 after XOR operation with e2.
[0027] In some implementations, step S4 specifically includes the following process:
[0028] Step S4.1: The client receives the authentication gateway's registration response MT2, public parameters params, and the client key (PK). UE SK UE );
[0029] Step S4.2: Verify the freshness of T2 through the client. If T2 does not meet the freshness requirement, the client rejects the registration response; otherwise, calculate d. UE C4=(x U1 ,y U1 ), t2=H2(x U1 ||y U1 ,p), w2=(k2+s2)mod p,(x2,y2)=s2G+w2PK AG , where x U1,y U1 They represent points d respectively UE C4 has x and y coordinates, and t2 represents x. U1 With y U1 The concatenated operation value of p and the hash value after hashing by the hash function H2, M2||T2 represents the value after XORing C5 and t2, H2(x U1 ||M2||y U1 ) represents x U1 M2 and y U1 The concatenated operation value is the result of the hash function H2, where e2 represents the hash value H2(x). U1 ||M2||y U1 The value obtained by XORing C2 and C6, w2 represents the sum of k2 and s2 modulo p, and x2 and y2 represent the points s2G+w2PK. AG The x and y coordinates;
[0030] Step S4.3: The user terminal verifies whether the equation k2 = (e2 + x2) mod p is true. If the equation is true, then M2 is successfully recovered, and the user terminal calculates... Let SC UE ={M2,N UE ,θ UE ,Gen(·),Rep(·)}, where k1 represents the sum of e2 and x2 modulo p, M2 represents the message transmitted from the authentication gateway to the user, and H1(HPW UE ||ID UE ||σ UE ) indicates HPW UE ID UE With σ UE The value of N after the concatenation operation is processed by the hash function H1 UE MID UE With hash value H1(HPW UE ||ID UE ||σ UE The value after XOR operation, θ UE Biometrics (BIO) UE The public string obtained after calculation by the fuzzy extraction function Gen(·), where Gen(·) and Rep(·) represent the fuzzy extraction function, SC UE This indicates the user's smart card identifier.
[0031] In some implementations, step S5 specifically includes the following process:
[0032] Step S5.1: The user terminal receives the user terminal identifier ID. UE ∈{0,1} * User port command PWUE ∈{0,1} * User-side biometrics (BIO) UE ∈{0,1} * User-side smart card identifier SC UE User terminal key (PK) UE SK UE ) and public parameters params;
[0033] Step S5.2: Calculate σ via the user terminal. UE =Rep(BIO UE ,θ UE HPW UE =H1(PW UE ||σ UE ), Where, δ UE Biometrics (BIO) UE The secret string obtained after calculation using the fuzzy extraction function Rep(·), HPW UE PW UE With σ UE The concatenated operation value is the value after being processed by the hash function H1, H1(HPW) UE |‖ID UE ||σ UE ) indicates HPW UE ID UE and σ UE The value of the concatenated operation is the result of the hash function H1, MID. UE Indicates smart card parameter N UE With hash value H1(HPW UE ||ID UE ||σ UE The value after XOR operation, H1(MID) UE ) indicates MID UE The hash value after hashing by hash function H1, H1(HPW) UE ) indicates HPW UE The hash value after hashing with hash function H1 H1 represents the hash value (MID) UE ) and hash value H1 (HPW UE After XOR operation and modulo n p The value obtained after the operation is processed again by the hash function H1.
[0034] Step S5.3: User-side verification equation If the conditions are not met, the login request is rejected; otherwise, the client randomly selects a user. Let M3 = MID UE||r3||ID SR Where r3 represents from set M3 represents MID, which is a randomly selected integer. UE r3 and ID SR The value after cascading operation;
[0035] Step S5.4: The user side calculates e3 = H3(M3, r3), C7 = r3G = (x3, y3), k3 = (e3 + x3) mod p, s3 = (1 + d UE ) -1 (r3-k3d UE )mod p,r3PK AG =(x A2 ,y A2 ), t3=H2(x A2 ||y A2 ,p), Where T3 represents the current timestamp; let CT3 = C7||C8||C9, MT3 = {CT3,k3,s3,T3}; where e3 represents the value of M3 and r3 after hash function H3, x3 and y3 represent the x and y coordinates of point C7 respectively, k3 represents the value of the sum of e3 and x3 after modulo p, and s3 represents the sum of 1 and d. UE The inverse element of the sum and (r3-k3d) UE The value of x after multiplication and modulo p operation A2 ,y A2 Represents point r3PK AG The x and y coordinates, t3 represents x A2 With y A2 The concatenated value of M3 and T3 and the hash value of p after hash function H2, C8 represents the value of the concatenated value of M3 and T3 and t3 after XOR operation, H2(x A2 ||M3||y A2 ) represents x A2 M3 and y A2 The concatenated operation value is the result of the hash function H2, where C9 represents the hash value H2(x). A2 ||M3||y A2 The value after XORing e3, CT3 represents the value after cascading C7, C8 and C9, and MT3 represents the set composed of CT3, k3, s3 and T3.
[0036] In some implementations, step S6 specifically includes the following process:
[0037] Step S6.1: The authentication gateway receives the user's authentication request MT3 and the authentication gateway key (PK). AG SK AG ), public parameter params;
[0038] Step S6.2: The authentication gateway verifies whether T3 is fresh. If T3 does not meet the freshness requirement, the authentication gateway rejects the client's authentication request; otherwise, it calculates d. AG C7=(x A2 ,y A2 ), t3=H2(x A2 ||y A2 ,p), w3=(k3+s3)mod p,(x3,y3)=s3G+w3PK UE , where x A2 ,y A2 They represent points d respectively AG The x and y coordinates of C7, where t3 represents x. A2 With y A2 The concatenated operation value of and the hash value of p after hash function H2, M3||T3 represents the value after XOR operation of C8 and t3, H2(x A2 ||M3||y A2 ) represents x A2 M3 and y A2 The concatenated operation value is the result of the hash function H2, where e3 represents the hash value H2(x). A2 ||M3||y A2 The value obtained by XORing C and C9, w3 represents the sum of k3 and s3 modulo p, and x3 and y3 represent the point s2G+w2PK. AG The x and y coordinates;
[0039] Step S6.3: The authentication gateway verifies whether the equation k3 = (e3 + x3) mod p is true. If it is not true, the authentication request is rejected; otherwise, the authentication gateway successfully recovers M3, where k3 represents the sum of e3 and x3 modulo p, and M3 represents the message transmitted from the user to the authentication gateway.
[0040] Step S6.4: The authentication gateway randomly selects... Let M4 = MID UE ||r4||ID SR Calculate e4 = H3(M4, r4), C 10 =r4G=(x4,y4), k4=(e4+x4)mod p, s4=(1+d AG ) -1 (r4-k4dAG )mod p,r4PK SR =(x S1 ,y S1 ), t4=H2(x S1 ||y S1 ,p), Where T4 represents the current timestamp; let CT4 = C 10 |‖C 11 ||C 12 MT4 = {CT4, k4, s4, T4}; where r4 represents the value from set M4 represents a randomly selected integer, where M is the MID. UE r4 and ID SR After the cascading operation, e4 represents the value of M4 and r4 after the hash function H3, and x4 and y4 represent the values of point C. 10 The x and y coordinates are given, k4 represents the sum of e4 and x4 modulo p, and s4 represents the sum of 1 and d. AG The inverse of the sum and (r⁴-k⁴d) AG The value of x after multiplication and modulo p operation S1 ,y S1 Represents point r4PK SR The x and y coordinates, t4 represents x S1 With y S1 The concatenated operation value of C and the hash value of p after hash function H2 operation, C 11 H2(x) represents the value obtained by XORing the cascaded values of M4 and T4 with t4. S1 ||M4||y S1 ) represents x S1 M4 and y S1 The value of C after concatenation and hashing using the H2 function is 12 H2(x) represents the hash value S1 ||M4||y S1 The value obtained by XORing C with e4, CT4 represents C. 10 C 11 And C 12 After the cascading operation, MT4 represents the set consisting of CT4, k4, s4, and T4.
[0041] In some implementations, step S7 specifically includes the following process:
[0042] Step S7.1: The server receives the authentication request MT4 from the authentication gateway, along with the server-side key (PK). SR SK SR ), and the common parameter params;
[0043] Step S7.2: The server verifies whether T3 is fresh. If T3 does not meet the freshness requirement, the server rejects the authentication request from the authentication gateway; otherwise, it calculates d. SR C 10 =(x S1 ,y S1 ), t4=H2(x S1 ||y S1 ,p), w4=(k4+s4)mod p,(x4,y4)=s4G+w4PK AG , where x S1 ,y S1 They represent points d respectively SR C 10 The x and y coordinates, t4 represents x S1 With y S1 The concatenated operation value of C and the hash value of p after hash function H2, M4||T4 represent C 11 The value of H2(x) after XOR operation with t4 S1 ||M4||y S1 ) represents x S1 M4 and y S1 The concatenated operation value is the result of the hash function H2, where e4 represents the hash value H2(x). S1 |‖M4‖|y S1 ) and C 12 After the XOR operation, w4 represents the sum of k4 and s4 modulo p, and x4 and y4 represent the point s2G+w2PK. AG The x and y coordinates;
[0044] Step S7.3: The server verifies whether the equation k4 = (e4 + x4) mod p is true. If it is not true, the authentication request is rejected; otherwise, the server successfully recovers M4, where k4 represents the sum of e4 and x4 modulo p, and M4 represents the message transmitted from the authentication gateway to the server.
[0045] Step S7.4: Randomly selected by the server. Let M5 = MID UE ||r5||ID SR Calculate e5 = H3(M5, r5), C 13 =r5G=(x5,y5), k5=(e5+x5)modp, s5=(1+d SR ) -1 (r5-k5d SR )mod p,r5PK UE=(x U2 ,y U2 ), t5=H2(x U2 ||y U2 ,p), Where T5 represents the current timestamp, and r5 represents the timestamp from the set. M5 represents MID, which is a randomly selected integer. UE r5 and ID SR After the cascading operation, e5 represents the value of M5 and r5 after the hash function H3, and x5 and y5 represent point C respectively. 13 The x and y coordinates are given, k5 represents the sum of e5 and x5 modulo p, and s5 represents the sum of 1 and d. SR The inverse element of the sum and (r5-k5d) SR The value of x after multiplication and modulo p operation U2 ,y U2 Represents point r5PK UE The x and y coordinates, t5 represents x U2 With y U2 The concatenated operation value of C and the hash value of p after hash function H2 operation, C 14 H2(x) represents the value obtained by XORing the cascaded values of M5 and T5 with t5. U2 ||M5||y U2 ) represents x U2 M5 and y U2 The value of the cascade operation is the result of the hash function H2, C 15 H2(x) represents the hash value U2 ||M5||y U2 The value obtained by XORing e5 with e5;
[0046] Step S7.5: Calculate the session key SK = H1(r3||r5||ID) via the server. SR ||MID UE (p), let CT5 = C 13 ||C 14 ||C 15 MT5 = {CT5, k5, s5, T5}, where CT5 represents C 13 C 14 And C 15 After the cascading operation, MT5 represents the set consisting of CT5, k5, s5, and T5.
[0047] In some implementations, step S8 specifically includes the following process:
[0048] Step S8.1: The user terminal receives the server's authentication response MT5 and the user terminal key (PK). UE SK UE ), and public parameters params;
[0049] Step S8.2: The client verifies the freshness of T5: If T5 does not meet the freshness requirement, the client rejects the server's authentication response; otherwise, calculate d. UE C 13 =(x U2 ,y U2 ), t5=H2(x U2 ||y U2 ,p), w5=(k5+s5)mod p,(x5,y5)=s5G+w5PK SR , where x U2 ,y U2 They represent points d respectively UE C 13 The x and y coordinates, t5 represents x U2 With y U2 The concatenated operation value of C and the hash value of p after hash function H2, M5||T5 represents C 14 The value of H2(x) after XOR operation with t5 U2 |‖M5‖|y U2 ) represents x U2 M5 and y U2 The concatenated operation value is the result of the hash function H2, where e5 represents the hash value H2(x). U2 |‖M5‖|y U2 ) and C 15 After the XOR operation, w5 represents the sum of k5 and s5 modulo p, and x5 and y5 represent the point s5G+w5PK. SR The x and y coordinates;
[0050] Step S8.3: The client verifies whether the equation k5 = (e5 + x5) mod p is true. If the equation is true, message M5 is successfully recovered. The client calculates the session key SK = H1(r3||r5||ID). SR ||MID UE ,p), where k5 represents the sum of e5 and x5 modulo p, and M5 represents the message transmitted from the server to the user.
[0051] Secondly, this invention proposes a multi-factor authentication system based on the Chinese national cryptographic SM2 algorithm, realizing a multi-factor authentication method based on the Chinese national cryptographic SM2 algorithm. The system includes a key generation terminal, a user terminal, an authentication gateway terminal, and a server terminal connected to the network; the key generation terminal and the user terminal are respectively connected to the server terminal, the server terminal is connected to the authentication gateway terminal, and the user terminal is connected to the authentication gateway terminal.
[0052] The key generation terminal is used to obtain public parameters based on the security parameters received from the server, and to receive the user terminal identifier, authentication gateway identifier, and server identifier from the user terminal, authentication gateway identifier, and server identifier respectively. It then combines these with the public parameters to generate and output the user terminal key, authentication gateway key, and server key. Specifically, the user terminal key consists of the public parameters and the user terminal identifier, the authentication gateway key consists of the public parameters and the authentication gateway identifier, and the server key consists of the public parameters and the server identifier.
[0053] The user terminal, upon receiving the server-side authentication response from the server, combines the publicly available parameters received from the key generator with the user terminal key, user port password, user terminal identifier, and user terminal biometrics to generate and output a user terminal registration request, a user terminal smart card, a user terminal login authentication request, and a session key, and then outputs them. Specifically, the user terminal registration request consists of the user terminal identifier, user port password, user terminal biometrics, user terminal key, and publicly available parameters; the user terminal smart card consists of the authentication gateway registration response, the user terminal key, and publicly available parameters; the user terminal login authentication request consists of the user terminal identifier, user port password, user terminal biometrics, user terminal key, user terminal smart card, and publicly available parameters; and the session key consists of publicly available parameters, the server-side authentication response, and the user terminal key.
[0054] The server is configured to generate and output a server-side authentication response and a session key after receiving the authentication request, server-side key, and public parameters from the authentication gateway. Specifically, the server-side authentication response consists of at least the authentication request, server-side key, and public parameters; the session key consists of public parameters, the server-side authentication response, and the user-side key.
[0055] The authentication gateway is used to generate and output an authentication gateway registration response and an authentication gateway authentication request based on the public parameters received from the key generator and the authentication gateway key after receiving the user client authentication request from the user client. Specifically, the authentication gateway registration response consists of the user client registration request, the authentication gateway key, and the public parameters, and the authentication gateway authentication request consists of the user client authentication request, the authentication gateway key, and the public parameters.
[0056] Compared to existing technologies, the advantages of this application are:
[0057] 1) The key generation end, user end, authentication gateway end and server end based on network connection use SM2 signature encryption algorithm to implement multi-factor authentication, which ensures the confidentiality and integrity of messages and reduces computational overhead.
[0058] 2) The session key is generated simultaneously on both the user end and the server end, which is beneficial for communication between the user end and the server end. Attached Figure Description
[0059] Figure 1 This is an overall flowchart of a multi-factor authentication method based on the national cryptographic standard SM2 of the present invention;
[0060] Figure 2 This is a diagram illustrating the architecture of a multi-factor authentication system based on the national cryptographic standard SM2 according to the present invention.
[0061] Figure 3 This is an algorithm block diagram of an embodiment of a multi-factor authentication system and method based on the national cryptographic standard SM2 of the present invention. Detailed Implementation
[0062] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0063] like Figure 1 As shown, the multi-factor authentication method based on the national cryptographic standard SM2 of the present invention specifically includes the following process:
[0064] Step S1: Input security parameters to the key generator, receive the security parameters through the key generator to output public parameters, input the public parameters, user terminal identifier, authentication gateway identifier, and server identifier to the key generator again, generate and output the user terminal key, authentication gateway key, and server key, and generate the user terminal key (PK) through the key generator. UE SK UE ), authentication gateway key (PK) AG SK AG ) and server key (PK) SR SK SR Specifically, the user-side key (PK) UE SK UE It must consist of at least the public parameter params and the client identifier ID. UE Composition, the authentication gateway key (PK) AG SK AG It must consist of at least the public parameter params and the authentication gateway identifier ID. AG Composition, the server-side key (PK)SR SK SR It must consist of at least the public parameter params and the server-side identifier ID. SR The composition; furthermore, the generated public parameters params are at least composed of security parameters λ; where λ represents the bit length of the system input value; step S1 specifically includes the following steps:
[0065] Step S1.1: The key generator receives the security parameter λ from the server, generates a large prime number p and an elliptic curve E, where |p|=λ, and |p| is the absolute value of p. A base point of order q is randomly selected on the elliptic curve E to obtain the graphical representation of the base point G=(x G ,y G ),in, Where, x G ,y G Let x and y represent the x and y coordinates of point G, respectively. Let x represent the set {1,2,…,p-1} consisting of integers 1,2,…,p-1. G ,y G Let G represent the x-coordinate and y-coordinate of point G, respectively. Let {1,2,…,p-1} be the set of integers 1,2,…,p-1.
[0066] Step S1.2: The key generator selects three cryptographic hash functions H1:{0,1}. * →{0,1} * , H3:{0,1} * →{0,1} v ;where H1 will {0,1} * The elements on are mapped to {0,1} * Random elements on; H2 will {0,1} * The elements on are mapped to The elements on; H3 will {0,1} * The elements on are mapped to {0,1} v Elements on; {0,1} * This represents a string of arbitrary length, where v represents the length of the session key, {0,1}. v This represents a string of length v; select the fuzzy extraction function (Gen(), Rep()), where Gen() and Rep() extract the strings from {0,1} respectively. * The element mapping is {0,1} * The elements. Let the public parameter params = {G,p,H1,H2,H3,Gen(·),Rep(·)};
[0067] Step S1.3: Input the public parameters params={G,p,H1,H2,H3,Gen(·),Rep(·)} and the user terminal identifier ID to the key generation terminal. UE Authentication gateway identifier ID AG and server-side identifier ID SR Random selection Calculate the client key PK UE =d UE G=(x UE ,y UE ), authentication gateway key PK AG =d AG G=(x AG ,y AG ) and server-side key PK SR =d SR G=(x SR ,y SR Output the user terminal key (PK) UE SK UE )=((x UE ,y UE ),d UE ), authentication gateway key (PK) AG SK AG )=((x AG ,y AG ),d AG ) and server key (PK) SR SK SR )=((x SR ,y SR ),d SR Let params = {G, p, H1, H2, H3, PK} UE PK AG PK SR}; where d UE ,d AG ,d SR Let x represent integers randomly selected from the set {1, 2, ..., p-1}; UE ,y UE They represent points d respectively UE The x and y coordinates of G; x AG ,y AG They represent points d respectively AG The x and y coordinates of G; x SR ,y SR They represent points d respectively SR The x and y coordinates of G;
[0068] Step S1.4: Output the public parameters params={G,p,H1,H2,H3,Gen(·),Rep(·)} and the user key (PK) to the user terminal through the key generator. UE SK UE ), authentication gateway key (PK) AG SK AG ) and server key (PK) SR SK SR );
[0069] Step S2: Receive the public parameters params and the client key (PK) via the client. UE SK UE After that, a client registration request MT1 is output to the authentication gateway; specifically, the client key (PK) UE SK UE It must contain at least the user's identifier ID. UE ∈{0,1} * User port command PW UE ∈{0,1} * and user-side biometrics BIO UE ∈{0,1} * Step S2 specifically includes the following steps:
[0070] Step S2.1: The user terminal receives the user terminal key (PK). UE SK UE After defining the fuzzy extraction function (Gen, Rep) and the public parameters params, the biometric features are mapped to... The elements on; the aforementioned user key (PK) UE SK UE It must contain at least the user's identifier ID. UE ∈{0,1} * User port command PW UE ∈{0,1} * User-side biometrics (BIO) UE ∈{0,1} * ;
[0071] Step S2.2: Perform fuzzy extraction of user-side biometric features (Gen(BIO)) on the user end. UE )=(σ UE ,θ UE User port command hash password HPW UE =H1(PW UE ||σ UE User-side identifier hash password MID UE =H1(ID)UE ||σ UE ) calculate, where σ UE Biometrics (BIO) UE The secret string θ is obtained after being processed by the fuzzy extraction function Gen(·). UE Biometrics (BIO) UE The public string obtained after calculation using the fuzzy extraction function Gen(·); PW UE ||σ UE The password is PW UE With secret string σ UE The value after cascading operations, HPW UE PW UE ||σ UE The hash value obtained after hashing using hash function H1, ID UE ||σ UE Indicates the identifier ID UE With secret string σ UE Cascaded operation; MID UE Indicates ID UE ||σ UE The hash value obtained after hashing with hash function H1; ∥ indicates a concatenation operation;
[0072] Step S2.3: Randomly select Y UE ∈{0,1} * , Let M1 = Y UE ||MID UE ||HPW UE Calculate e1 = H3(M1, r1), C1 = r1G = (x1, y1), k1 = (e1 + x1) mod p, s1 = (1 + d UE ) -1 (r1-k1d UE )mod p,r1PK AG =(x A1 ,y A1 ), t1=H2(x A1 ||y A1 ,p), Where T1 represents the current timestamp; let CT1 = C1||C2||C3, MT1 = {CT1,k1,s1,T1}; where Y UE This indicates that from the set {0,1} * Any string of any length randomly selected from the set, r1 represents the string from the set. A randomly selected integer, M1, represents Y. UE MID UE and HPWUE After the cascaded operation, e1 represents the value of M1 and r1 after the hash function H3, C1 represents a point on the elliptic curve, x1 and y1 represent the x and y coordinates of point C1 respectively, k1 represents the sum of e1 and x1 after modulo p, and s1 represents the sum of 1 and d. UE The inverse element of the sum and (r1-k1d) UE The value of x after multiplication and modulo p operation A1 ,y A1 Representing points r1 and pk respectively AG The x and y coordinates, where t1 represents x. A1 and y A1 The concatenated value of M1 and T1 is the value obtained after hashing p with the hash function H2. C2 represents the value obtained after XORing the concatenated value of M1 and T1 with t1. H2(x A1 ||M1||y A1 ) represents x A1 M1 and y A1 C3 represents the hash value H2(x) after the concatenated operation value has been processed by the hash function H2. A1 ||M1||y A1 The value obtained by XORing C1 and e1, where CT1 represents the value obtained by cascading C1, C2, and C3. The XOR operation is represented by `XOR`, and the mod operation is represented by `mod`.
[0073] Step S2.3: The user terminal outputs the user terminal registration request MT1 and the authentication gateway key (PK) to the authentication gateway. AG SK AG ) and public parameters params;
[0074] Step S3: Receive the user registration request MT1 and the authentication gateway key (PK) through the authentication gateway. AG SK AG After displaying the public parameters (params), the authentication gateway registration response MT2 is output to the user terminal; step S3 specifically includes the following steps:
[0075] Step S3.1: The authentication gateway receives the user's registration request MT1 and the authentication gateway key (PK). AG SK AG ) and public parameters params;
[0076] Step S3.2: Verify the freshness of T1 through the authentication gateway; if T1 does not meet the freshness requirement, the authentication gateway rejects the user's registration request MT1; otherwise, calculate d. AG C1=(x A1 ,y A1 ), t1=H2(xA1 ||y A1 ,p), w1=(k1+s1)mod p,(x1,y1)=s1G+w1PK UE , where t1 represents x A1 The concatenated value of M1 and the hash value of p after being processed by the hash function H2, where e1 represents the hash value H2(x) A1 ||M1||y A1 The value of C1 and C3 after XOR operation, w1 represents the value of the sum of k1 and s1 modulo p, and (x1, y1) represents the point s1G+w1PK. UE The x and y coordinates;
[0077] Step S3.3: Verify whether the equation k1 = (e1 + x1) mod p holds true through the authentication gateway. If the equation holds true, then {M1, k1, s1} is successfully restored. The authentication gateway randomly selects a. UE ,PID UE ∈{0,1} * , calculate Among them, a UE ,PID UE They represent the sets {0,1} respectively. * A string of arbitrary length randomly selected from the set, where r2 represents the string from the set. A randomly selected integer, H1(MID) UE ) indicates MID UE The hash value after hashing by hash function H1, H1(HPW) UE ) indicates HPW UE The hash value after hashing with hash function H1, CR1 represents the hash value H1(MID). UE ) and hash value H1 (HPW UE After XOR operation and modulo n p The value after the operation is processed again by the hash function H1, and CR2 represents a. UE The value obtained by XORing CR1;
[0078] Step S3.4: Create an identifier (MID) through the authentication gateway. UE List UE ={MID UE ,a UE Honeyword = {}}, let M2 = CR1||CR2, and randomly select... Calculate e2 = H3(M2, r3), C4 = r3G = (x2, y2), k2 = (e2 + x2) mod p, s2 = (1 + d AG ) -1 (r3-k2d AG )mod p,r3PK UE =(x U1 ,y U1 ), t2=H2(x U1 ||y U1 ,p), Where T2 represents the current timestamp; let CT2 = C4||C5||C6, MT2 = {CT2,k2,s2,T2}, where M2 represents the value of CR1 and CR2 after the concatenation operation, and r3 represents the value from set A randomly selected integer, e2 represents the value of M2 and r3 after hash function H3, x2 and y2 represent the x and y coordinates of point C4 respectively, k2 represents the value of the sum of e2 and x2 modulo p, and s2 represents the sum of 1 and d. AG The inverse element of the sum and (r1-k1d) UE The value of x after multiplication and modulo p operation U1 ,y U1 Represents point r3PK UE The x and y coordinates, t2 represents x U1 With y U1 The concatenated value of M1 and T2 and the hash value of p after hash function H2, C5 represents the value of the concatenated value of M1 and T2 and the XOR operation of t2, H2(x U1 ||M2||y U1 ) represents x U1 M2 and y U1 The concatenated operation value is the result of the hash function H2, where C6 represents the hash value H2(x). A1 ||M1||y A1 The value obtained by XORing C4, C5, and C6 with e2, and CT2 represents the value obtained by cascading C4, C5, and C6.
[0079] Step S3.5: The authentication gateway outputs the authentication gateway registration response MT2 and the user key (PK) to the user terminal. UE SK UE ) and public parameters params;
[0080] Step S4: Receive the public parameters params, the authentication gateway registration response MT2, and the user key (PK) via the user terminal. UE SK UE After that, output the user terminal smart card SC. UE(The user terminal device is, for example, a smart card); Step S4 specifically includes the following steps:
[0081] Step S4.1: The client receives the authentication gateway's registration response MT2, public parameters params, and the client key (PK). UE SK UE );
[0082] Step S4.2: Verify the freshness of T2 through the client. If T2 does not meet the freshness requirement, the client rejects the registration response; otherwise, calculate d. UE C4=(x U1 ,y U1 ), t2=H2(x U1 ||y U1 ,p), w2=(k2+s2)mod p,(x2,y2)=s2G+w2PK AG , where x U1 ,y U1 They represent points d respectively UE C4 has x and y coordinates, and t2 represents x. U1 With y U1 The concatenated operation value of p and the hash value after hashing by the hash function H2, M2||T2 represents the value after XORing C5 and t2, H2(x U1 ||M2||y U1 ) represents x U1 M2 and y U1 The concatenated operation value is the result of the hash function H2, where e2 represents the hash value H2(x). U1 ||M2||y U1 The value obtained by XORing C2 and C6, w2 represents the sum of k2 and s2 modulo p, and x2 and y2 represent the points s2G+w2PK. AG The x and y coordinates;
[0083] Step S4.3: The user terminal verifies whether the equation k2 = (e2 + x2) mod p is true. If the equation is true, then M2 is successfully recovered, and the user terminal calculates... Let SC UE ={M2,N UE ,θ UE ,Gen(·),Rep(·)}, where k1 represents the sum of e2 and x2 modulo p, M2 represents the message transmitted from the authentication gateway to the user, and H1(HPW UE ||ID UE ||σ UE ) indicates HPW UE ID UEWith σ UE The value of N after the concatenation operation is processed by the hash function H1 UE MID UE With hash value H1(HPW UE ||ID UE ||σ UE The value after XOR operation, θ UE Biometrics (BIO) UE The public string obtained after calculation by the fuzzy extraction function Gen(·), where Gen(·) and Rep(·) represent the fuzzy extraction function, SC UE Indicates the user's smart card identifier;
[0084] Step S5: Receive the client identifier ID via the client terminal. UE ∈{0,1} * User port command PW UE ∈{0,1} * User-side biometrics (BIO) UE ∈{0,1} * User-side smart card identifier SC UE User terminal key (PK) UE SK UE The system generates a client login and authentication request (MT3) using the public parameter `params`. Step S5 specifically includes the following steps:
[0085] Step S5.1: The user terminal receives the user terminal identifier ID. UE ∈{0,1} * User port command PW UE ∈{0,1} * User-side biometrics (BIO) UE ∈{0,1} * User-side smart card identifier SC UE User terminal key (PK) UE SK UE ), and public parameters params;
[0086] Step S5.2: Calculate σ via the user terminal. UE =Rep(BIO UE ,θ UE HPW UE =H1(PW UE ||σ UE ), Where, σ UE Biometrics (BIO) UE The secret string obtained after calculation using the fuzzy extraction function Rep(·), HPW UE PW UEWith σ UE The concatenated operation value is the value after being processed by the hash function H1, H1(HPW) UE ||ID UE ||σ UE ) indicates HPW UE ID UE and σ UE The value of the concatenated operation is the result of the hash function H1, MID. UE Indicates smart card parameter N UE With hash value H1(HPW UE ||ID UE ||σ UE The value after XOR operation, H1(MID) UE ) indicates MID UE The hash value after hashing by hash function H1, H1(HPW) UE ) indicates HPW UE The hash value after hashing with hash function H1 H1 represents the hash value (MID) UE ) and hash value H1 (HPW UE After XOR operation and modulo n p The value obtained after the operation is processed again by the hash function H1.
[0087] Step S5.3: User-side verification equation If the conditions are not met, the login request is rejected; otherwise, the client randomly selects a user. Let M3 = MID UE |‖r3||ID SR Where r3 represents from set M3 represents MID, which is a randomly selected integer. UE r3 and ID SR The value after cascading operation;
[0088] Step S5.4: The user side calculates e3 = H3(M3, r3), C7 = r3G = (x3, y3), k3 = (e3 + x3) mod p, s3 = (1 + d UE ) -1 (r3-k3d UE )mod p,r3PK AG =(x A2 ,y A2 ), t3=H2(x A2 ||y A2 ,p), Where T3 represents the current timestamp; let CT3 = C7|‖C8||C9, MT3 = {CT3,k3,s3,T3}; where e3 represents the value of M3 and r3 after hash function H3, x3 and y3 represent the x and y coordinates of point C7 respectively, k3 represents the value of the sum of e3 and x3 after modulo p, and s3 represents the sum of 1 and d. UE The inverse element of the sum and (r3-k3d) UE The value of x after multiplication and modulo p operation A2 ,y A2 Represents point r3PK AG The x and y coordinates, t3 represents x A2 With y A2 The concatenated value of M3 and T3 and the hash value of p after hash function H2, C8 represents the value of the concatenated value of M3 and T3 and t3 after XOR operation, H2(x A2 ||M3||y A2 ) represents x A2 M3 and y A2 The concatenated operation value is the result of the hash function H2, where C9 represents the hash value H2(x). A2 |‖M3‖|y A2 The value obtained by XORing CT3 with e3, CT3 represents the value obtained by cascading C7, C8 and C9, and MT3 represents the set composed of CT3, k3, s3 and T3.
[0089] Step S5.5: Output the client authentication request MT3 to the authentication gateway through the client;
[0090] Step S6: The authentication gateway receives the user's authentication request MT3 and the authentication gateway key (PK). AG SK AG The authentication gateway sends an authentication request (MT4) along with the common parameters (params). Step S6 specifically includes the following steps:
[0091] Step S6.1: The authentication gateway receives the user's authentication request MT3 and the authentication gateway key (PK). AG SK AG ), public parameter params;
[0092] Step S6.2: The authentication gateway verifies the freshness of T3. If T3 does not meet the freshness requirement, the authentication gateway rejects the client's authentication request; otherwise, it calculates d. AG C7=(x A2 ,y A2 ), t3=H2(x A2 ||y A2 ,p), w3=(k3+s3)mod p,(x3,y3)=s3G+w3PK UE , where x A2 ,y A2 They represent points d respectively AG The x and y coordinates of C7, where t3 represents x. A2 With y A2 The concatenated operation value of and the hash value of p after hash function H2, M3||T3 represents the value after XOR operation of C8 and t3, H2(x A2 ||M3‖|y A2 ) represents x A2 M3 and y A2 The concatenated operation value is the result of the hash function H2, where e3 represents the hash value H2(x). A2 |‖M3‖|y A2 The value obtained by XORing C and C9, w3 represents the sum of k3 and s3 modulo p, and x3 and y3 represent the point s2G+w2PK. AG The x and y coordinates;
[0093] Step S6.3: The authentication gateway verifies whether the equation k3 = (e3 + x3) mod p is true. If it is not true, the authentication request is rejected; otherwise, the authentication gateway successfully recovers M3, where k3 represents the sum of e3 and x3 modulo p, and M3 represents the message transmitted from the user to the authentication gateway.
[0094] Step S6.4: Randomly select at the authentication gateway end Let M4 = MID UE ||r4||ID SR Calculate e4 = H3(M4, r4), C 10 =r4G=(x4,y4), k4=(e4+x4)mod p, s4=(1+d AG ) -1 (r4-k4d AG )mod p,r4PK SR =(x S1 ,y S1 ), t4=H2(x S1 ||y S1 ,p), Where T4 represents the current timestamp; let CT4 = C 10 ||C 11 ||C 12 MT4 = {CT4, k4, s4, T4}; where r4 represents the value from set A randomly selected integer, M4 represents MID. UEr4 and ID SR After the cascading operation, e4 represents the value of M4 and r4 after the hash function H3, and x4 and y4 represent the values of point C. 10 The x and y coordinates are given, k4 represents the sum of e4 and x4 modulo p, and s4 represents the sum of 1 and d. AG The inverse of the sum and (r⁴-k⁴d) AG The value of x after multiplication and modulo p operation S1 ,y S1 Represents point r4PK SR The x and y coordinates, t4 represents x S1 With y S1 The concatenated operation value of C and the hash value of p after hash function H2 operation, C 11 H2(x) represents the value obtained by XORing the cascaded values of M4 and T4 with t4. S1 ||M4||y S1 ) represents x S1 M4 and y S1 The value of C after concatenation and hashing using the H2 function is 12 H2(x) represents the hash value S1 ||M4||y S1 The value obtained by XORing C with e4, CT4 represents C. 10 C 11 And C 12 After the cascading operation, MT4 represents the set consisting of CT4, k4, s4, and T4.
[0095] Step S6.5: The authentication gateway sends an authentication request MT4 to the server.
[0096] Step S7: The server receives the authentication request MT4 from the authentication gateway and the server-side key (PK). SR SK SR The server-side authentication response MT5 and session key SK are output, along with the common parameter params. Step S7 specifically includes the following steps:
[0097] Step S7.1: The server receives the authentication request MT4 from the authentication gateway, along with the server-side key (PK). SR SK SR ), and the common parameter params;
[0098] Step S7.2: The server verifies whether T3 is fresh. If T3 does not meet the freshness requirement, the server rejects the authentication request from the authentication gateway; otherwise, it calculates d. SR C 10 =(x S1 ,y S1), t4=H2(x S1 ||y S1 ,p), w4=(k4+s4)mod p,(x4,y4)=s4G+w4PK AG , where x S1 ,y S1 They represent points d respectively SR C 10 The x and y coordinates, t4 represents x S1 With y S1 The concatenated operation value of C and the hash value of p after hash function H2, M4||T4 represent C 11 The value of H2(x) after XOR operation with t4 S1 ||M4||y S1 ) represents x S1 M4 and y S1 The concatenated operation value is the result of the hash function H2, where e4 represents the hash value H2(x). S1 ||M4||y S1 ) and C 12 After the XOR operation, w4 represents the sum of k4 and s4 modulo p, and x4 and y4 represent the point s2G+w2PK. AG The x and y coordinates; Step S7.3: The server verifies whether the equation k4 = (e4 + x4) mod p is true. If it is not true, the authentication request is rejected; otherwise, the server successfully recovers M4, where k4 represents the sum of e4 and x4 after modulo p, and M4 represents the message transmitted from the authentication gateway to the server.
[0099] Step S7.4: Randomly selected by the server. Let M5 = MID UE ||r5||ID SR Calculate e5 = H3(M5, r5), C 13 =r5G=(x5,y5), k5=(e5+x5)modp, s5=(1+d SR ) -1 (r5-k5d SR )mod p,r5PK UE =(x U2 ,y U2 ), t5=H2(x U2 ||y U2 ,p), Where T5 represents the current timestamp, and r5 represents the timestamp from the set. M5 represents MID, which is a randomly selected integer. UEr5 and ID SR After the cascading operation, e5 represents the value of M5 and r5 after the hash function H3, and x5 and y5 represent point C respectively. 13 The x and y coordinates are given, k5 represents the sum of e5 and x5 modulo p, and s5 represents the sum of 1 and d. SR The inverse element of the sum and (r5-k5d) SR The value of x after multiplication and modulo p operation U2 ,y U2 Represents point r5PK UE The x and y coordinates, t5 represents x U2 With y U2 The concatenated operation value of C and the hash value of p after hash function H2 operation, C 14 H2(x) represents the value obtained by XORing the cascaded values of M5 and T5 with t5. U2 ||M5||y U2 ) represents x U2 M5 and y U2 The value of the cascade operation is the result of the hash function H2, C 15 H2(x) represents the hash value U2 ||M5||y U2 The value obtained by XORing e5 with e5;
[0100] Step S7.5: Calculate the session key SK = H1(r3||r5||ID) via the server. SR ||MID UE (p), let CT5 = C 13 ||C 14 ||C 15 MT5 = {CT5, k5, s5, T5}, where CT5 represents C 13 C 14 And C 15 After the cascading operation, MT5 represents the set consisting of CT5, k5, s5, and T5;
[0101] Step S7.6: Output the session key SK and the server authentication response MT5 to the user terminal via the server.
[0102] Step S8: The user terminal receives the server-side authentication response MT5 and the user terminal key (PK). UE SK UE The session key SK is output along with the public parameters params; step S8 specifically includes the following steps:
[0103] Step S8.1: The user terminal receives the server's authentication response MT5 and the user terminal key (PK). UE SKUE ), and public parameters params;
[0104] Step S8.2: The client verifies the freshness of T5: If T5 does not meet the freshness requirement, the client rejects the server's authentication response; otherwise, calculate d. UE C 13 =(x U2 ,y U2 ), t5=H2(x U2 ||y U2 ,p), w5=(k5+s5)mod p,(x5,y5)=s5G+w5PK SR , where x U2 ,y U2 They represent points d respectively UE C 13 The x and y coordinates, t5 represents x U2 With y U2 The concatenated operation value of C and the hash value of p after hash function H2, M5||T5 represents C 14 The value of H2(x) after XOR operation with t5 U2 ||M5||y U2 ) represents x U2 M5 and y U2 The concatenated operation value is the result of the hash function H2, where e5 represents the hash value H2(x). U2 ||M5‖|y U2 ) and C 15 After the XOR operation, w5 represents the sum of k5 and s5 modulo p, and x5 and y5 represent the point s5G+w5PK. SR The x and y coordinates;
[0105] Step S8.3: The client verifies whether the equation k5 = (e5 + x5) mod p is true. If the equation is true, message M5 is successfully recovered. The client calculates the session key SK = H1(r3||r5||ID). SR ||MID UE ,p), where k5 represents the value of the sum of e5 and x5 modulo p, and M5 represents the message transmitted from the server to the user.
[0106] Step S8.4: The user terminal outputs the session key SK to the server terminal.
[0107] Example 2:
[0108] like Figure 2As shown, this invention discloses a multi-factor authentication system based on the Chinese national cryptographic standard SM2, implementing the multi-factor authentication method based on SM2 of this invention in Embodiment 1. The system includes an authentication gateway, a server, a user terminal, and a key generation terminal located on the user terminal. The system comprises a key generation terminal 100, a user terminal 200, an authentication gateway 300, and a server 400 connected via a network. The key generation terminal 100 and the user terminal 200 are respectively connected to the server 400, the server 400 is connected to the authentication gateway 300, and the user terminal 200 is connected to the authentication gateway 400.
[0109] The key generation end is used to obtain public parameters based on the security parameters received from the server, and to receive the user terminal identifier, authentication gateway identifier, and server identifier from the user terminal, authentication gateway identifier, and server terminal respectively, and then combine them with the public parameters to generate the user terminal key (PK). UE SK UE ), authentication gateway key (PK) AG SK AG ) and server key (PK) SR SK SR ), and output, specifically, the user-side key (PK). UE SK UE It must consist of at least the public parameter params and the client identifier ID. UE Composition, the authentication gateway key (PK) AG SK AG It must consist of at least the public parameter params and the authentication gateway identifier ID. AG Composition, the server-side key (PK) SR SK SR It must consist of at least the public parameter params and the server-side identifier ID. SR The composition; furthermore, the generated public parameters params are composed of at least the security parameter λ; where λ represents the bit length of the system input value.
[0110] The user terminal 200 is used to generate a user terminal registration request MT1 and a user terminal smart card SC based on the public parameters received by the self-key generation terminal and the user terminal key, combined with the user port password, user terminal identifier, and user terminal biometrics. UE The user-side login authentication request MT3 and session key SK; specifically, the user-side registration request MT1 consists of at least a user-side identifier ID. UE User port command PW UE User-side biometrics (BIO) UE User terminal key (PK) UESK UE The user terminal smart card SC consists of ) and public parameters params. UE At least the authentication gateway must register the MT2 response and the user key (PK). UE SK UE The client login authentication request (MT3) consists of at least the client identifier ID and the public parameter params. UE User port command PW UE User-side biometrics (BIO) UE User terminal key (PK) UE SK UE User terminal smart card identifier SC UE The session key SK consists of at least the public parameters params, the server-side authentication response MT5, and the user-side key (PK). UE SK UE )composition.
[0111] The server-side 300 is configured to generate and output a server-side authentication response MT5 and a session key SK after receiving the authentication request, server-side key, and public parameters from the authentication gateway. Specifically, the server-side authentication response MT5 consists of at least the authentication request MT4 from the authentication gateway and the server-side key (PK). SR SK SR The authentication process consists of the public parameters (params), the server-side authentication response MT5 (generated based on the authentication gateway's authentication request MT4), and the server-side authentication response MT5 (generated based on both). The session key SK is composed of the public parameters (params), the server-side authentication response MT5, and the user-side key SK. The session key SK is generated simultaneously on both the user-side and server-side, and is used for communication between them.
[0112] The authentication gateway 400, upon receiving an authentication request from the user terminal, generates and outputs an authentication gateway registration response MT2 and an authentication gateway request MT4 based on the public parameters received from the key generator and the authentication gateway key. Specifically, the authentication gateway registration response MT2 consists of at least the user terminal registration request MT1 and the authentication gateway key (PK). AG SK AG The authentication request MT4 from the authentication gateway consists of at least the user-side authentication request MT3, the authentication gateway key (PK), and the public parameter params. AG SK AGThe authentication gateway registration response consists of a user registration request, an authentication gateway key, and public parameters; specifically, the authentication gateway authentication request consists of a user authentication request, an authentication gateway key, and public parameters.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to the embodiments, those skilled in the art should understand that modifications or equivalent substitutions to the technical solutions of this application do not depart from the spirit and scope of the technical solutions of this application, and should all be covered within the scope of the claims of this application.
Claims
1. A multi-factor authentication method based on the Chinese national cryptographic SM2 algorithm, characterized in that, The process includes the following steps: Step S1: The key generator generates a large prime number based on the security parameter λ received from the server. Elliptic curves Base point Password hash function , , and fuzzy extraction function , constitute public parameters ; The key generator receives the user terminal identifier. Authentication gateway identifier and server-side identifier Combined with publicly available parameters SM2 asymmetric key pairs are generated for the user end, authentication gateway end, and server end respectively: User end key Authentication gateway key and server-side key ; And output the public parameters and key pair; Step S2: The user terminal receives the user terminal key. Public parameters User port command User-side biometrics Based on user-side identifier User port command Public key of authentication gateway Generate ciphertext Based on user-side identifier User port command and the user's private key Generate signature components Generate ciphertext Signature components User registration request ; Step S3: The authentication gateway receives the user's registration request. Using its private key Decrypt and verify the signature; upon successful verification, the authentication gateway generates random parameters. Based on random parameters User terminal identifier User port command and the user's public key Generate ciphertext Based on user-side identifier User port command and authentication gateway private key Generate signature components Generate ciphertext Signature components Gateway registration response ; Step S4: The user terminal receives the registration response from the authentication gateway. Using the user's private key Decrypt and verify the signature, then restore the parameters; after successful verification, the client uses the client identifier. User port command User-side biometrics Generate and store user-end smart cards ; Step S5: When the client needs to log in, it uses the user port password. User-side biometrics and smart cards Perform multi-factor authentication; after successful authentication, based on the user's identifier... Server segment identifier and the user's private key Generate signature components Based on user-side identifier Server-side identifier and the authentication gateway public key Generate ciphertext Generate ciphertext Signature components User login authentication request ; Step S6: The authentication gateway receives the user's login authentication request. Use the authentication gateway's private key Decrypt and verify the signature; upon successful verification, the authentication gateway uses its private key SKAG and the user's identifier. and server identifier Generate signature components Based on user-side identifier Server identifier and the server public key Generate ciphertext Generate ciphertext Signature components authentication request from the authentication gateway ; Step S7: The server receives the authentication request from the authentication gateway. Using its private key Decrypt and verify the signature; upon successful verification, the server uses its private key. User terminal identifier and server identifier Generate signature components Based on the user's public key User terminal identifier and server identifier Generate ciphertext Generate ciphertext Signature components Server-side authentication response And calculate the session key. ; Step S8: The user terminal receives the authentication response from the server. Using its private key Decrypt and verify the signature; after successful verification, the client calculates the session key. The same session key is used to complete authentication.
2. The multi-factor authentication method based on the national cryptographic SM2 algorithm according to claim 1, characterized in that, Step S1 specifically includes the following process: Step S1.1: Security parameters from the server side Generate a large prime number and elliptic curves ,in, , yes The absolute value of the elliptic curve is randomly selected. On From the first base point, we obtain the graphical representation of the base point. ,in, , ;in, Representing points respectively The x and y coordinates; Represents integers The set ; Step S1.2: Select three cryptographic hash functions , , ;in, Will The elements on are mapped to Random elements on; Will The elements on are mapped to Elements on; Will The elements on are mapped to Elements on; Represents a string of arbitrary length. Indicates the length of the session key. Indicates length is The string; select the fuzzy extraction function. ,in and Each The element mapping is The elements that make the parameters public. ; Step S1.3: Input public parameters to the key generation terminal User terminal identifier Authentication gateway identifier and server-side identifier Random selection Calculate the user-side key Authentication gateway key and server-side key Output the user-side key Authentication gateway key and server-side key ;make ;in, They represent from the set A randomly selected integer; Representing points respectively The x and y coordinates; Representing points respectively The x and y coordinates; Representing points respectively The x and y coordinates.
3. The multi-factor authentication method based on the national cryptographic SM2 algorithm according to claim 1, characterized in that, Step S2 specifically includes the following process: Step S2.1: The user terminal receives the user terminal key. Fuzzy extraction function and publicly available parameters Then, using the fuzzy extraction function Mapping biometric features to Elements on; Step S2.2: Perform fuzzy extraction of user-side biometric features on the user end. User port hash password User-side identifier hash password Calculate, where, Indicates biological characteristics After fuzzy extraction function The secret string obtained after subsequent calculation, Indicates biological characteristics After fuzzy extraction function The public string obtained after subsequent calculation; Password With secret string The value after cascading operation express After hash function The hash value obtained after the operation Indicator With secret string cascade operations; express After hash function The hash value obtained after the operation; This indicates a cascade operation; Step S2.3: Randomly select , ,make ,calculate , , , , , , , ,in, Indicates the current timestamp; let , ;in, Indicates from set Any string of any length randomly selected from the data. Indicates from set A randomly selected integer. express , as well as The value after cascading operation express After hash function The value after the operation Represents points on an elliptic curve. Representing points respectively x and y coordinates express and and after the model The value after the operation express and The inverse element of the sum and After multiplication, modulo The value of the operation, Representing points respectively x and y coordinates express and Cascade operation value and After hash function The value after the operation express and Cascade operation value and The value after XOR operation express , as well as Cascaded operation values are processed by a hash function The value after the operation Represents hash value and The value after XOR operation express , as well as The value after cascading operation This represents the XOR operation. This indicates a modulo operation.
4. The multi-factor authentication method based on the national cryptographic SM2 algorithm according to claim 1, characterized in that, Step S3 specifically includes the following process: Step S3.1: The authentication gateway receives the user's registration request. Authentication gateway key and public parameters ; Step S3.2: Verify via the authentication gateway. Is it fresh? The authentication gateway rejects the client's registration request because it does not meet the freshness requirement. Otherwise, calculate , , , , , ,in, express and Cascade operation value and After hash function The hash value after the operation, Represents hash value and The value after XOR operation express and and after the model The value after the operation Point The x and y coordinates; Step S3.3: Verify the equation through the authentication gateway. Check if the equation holds true; if it does, then the recovery was successful. The authentication gateway randomly selects , ,calculate , ,in, They represent from the set A string of arbitrary length randomly selected from the data. Indicates from set A randomly selected integer. express After hash function The hash value after the operation, express After hash function The hash value after the operation, Represents hash value and hash value After XOR operation and modulo The calculated value is then processed by the hash function again. The value after the operation express and The value after XOR operation; Step S3.4: Create an identifier through the authentication gateway. List ,make Random selection ,calculate , , , , , , , ,in, Indicates the current timestamp; let , ,in, express and The value after cascading operation Indicates from set A randomly selected integer. express and After hash function The value after the operation Representing points respectively x and y coordinates express and and model The value after the operation express and The inverse element of the sum and After multiplication, modulo The value of the operation, Point x and y coordinates express and Cascade operation value and After hash function The hash value after the operation, express and Cascade operation value and The value after XOR operation express , as well as The cascaded operation value is processed by the hash function The value after the operation Represents hash value and The value after XOR operation express , as well as The value after cascading operation.
5. A multi-factor authentication method based on the national cryptographic SM2 algorithm according to claim 1, characterized in that, Step S4 specifically includes the following process: Step S4.1: The user terminal receives the registration response from the authentication gateway. Public parameters and user key ; Step S4.2: Verify via client Is it fresh? If the novelty requirement is not met, the user rejects the registration response; otherwise, the calculation... , , , , , ,in, Representing points respectively x and y coordinates express and Cascade operation value and After hash function The hash value after the operation, express and The value after XOR operation express , and The cascaded operation value is processed by the hash function The value after the operation Represents hash value and The value after XOR operation express and The sum and the value after modulo p, Point The x and y coordinates; Step S4.3: User-side verification equation Check if the equation holds true; if it does, then the recovery was successful. User-side computing ,make ,in, express and and after the model The value after the operation express Messages transmitted to the user terminal express , and The cascaded operation value is processed by the hash function The value after the operation express With hash value The value after XOR operation Indicates biological characteristics After fuzzy extraction function The public string obtained after subsequent calculation, This represents the fuzzy extraction function. This indicates the user's smart card identifier.
6. A multi-factor authentication method based on the national cryptographic SM2 algorithm according to claim 1, characterized in that, Step S5 specifically includes the following process: Step S5.1: The user terminal receives the user terminal identifier. User port command User-side biometrics User-side smart card identifier User-side key and publicly available parameters ; Step S5.2: Calculate via the user terminal , , , ,in, Indicates biological characteristics After fuzzy extraction function The secret string obtained after subsequent calculation, express and The cascaded operation value is processed by the hash function The value after the operation express , and The cascaded operation value is processed by the hash function The value after the operation Indicates smart card parameters With hash value The value after XOR operation express After hash function The hash value after the operation, express After hash function The hash value after the operation, Represents hash value and hash value After XOR operation and modulo The calculated value is then processed by the hash function again. The value after the operation; Step S5.3: User-side verification equation If the authentication request is invalid, the client will reject it; otherwise, the client will randomly select an authentication method. ,make ,in, Indicates from set A randomly selected integer. express , and The value after cascading operation; Step S5.4: User-side calculation , , , , , , , ,in, Indicates the current timestamp; let , ;in, express and After hash function The value after the operation Representing points respectively x and y coordinates express and and after the model The value after the operation express and The inverse element of the sum and After multiplication, modulo The value of the operation, Point x and y coordinates express and Cascade operation value and After hash function The hash value after the operation, express and Cascade operation value and The value after XOR operation express , as well as The cascaded operation value is processed by the hash function The value after the operation Represents hash value and The value after XOR operation express , as well as The value after cascading operation Indicates by A set that consists of.
7. A multi-factor authentication method based on the national cryptographic SM2 algorithm according to claim 1, characterized in that, Step S6 specifically includes the following process: Step S6.1: The authentication gateway receives the authentication request from the user. Authentication gateway key Common parameters ; Step S6.2: Verification at the authentication gateway Is it fresh? The authentication gateway rejects the client's authentication request because it does not meet the freshness requirement. Otherwise, calculate , , , , , ,in, Representing points respectively x and y coordinates express and Cascade operation value and After hash function The hash value after the operation, express and The value after XOR operation express , and The cascaded operation value is processed by the hash function The value after the operation Represents hash value and The value after XOR operation express and The sum and the value after modulo p, Point The x and y coordinates; Step S6.3: Verification equation at the authentication gateway Check if the authentication request is valid; if not, reject the authentication request; otherwise, the authentication gateway successfully recovers. ,in, express and The sum and the value after modulo p, This represents the message transmitted from the user terminal to the authentication gateway. Step S6.4: Randomly select at the authentication gateway end ,make ,calculate , , , , , , , ,in, Indicates the current timestamp; let , ;in, Indicates from set A randomly selected integer. express , and The value after cascading operation express and After hash function The value after the operation Representing points respectively x and y coordinates express and and after the model The value after the operation express and The inverse element of the sum and After multiplication, modulo The value of the operation, Point x and y coordinates express and Cascade operation value and After hash function The hash value after the operation, express and Cascade operation value and The value after XOR operation express , as well as After cascading, the hash function is applied. The value after the operation Represents hash value and The value after XOR operation express , as well as The value after cascading operation Indicates by A set that consists of.
8. A multi-factor authentication method based on the national cryptographic SM2 algorithm according to claim 1, characterized in that, Step S7 specifically includes the following process: Step S7.1: The server receives the authentication request from the authentication gateway. Server-side key and common parameters ; Step S7.2: Server-side verification Is it fresh? If the freshness requirement is not met, the server rejects the authentication request from the authentication gateway; otherwise, the calculation... , , , , , ,in, Representing points respectively x and y coordinates express and Cascade operation value and After hash function The hash value after the operation, express and The value after XOR operation express , and The cascaded operation value is processed by the hash function The value after the operation Represents hash value and The value after XOR operation express and and after the model The value after the operation Point The x and y coordinates; Step S7.3: Server-side verification of the equation Check if the authentication is successful; if not, reject the authentication request; otherwise, the server successfully recovers. ,in, express and and after the model The value after the operation This represents the message transmitted from the authentication gateway to the server. Step S7.4: Randomly selected by the server. ,make ,calculate , , , , , , , ,in, Indicates the current timestamp. Indicates from set A randomly selected integer. express , and The value after cascading operation express and After hash function The value after the operation Representing points respectively x and y coordinates express and and after the model The value after the operation express and The inverse element of the sum and After multiplication, modulo The value after the operation Point x and y coordinates express and Cascade operation value and After hash function The hash value after the operation, express and Cascade operation value and The value after XOR operation express , as well as The cascaded operation value is processed by the hash function The value after the operation Represents hash value and The value after XOR operation; Step S7.5: Calculate the session key via the server. , make , ,in, express , as well as The value after cascading operation Indicates by A set of components.
9. A multi-factor authentication method based on the national cryptographic SM2 algorithm according to claim 1, characterized in that, Step S8 specifically includes the following process: Step S8.1: The user receives the authentication response from the server. User-side key and public parameters ; Step S8.2: User-side verification Is it fresh? If the novelty requirement is not met, the user client rejects the server-side authentication response; otherwise, the computation... , , , , , in, Representing points respectively x and y coordinates express and Cascade operation value and After hash function The hash value after the operation, express and The value after XOR operation express , and The cascaded operation value is processed by the hash function The value after the operation Represents hash value and The value after XOR operation express and and after the model The value after the operation Point The x and y coordinates; Step S8.3: User-side verification equation Check if the equation is true; if it is true, the message has been successfully recovered. The user terminal calculates the session key. ,in, express and and after the model The value after the operation This indicates the message transmitted from the server to the user.
10. A multi-factor authentication system based on the Chinese national cryptographic SM2 algorithm, characterized in that, The system includes a key generation terminal, a user terminal, an authentication gateway terminal, and a server terminal connected to the network. The key generation terminal and the user terminal are respectively connected to the server terminal. The server terminal is connected to the authentication gateway terminal. The user terminal is also connected to the authentication gateway terminal. The system is used to implement the multi-factor authentication method based on the national cryptographic SM2 algorithm as described in any one of claims 1 to 9.