User password management method and system based on national cryptographic algorithm

By employing national cryptographic algorithms and a multi-party collaborative user password management system, the security risks in user password management have been resolved, enabling an efficient and secure password update and reset process, and ensuring the privacy of user passwords and the security of the system.

CN122053244APending Publication Date: 2026-05-15SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-31
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Current technologies for user password management have security vulnerabilities. System administrators can see the reset passwords, there is a lack of efficient and secure update and reset methods, and there is a risk of leakage during the user password update process.

Method used

The user password management system, based on the national cryptographic algorithm, enables user terminal password verification, modification, and reset through the collaborative work of the key generation server (KGC), secure access server (KDC), user management server (UADMIN), secondary authentication server (CAPT), mail server, and application server (SERVER), ensuring the security and privacy of password operations.

Benefits of technology

During the process of modifying and resetting a user's password, only the user can initiate the process. Key generation is completed by the KGC, with multiple parties participating. The behavior is traceable, effectively avoiding the risk of password leakage and ensuring high system security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122053244A_ABST
    Figure CN122053244A_ABST
Patent Text Reader

Abstract

The invention discloses a user password management method and system based on a national cryptographic algorithm, and the method comprises the steps: a user terminal USER obtains a login verification request, builds password verification information, completes password verification based on the password verification information, and achieves the secure connection with a secure access server KDC after the verification is passed; the USER of the user terminal obtains the password modification request and completes password modification, so that the USER of the user terminal can log in by using the new password; the user management server UADMIN obtains the password resetting request and completes password resetting work; after the password is reset, the USER of the user terminal obtains a login request, and the USER of the user terminal achieves login; and after the password is reset, the application server SERVER obtains the login request, and the application server SERVER realizes login.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of user password management technology, and in particular to a user password management method and system based on Chinese national cryptographic algorithms. Background Technology

[0002] User information management, especially user passwords, is a crucial aspect of modern information system security. Information systems typically process and store user passwords using hashing and salting methods, which effectively protects password security. However, password updates and resets are usually performed independently by system administrators, posing certain security risks. Furthermore, reset passwords are usually visible to the system administrator, increasing the risk of password leakage. There is also a lack of efficient and secure measures for application server password updates. Therefore, developing a secure and efficient user password management method and system presents a significant challenge. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention provides a user password management method and system based on national cryptographic algorithms; the system consists of a key generation server KGC, a secure access server KDC, a user management server UADMIN, a secondary authentication server CAPT, a mail server, an application server SERVER, and a user terminal USER.

[0004] On the one hand, it provides a user password management method based on national cryptographic algorithms, including: The user terminal (USER) obtains a login verification request, constructs password verification information, completes password verification based on the password verification information, and after successful verification, the user terminal (USER) establishes a secure connection with the secure access server (KDC). The user terminal (USER) receives a password change request, completes the password change, and enables the user terminal (USER) to log in using the new password. The user management server UADMIN receives the password reset request and completes the password reset. After the password is reset, the user terminal USER receives a login request and logs in. After the password is reset, the application server receives the login request and then logs in.

[0005] On the other hand, a user password management system based on the national cryptographic algorithm is provided, including: user terminal USER, user management server UADMIN and secure access server KDC; The user terminal (USER) obtains a login verification request, constructs password verification information, completes password verification based on the password verification information, and after successful verification, the user terminal (USER) establishes a secure connection with the secure access server (KDC). The user terminal (USER) receives a password change request, completes the password change, and enables the user terminal (USER) to log in using the new password. The user management server UADMIN receives the password reset request and completes the password reset. After the password is reset, the user terminal USER receives a login request and logs in. After the password is reset, the application server receives the login request and then logs in.

[0006] The above technical solution has the following advantages or beneficial effects: When a user logs into the system, a decryption key is generated using the password to recover the private key information. After logging in, verification information based on the current time is generated to prevent privacy data leakage. The user's password can only be modified by the user. Password reset, user creation, user deletion, and user information modification can only be initiated by the user's administrator. Key generation can only be completed by the user's GC. User key recovery is jointly completed by the user's GC, user's administrator, and user / server. User management-related behavior logs are stored on multiple servers such as CAPT, GC, and GC, making behavior traceable. The system has high security and effectively avoids the risk of password leakage. Attached Figure Description

[0007] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0008] Figure 1 This is a flowchart of the method in Example 1. Detailed Implementation

[0009] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0010] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the invention. The terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0011] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0012] All data acquisition in this embodiment is carried out in accordance with laws and regulations and with user consent, and the data is used legally.

[0013] 1. Log in: User login (involving USER, CAPT, and KDC): Enter the password for verification, then obtain the verification code from CAPT, send a connection request to KDC, KDC sends the verification code to CAPT for verification, if the verification is successful, a session is established between USER and KDC, and the session key is key0; User management server UADMIN login (involving UADMIN, CAPT, and KDC): Enter the password for verification, then obtain the verification code from CAPT, send a connection request to KDC, KDC sends the verification code to CAPT for verification, if the verification is successful, establish a session between UADMIN and KDC, the session key is key1; SERVER login (involving SERVER and KDC): Recover the password from the SEK file, send a connection request to the KDC, and the KDC verifies the SERVER information. If the verification is successful, a session is established between the SERVER and the KDC, with the session key being key2.

[0014] 2. Users can change their own passwords (USER, CAPT, KDC, and KGC): Enter both the old and new passwords. First, the system verifies the old password's correctness. If correct, it requests a verification code from CAPT. The system processes the verified verification code and password information and sends it to KDC. KDC first sends the verification code to CAPT for verification. If verification passes, it forwards the modified password data packet to KGC. KGC regenerates the user's private and public key files, packages them, and sends them to KDC. KDC saves the public key file and sends the private key information to USER. USER saves the private key file and then exits the system. The user can then log in with the new password.

[0015] 3. Reset password UADMIN can reset passwords (involving UADMIN, CAPT, KDC, and KGC): The basic process is the same, but the information that needs to be saved differs for different types of users; For users, it is necessary to save the private key file information and recovery key fragment; for servers, it is necessary to save the private key file information, SEK file information, and recovery key fragment. After resetting, the user logs in to the system with a one-time password to obtain a new password, and then can log in with the new password (this involves USERUADMIN CAPT KDC). The server updates the SEK file and then starts the system directly (this involves the server's UADMINKDC).

[0016] User terminal USER, user management server UADMIN, secondary authentication server CAPT, and application server SERVER are all connected to the secure access server KDC. They use independent session keys key0, key1, key2, and key3 as master keys to call the SM4 algorithm for data encryption transmission. All terminals have a unified 64-bit unsigned integer key parameter table KGTBLE

[32] .

[0017] The key generation server KGC adopts a whitelist strategy, allowing only secure access servers to connect, and uses one-time password connections such as national cryptographic digital envelopes.

[0018] The two-factor authentication server CAPT, the secure access server KDC, and the key generation server KGC have fixed IPs and ports, while the user management servers UADMIN and USER can use dynamic IPs and ports.

[0019] The user management server UADMIN stores the private key file, the secure access server KDC public key file, and the SM4 decryption white-box file.

[0020] The two-factor authentication server CAPT stores the private key file, the secure access server KDC public key file, and the SM4 decryption white-box file.

[0021] The user terminal (USER) stores the private key file, the secure access server (KDC) public key file, and the SM4 decryption white-box file.

[0022] The application server stores the private key file and password encryption file, while the secure access server (KDC) stores the public key file and the SM4 decryption white-box file.

[0023] The secure access server KDC stores private key files, password encryption files, key generation server KGC, two-factor authentication server CAPT, user terminal USER, user management server UADMIN, application server SERVER public key files, and SM4 decryption white-box files.

[0024] The key generation server KGC stores private key files, password encryption files, and the private key, public key files, and password encryption files of the user management server UADMIN, the two-factor authentication server CAPT, the user terminal USER, the secure access server KDC, and the application server SERVER, as well as SM4 encryption white-box files and SM4 decryption white-box files.

[0025] Example 1 This embodiment provides a user password management method based on the national cryptographic algorithm; like Figure 1 As shown, the user password management method based on the national cryptographic algorithm includes: S101: The user terminal USER obtains a login verification request, constructs password verification information, completes password verification based on the password verification information, and after successful verification, the user terminal USER establishes a secure connection with the secure access server KDC. S102: The user terminal USER receives a password change request, completes the password change, and enables the user terminal USER to log in using the new password; S103: User management server UADMIN receives a password reset request and completes the password reset process; S104: After the password is reset, the user terminal USER receives a login request and logs in. S105: After the password is reset, the application server receives the login request and the application server completes the login.

[0026] Further, in step S101: the user terminal (USER) obtains a login verification request, constructs password verification information, completes password verification based on the password verification information, and after successful verification, establishes a secure connection between the user terminal (USER) and the secure access server (KDC), specifically including: S101-1: The user terminal USER receives a login verification request. The user terminal USER concatenates the input password with the fixed parameter SPAR0 and then calls the national cryptographic algorithm SM3 to generate a 32-byte hash value H. The fixed parameter SPAR0 is a fixed string used to resist brute-force password cracking. S101-2: Using the last 16 bytes of hash value H as the master key and the first 16 bytes of hash value H as the initial vector, call the SM4 CTR algorithm to decrypt the private key file; S101-3: If decryption is successful, the SM4 white-box decryption algorithm is called to recover the private key information, using the SM4 decryption white-box file as a parameter. S101-4: Generate a 64-bit random number nounce, combine the current time t, the random number nounce, and the user password, and perform multiple SM3 hash operations to generate a 32-byte hash value H1; S101-5: Using the last 16 bytes of H1 as the master key and the first 16 bytes of H1 as the initial vector, call the SM4 CTR algorithm to encrypt H to obtain the password verification information oH; S101-6: Append a random number nounce and the current time t to the password verification information oh to form a complete password verification information; the complete password verification information is used to verify the correctness of the old password when the user changes their password. S101-7: After successful verification, a secure connection is established with the secure access server KDC using the national cryptographic key negotiation protocol, with the session key being key0.

[0027] The private key file stores multiple sets of SM2 and SM9 private keys, SM4 root key, unique identifiers, permissions, and other information.

[0028] It should be understood that the SM4 decryption white-box file stores the lookup table data of the SM4 decryption algorithm after the key is merged. Users do not need to save the key, thus improving system security. White-box cryptography is a well-known encryption technique that deeply integrates the key and the algorithm. Simply put, a white-box cryptography algorithm is an encryption algorithm with a fixed key. Users only need to input plaintext to call the white-box encryption algorithm to obtain ciphertext, and only need to input ciphertext to call the white-box decryption algorithm to obtain plaintext.

[0029] The beneficial effects of the above technical solution are: using the user password as the root key combined with white-box cryptography algorithms to decrypt private key data can effectively improve security and prevent the leakage of private information.

[0030] Further, step S102: The user terminal USER obtains a password change request, completes the password change, and enables the user terminal USER to log in using the new password, including: S102-1: The user terminal USER can change the password. The user terminal USER enters the old password oldkey and the new password newkey. First, it checks whether oldkey and newkey are the same. If they are the same, it returns an error. Then it checks whether oldkey and newkey meet the password rules. If they do not meet the rules, it returns an error. Then it verifies the old password oldkey. S102-2: After concatenating the input password with the system fixed parameter SPAR0, the national cryptographic algorithm SM3 is called to generate a 32-byte hash value H1; the system fixed parameter SPAR0 is a fixed string used to resist brute-force password cracking; S102-3: Read noounce and t from the password verification information oH, combine noounce and t with the user password, and perform several SM3 hash operations to generate a 32-byte hash value H2. Use the last 16 bytes of hash value H2 as the master key and the first 16 bytes of hash value H2 as the initial vector, and call the SM4 CTR algorithm to decrypt the first 32 bytes of the password verification information oH to obtain roH. If the hash value H1 matches the first 32 bytes of roH, the verification is successful; otherwise, return an error message and exit. S102-4: Generate a 64-bit random number, noble, and record the current time t; concatenate t and KGTBLE[t%32] and perform SM3 hashing to obtain a 32-byte hash value H3. Use the first 16 bytes of H3 as the root key K and the last 16 bytes as the initialization vector IV. Call SM4 CTR mode to encrypt noble||t to obtain a 16-byte encrypted message EM. The USER sends a verification code request command, the USER's unique identifier, the encrypted message EM, noble, and t to the secondary verification server CAPT; where KGTBLE[t%32] represents the remainder of the current time t divided by 32; where || represents concatenating noble and t; S102-5: The secondary verification server CAPT concatenates t and KGTBLE[t%32] and performs SM3 hashing to obtain a 32-byte hash value H3. The first 16 bytes of the hash value H3 are used as the root key K, and the last 16 bytes are used as the initialization vector IV. SM4 CTR mode is called to decrypt EM. If the decrypted content is consistent with noble||t, the verification is successful. A random verification code and verification code image are generated. The USER's unique identifier, the current time t1, and the verification code are recorded. The verification code image is encrypted with K and IV and sent to the user terminal USER. The USER's unique identifier and request time are written to the log. The two-factor authentication server CAPT periodically checks the verification code information. If the verification code was generated after a set time, the verification code information is deleted and written to the log.

[0031] S102-6: The user terminal USER receives the CAPT response data packet from the secondary authentication server, decrypts the verification image, the user identifies and enters the verification code, connects the set new user password newkey with the system fixed parameter SPAR0, calls SM3 to generate a 32-byte hash value HEKY1, and generates a 32-byte random key tmpkey0. The hash value H1, hash value HEKY1, random key tmpkey0 and USER's unique identifier are concatenated to form key information M2. Using the unique identifier of key generation server KGC as the public key, SM9 is called to encrypt and generate encrypted key information EM2. The encrypted key information EM2, verification code and password modification request instruction are encrypted with key0 as the master key and sent to the secure access server KDC using SM4 algorithm. S102-7: After receiving the USER's password modification request, the secure access server KDC first decrypts it. If the decryption is successful, it checks the CAPT status. If the CAPT status is normal, it encrypts the USER's unique identifier, verification code, and verification code verification request using key2 and sends them to the CAPT. S102-8: After receiving the verification code verification request sent by the secure access server KDC, the secondary verification server CAPT decrypts it. If the decryption is successful, it extracts the USER's unique identifier and the verification code for verification. If the verification passes, it encrypts the verification information with key2 and sends it to the secure access server KDC, while deleting the verification code. Otherwise, it sends a verification failure message to KDC.

[0032] Write the user terminal's unique identifier (USER), verification time, and verification result to the log.

[0033] S102-9: After receiving the confirmation information returned by the secondary verification server CAPT, if the verification fails, the KDC will return an error message to the user terminal USER; otherwise, it will combine the encryption key information EM2, the USER's unique identifier, the KDC's unique identifier, and the password modification instruction and send them to the key generation server KGC, and wait for the key generation server KGC's response.

[0034] S102-10: After receiving the password modification instruction sent by KDC, the key generation server KGC first searches for the USER's private key file. If it is not found, it returns an error message to KDC. Otherwise, it uses the SM9 private key to decrypt EM2 to obtain H1, HEKY1 and the random key tmpkey0. Using the last 16 bytes of H1 as the master key and the first 16 bytes of H1 as the initial vector, the SM4 CTR algorithm is called to decrypt the USER private key file. If decryption fails, an error message is returned; otherwise, the private key and public key information are regenerated. The SM4 white-box encryption algorithm is called to encrypt the private key information using the SM4 encryption white-box file as a parameter. The private key information and the decrypted USER information are encrypted with a 32-byte hash value HKEY1 and saved as a new private key file. The public key information is also saved as a new public key file.

[0035] The private key file is encrypted with tmpkey0 to obtain the encrypted private key file data. The public key file, the encrypted private key file data, and the response command are then combined and sent to the KDC, and the KGC records the log.

[0036] S102-11: After receiving the response information from KGC, KDC saves the public key file, sends the private key file to the user terminal USER, and sets the user terminal USER status to require re-login, disallowing heartbeats and key updates. KGC records the log.

[0037] S102-12: After receiving the encrypted private key file, the user terminal USER decrypts it using tmpkey0, saves the decrypted file as a local private key file, and then sends a logout command, causing the terminal USER to go offline. At this time, the user information stored in KGC and KDC has been updated, and the private key information has also been updated, resulting in better security.

[0038] S102-13: User terminal USER logs in with the new password.

[0039] The beneficial effects of the above technical solution are: user passwords are not stored or transmitted, and only KGC and USER process user password information during the password modification process, which effectively reduces the risk of password leakage.

[0040] Further, in step S103: the user management server UADMIN obtains a password reset request and completes the password reset process, including: S103-1: User management server UADMIN calls S102-4 and S102-5 to send verification code request instructions and obtain verification codes; S103-2: The user management server UADMIN receives the CAPT response data packet from the secondary authentication server, decrypts the verification image, the user identifies the verification code in the image and enters the verification code, and generates a 32-byte random key tmpkey1. The random key tmpkey1, the unique identifier of the user0 to be reset, and other information to be modified by user0 (phone / email / user permissions, etc.) are combined into M3. Using the unique identifier of the key generation server KGC as the public key, SM9 is called to encrypt and generate the encrypted key information EM3. The unique identifier of user0, the verification code, the encrypted key information EM3, and the password reset request instruction are encrypted with key1 as the master key and sent to the secure access server KDC using the SM4 algorithm. S103-3: After receiving a password reset request from the user management server UADMIN, the security access server KDC first checks the working status of the user management server UADMIN. If the working status is abnormal, it returns an error message. Then check if user0 is allowed to change the password. If not, return an error message. If allowed, decryption is performed. If decryption is successful, check the working status of the two-factor authentication server CAPT. If the two-factor authentication server CAPT is in a normal state, the user management server UADMIN unique identifier, verification code, and verification code verification request will be encrypted with key2 and sent to the two-factor authentication server CAPT. S103-4: After receiving the verification code request from the secure access server KDC, the secondary authentication server CAPT decrypts the UADMIN unique identifier, verification code, and verification code request encrypted by KDC. If decryption is successful, it verifies the user management server's UADMIN unique identifier and verification code. If the verification passes, it encrypts the verification pass information using the session key key2 between CAPT and KDC and sends it to the secure access server KDC, while deleting the verification code information; otherwise, it sends a verification failure message to the secure access server KDC. The secondary verification server CAPT writes the unique identifier of the user management server UADMIN, the verification time, and the verification result to the log.

[0041] S103-5: After receiving the confirmation information returned by the secondary authentication server CAPT, if the authentication fails, the KDC returns an error message to the user management server UADMIN; otherwise, it combines the unique identifiers of EM3, user0, UADMIN, and KDC, sends the combined data to the key generation server KGC, and waits for a response from the key generation server KGC. The combination refers to sequentially concatenating the target objects into a data packet. S103-6: After receiving the password reset command sent by KDC, the key generation server KGC first searches for user0's public key file and reads the user information. If it is not found, it returns an error message to the secure access server KDC. Otherwise, it uses the SM9 private key to decrypt EM3, obtains other information that user0 needs to modify, updates the user information, generates private key information and corresponding public key information, and calls the SM4 white-box encryption algorithm to encrypt the private key information with the SM4 encryption white-box file as a parameter. Generate a random password TKEY of no more than 30 bytes and no less than 16 bytes. After concatenating the input password with the fixed parameter SPAR0, call SM3 to generate a 32-byte hash value H4. Use the last 16 bytes of H4 as the master key and the first 16 bytes of H4 as the initial vector to call the SM4 CTR algorithm to encrypt the private key information. Save the private key file and the public key file. If the user type is server, then generate an SEK file: copy the unique identifier user0 to a temporary array ttt, copy the random password TKEY to the position starting from the 32nd byte of ttt; generate a 256-byte random number Tstr, take the 32 bytes starting from the 0th byte%32 position of the random number Tstr as the private key, generate a 64-byte public key, encrypt ttt with the SM2 public key, and save the encrypted ttt to the 64+0th byte%32 position of Tstr; call the SM4 white-box encryption algorithm to encrypt Tstr with the SM4 encryption white-box file as a parameter, and save it to the SEK file.

[0042] S103-7: Generate UADMIN private key recovery parameter par0 and KDC private key recovery parameter par1 for the user management server: First, generate 256-bit random numbers u, x1, a1; After connecting the unique user0 identifier with the system's fixed parameters, perform the SM3 hash operation and store the generated 32-byte hash value as two 256-bit random numbers. Generate a 256-bit unsigned number u1 using a1, x1, and u: multiply x1 by a1 to get the first result, take the remainder of the first result with respect to N in SM2 to get the second result, add u to the second result to get the third result, and then take the remainder of the third result with respect to N to get u1; calculate u1G = u1.G and save it to 64 bytes starting from par0; Generate a 256-bit unsigned number u2 using a1, x2, and u: Multiply x2 by a1 to get the fourth result, take the remainder of the fourth result with respect to N in SM2 to get the fifth result, add u to the fifth result to get the sixth result, and then take the remainder of the sixth result with respect to N to get u2; calculate u2G = u2.G, save it to the 64th byte starting from par1, and copy x1 to the 32nd byte starting from the 64th byte of par1; Calculate uG = uG, perform SM3 hash on uG to generate a 32-byte hash value key, take the 16 bytes starting from key+8+(key

[16] %8) as the master key, take the 16 bytes starting from key+(key[0]%16) as the IV, call the SM4 CTR algorithm to encrypt TKEY, and save it to the 32 bytes starting from the 64th byte of par0; S103-8: Construct the data packet: Append the encrypted private key information to the 92nd byte of par0. If user0 is of type server, append TStr to the end of par0. Encrypt par0 with tmpkey1 and save it to epar0. Append the public key information and the encrypted epar0 to the end of par1. Connect par1 and epar0, use the connection result as an acknowledgment message, send the acknowledgment message to KDC, and record the log.

[0043] S103-9: After receiving the KGC response message, KDC decrypts par1 and the public key file, and sends par0 to the user management server UADMIN; S103-10: After receiving epar0, the user management server UADMIN decrypts par0 using tmpkey1, generates a one-time login code, and sends it to the mail server where user0's email address is located. The user management server UADMIN records user0's unique identifier, one-time login code, and the current time to the local login code record file, and also logs the information.

[0044] It should be understood that if CAPT has been connected to the system and is periodically and regularly performing heartbeats and session key updates, it is in a normal state; otherwise, it is in an abnormal state, including: not connected to the system, multiple heartbeat failures, and key update failures.

[0045] The advantages of the above technical solution are: user password information is stored in parts by UADMIN and KDC respectively, and the user's private key information can only be decrypted after the complete password is recovered, which ensures high security.

[0046] Further, in step S104: after the password is reset, the user terminal USER receives a login request, and the user terminal USER logs in, including: S104-1: user0 logs in to the email, obtains a one-time login code code, generates a 64-digit special random number nounce, concatenates user0's unique identifier, KDC's unique identifier, and nounce, performs an SM3 hash operation, uses the result of the SM3 hash operation as HASH, uses HASH+6+(HASH

[23] %8) as Key, uses HASH+(HASH[7]%16) as the initial vector IV of the SM4 CTR algorithm, calls the SM4 CTR algorithm to encrypt (code|USER unique identifier) ​​to obtain the encrypted one-time login information EDATA, and sends EDATA, nounce, current time, USER unique identifier and login code login instructions to KDC; S104-2: After receiving the login code login data packet, KDC first uses the USER unique identifier to look up the USER; If the USER is not found or its status is abnormal, an error message will be returned. Otherwise, search for the USER's par0 file; if not found, return an error message. Otherwise, check the UADMIN status. If the status is abnormal, return an error message; otherwise, generate a random number nounce1. Using key1 as the master key, the concatenation result of the current time and noounce1 is used as the initial vector IV of the SM4 CTR algorithm to encrypt EDATA. The encrypted EDATA, current time, noounce1, KDC unique identifier, user0 unique identifier, and login code verification command are sent to UADMIN. S104-3: After receiving the login code verification data packet from the KDC, UADMIN first decrypts EDATA; If decryption fails, an error message is returned; otherwise, the user0 information is searched in the local login code record file. If not found, return an error message to KDC; If the login code generation timeout exceeds 24 hours, the login code will be resent, and a login code timeout instruction will be returned to KDC. If the verification code is incorrect, an error message is returned to the KDC; otherwise, a random number nounce2 is generated, the UADMIN unique identifier is concatenated with nounce2, the concatenation result is encrypted using SM4 CTR, the UADMIN sends the login code verification data packet to the KDC, and records the user0 information. The validity period of user0's information is 5 minutes. The user0 information includes: user0's unique identifier, nounce2, and time. S104-4: If the KDC receives a login code verification data packet, it decrypts nounce2, packages nounce2, the UADMIN unique identifier, the UADMIN IP address, the UADMIN port, and the user password fragment par1, and encrypts them using the SM4 CTR algorithm to obtain EDATA2. The KDC then sends EDATA2 and the login code verification command to the USER. If no data packet is received, an error message is sent to the USER. S104-5: After receiving the login code verification data packet, the USER uses the SM4 CTR command to decrypt the UADMIN unique identifier, UADMIN IP port, nounce2, and par1, extracts the public key file, and saves it. Otherwise, it returns an error message and exits. After concatenating nounce2, the UADMIN unique identifier, nounce1, code, and the USER unique identifier, perform an SM3 hash operation to obtain a 32-byte hash value: HASH = SM3(nounce2 | UADMIN unique identifier | nounce1 | code | USER unique identifier); Use HASH+5+(HASH

[31] %8) as the key; Use HASH+ (HASH[5]%16) as the IV, encrypt the unique identifier code|user0 using SM4 CTR, and send the encryption result to UADMIN; S104-6: After receiving the parameter file request instruction sent by user0, UADMIN decrypts the data packet. If the decryption is successful, it sends par0 to user0 and deletes the USER information, the par0 file, and the USER record in the local login code record file. Otherwise, it returns an error message. S104-7: After receiving the parameter file response data packet, the USER extracts par0; S104-8: USER uses the Shamir threshold cipher to decrypt and saves the private key file; Furthermore, the USER is decrypted using a Shamir threshold cipher, specifically including: Extract u1G from par0, recover u2G and x1 from par1, and after connecting the USER unique identifier with the system fixed parameters, perform SM3 hash operation to generate a 32-byte hash value and store it as 256 bits x2. Calculate the 256-bit unsigned number tf as (x2-x1) %N; Calculate the inverse modulo N of tf to obtain infv; Calculate f1 as the product of x2 and infv modulo N; Calculate f2 as the product of x1 and infv modulo N; Calculate the SM2 scalar multiplication f1.u1G with coefficient f1 and point coordinate u1G to obtain the point uu1G on the SM2 curve; Calculate the SM2 scalar multiplication f2.u2G with coefficient f2 and point coordinate u2G to obtain the point uu2G on the SM2 curve; Calculate the SM2 point subtraction operation of uu1G minus uu2G to obtain the point uu3G on the SM2 curve. Take the z coordinate of uu3G, perform the inverse modulo operation to obtain invz, then perform the square operation of invz modulo the SM2 eigenprime P to obtain invz2. Then perform the multiplication operation of invz2 and invz modulo P to obtain invz3. Multiply the x-coordinate of uu3G by invz2, and then modulo P to obtain outv.x; Multiply the y-coordinate of uu3G by invz3, and then modulo P to obtain outv.y; After concatenating outv.x and outv.y, we get outv. We then perform an SM3 hash operation on outv to obtain the key. USER decrypts the key and saves the private key file.

[0047] The password will be displayed. The user needs to remember the password and press any key to exit. Then, they can enter the password normally to log in using password login mode.

[0048] The advantages of the above technical solution are: multi-factor authentication is performed via email, and only the collaboration of USER, UADMIN, and KDC can recover the password, which provides a high level of security.

[0049] Further, in step S105: after the password is reset, the application server receives the login request, and the application server implements the login, including: S105-1: The application server SERVER logs in to the email, obtains a one-time login code code, generates a 64-character special random number nounce, uses SM3 (SERVER unique identifier | KDC unique identifier | nounce) as the hash array HASH, uses HASH+6+(HASH

[23] %8) as the Key, uses HASH+(HASH[7]%16) as the initial vector IV in the SM4 CTR algorithm, calls the SM4 CTR algorithm to encrypt (code|SERVER unique identifier) ​​to obtain the encrypted user unique identifier EDATA, and sends the encrypted user unique identifier EDATA, nounce, current time, USER unique identifier and login code login instruction to KDC; S105-2: After receiving the one-time login code login data packet, KDC first uses the unique identifier of the application server to find the application server. If it is not found or the application server is in an abnormal state, an error message is returned. Otherwise, search for the par0 file on the application server. If it is not found, return an error message. Otherwise, check the UADMIN status; if the status is abnormal, return an error message. Otherwise, generate a random number nounce1, use key1 as the master key, the current time|nounce1 as the IV, encrypt EDATA, and send the encrypted EDATA, the current time, nounce1, the KDC unique identifier, the USER unique identifier, and the login code verification command to UADMIN; S105-3: After receiving the login code verification data packet from the KDC, UADMIN first decrypts EDATA; If decryption fails, return an error message; otherwise, search for USER information in the local login code record file. If not found, return an error message to KDC; If the login code generation timeout exceeds 24 hours, resend the login code and return a login code timeout instruction to KDC; If the verification code is incorrect, return an error message to the KDC; otherwise, generate a random number nounce2, connect the unique UADMIN identifier and nounce2, call SM4 CTR to encrypt the connection result, send the login code verification data packet to the KDC, record the SERVER information, and the validity period is 5 minutes.

[0050] S105-4: If KDC receives a login code verification successful data packet, it decrypts nounce2, packages nounce2|UADMIN unique identifier, UADMIN IP, UADMIN port, and par1, encrypts them using the SM4_CTR algorithm, and obtains EDATA2. It then sends EDATA2 and the login code verification successful command to SERVER; otherwise, it sends an error message to USER. S105-5: After receiving the login code verification data packet, the SERVER uses the SM4 CTR command to decrypt the UADMIN unique identifier, UADMIN IP port, nounce2, and par1, extracts the public key file, and saves it. Otherwise, it returns an error message and exits.

[0051] After concatenating nounce2 | UADMIN unique identifier | nounce1 | code | SERVER unique identifier, perform an SM3 hash operation to obtain a 32-byte hash value. HASH = SM3(nounce2 | UADMIN unique identifier | nounce1 | code | SERVER unique identifier); Use HASH+5+(HASH

[31] %8) as the key; use HASH+(HASH[5]%16) as the IV, encrypt the unique identifier code|USER, and send the encryption result to UADMIN; S105-6: After receiving the parameter file request instruction sent by the user terminal USER, UADMIN decrypts the data packet. If the decryption is successful, par0 is sent to SERVER. At the same time, the user management server UADMIN deletes the SERVER information, par0 file and SERVER record in the local login code record file. Otherwise, an error message is returned. S105-7: After receiving the parameter file response data packet sent by UADMIN, the SERVER extracts par0; S105-8: The application server extracts u1G from par0, recovers u2G and x1 from par1, and after the SERVER's unique identifier is connected with the system's fixed parameters, it performs an SM3 hash operation and stores the generated 32-byte hash value as 256 bits x2. Calculate the 256-bit unsigned number tf as (x2-x1) %N; Calculate the inverse modulo N of tf to obtain infv; Calculate f1 as the product of x2 and infv modulo N; Calculate f2 as the product of x1 and infv modulo N; Calculate the SM2 scalar multiplication f1.u1G with coefficient f1 and point coordinate u1G to obtain the point uu1G on the SM2 curve; Calculate the SM2 scalar multiplication f2.u2G with coefficient f2 and point coordinate u2G to obtain the point uu2G on the SM2 curve; Calculate the SM2 point subtraction operation of uu1G minus uu2G to obtain the point uu3G on the SM2 curve. Take the z coordinate of uu3G, perform the inverse modulo operation to obtain invz, then perform the square operation of invz modulo the SM2 eigenprime P to obtain invz2. Then perform the multiplication operation of invz2 and invz modulo P to obtain invz3. Multiply the x-coordinate of uu3G by invz2, and then modulo P to obtain outv.x; Multiply the y-coordinate of uu3G by invz3, and then modulo P to obtain outv.y; After concatenating outv.x and outv.y, we get outv. We perform an SM3 hash operation on outv to obtain the key, the SERVER recovery password, and extract and save the private key file and the encrypted SERVER password information file SEK. S105-9: The application server recovers the hash from the SEK, decrypts the private key file, obtains the private key information, and reconnects to the KDC.

[0052] The advantages of the above technical solution are: multi-factor authentication is performed via email, and password recovery can only be achieved through collaboration between the SERVER, UADMIN, and KDC, thus providing high security.

[0053] Example 2 This embodiment provides a user password management system based on the national cryptographic algorithm, including: user terminal USER, user management server UADMIN, and secure access server KDC; The user terminal (USER) obtains a login verification request, constructs password verification information, completes password verification based on the password verification information, and after successful verification, the user terminal (USER) establishes a secure connection with the secure access server (KDC). The user terminal (USER) receives a password change request, completes the password change, and enables the user terminal (USER) to log in using the new password. The user management server UADMIN receives the password reset request and completes the password reset. After the password is reset, the user terminal USER receives a login request and logs in. After the password is reset, the application server receives the login request and then logs in.

[0054] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A user password management method based on national cryptographic algorithms, characterized by: include: The user terminal (USER) obtains a login verification request, constructs password verification information, completes password verification based on the password verification information, and after successful verification, the user terminal (USER) establishes a secure connection with the secure access server (KDC). The user terminal (USER) receives a password change request, completes the password change, and enables the user terminal (USER) to log in using the new password. The user management server UADMIN receives the password reset request and completes the password reset. After the password is reset, the user terminal USER receives a login request and logs in. After the password is reset, the application server receives the login request and then logs in.

2. The user password management method based on the national cryptographic algorithm as described in claim 1, characterized in that, The user terminal (USER) receives a login verification request, constructs password verification information, completes password verification based on the password verification information, and after successful verification, the user terminal (USER) establishes a secure connection with the secure access server (KDC), specifically including: The user terminal USER receives a login verification request. After concatenating the input password with the fixed parameter SPAR0, the user terminal USER calls the national cryptographic algorithm SM3 to generate a 32-byte hash value H. The fixed parameter SPAR0 is a fixed string used to resist brute-force password cracking. Using the last 16 bytes of hash value H as the master key and the first 16 bytes of hash value H as the initial vector, the SM4 CTR algorithm is called to decrypt the private key file; If decryption is successful, the SM4 white-box decryption algorithm is called to recover the private key information, using the SM4 decryption white-box file as a parameter. Generate a 64-bit random number nounce. Combine the current time t, the random number nounce, and the user password, and perform multiple SM3 hash operations to generate a 32-byte hash value H1. Using the last 16 bytes of H1 as the master key and the first 16 bytes of H1 as the initial vector, the SM4 CTR algorithm is called to encrypt H, resulting in the password verification information oH; After the password verification message 'oH', append the random number 'nounce' and the current time 't' to form the complete password verification message; the complete password verification message is used to verify the correctness of the old password when the user changes their password. After successful verification, a secure connection is established with the secure access server KDC using the national cryptographic key negotiation protocol, with the session key being key0.

3. The user password management method based on the national cryptographic algorithm as described in claim 1, characterized in that, The user terminal (USER) receives a password change request, completes the password change, and enables the user terminal (USER) to log in using the new password, including: The user terminal USER can change the password. The user terminal USER enters the old password oldkey and the new password newkey. First, it checks whether oldkey and newkey are the same. If they are the same, it returns an error. Then it checks whether oldkey and newkey meet the password rules. If they do not meet the rules, it returns an error. Then it verifies the old password oldkey. After concatenating the input password with the system fixed parameter SPAR0, the national cryptographic algorithm SM3 is called to generate a 32-byte hash value H1; the system fixed parameter SPAR0 is a fixed string used to resist brute-force password cracking; Read noounce and t from the password verification information oH. Combine noounce and t with the user password and perform several SM3 hash operations to generate a 32-byte hash value H2. Use the last 16 bytes of hash value H2 as the master key and the first 16 bytes of hash value H2 as the initial vector. Call the SM4 CTR algorithm to decrypt the first 32 bytes of the password verification information oH to obtain roH. If the hash value H1 matches the first 32 bytes of roH, the verification is successful; otherwise, return an error message and exit.

4. The user password management method based on the national cryptographic algorithm as described in claim 3, characterized in that, The method further includes: Generate a 64-bit random number `nounce` and record the current time `t`. Concatenate `t` with `KGTBLE[t%32]` and perform SM3 hashing to obtain a 32-byte hash value `H3`. Use the first 16 bytes of `H3` as the root key `K` and the last 16 bytes as the initialization vector `IV`. Encrypt `nounce||t` using SM4 CTR mode to obtain a 16-byte encrypted message `EM`. The USER sends a verification code request command, the USER's unique identifier, the encrypted message `EM`, `nounce`, and `t` to the secondary verification server `CAPT`. Here, `KGTBLE[t%32]` represents the remainder of the current time `t` divided by 32; and `||` represents concatenating `nounce` and `t`. The secondary verification server CAPT concatenates t and KGTBLE[t%32] and performs SM3 hashing to obtain a 32-byte hash value H3. The first 16 bytes of the hash value H3 are used as the root key K, and the last 16 bytes are used as the initialization vector IV. SM4 CTR mode is called to decrypt EM. If the decrypted content is consistent with noble||t, the verification is successful. A random verification code and verification code image are generated. The USER's unique identifier, the current time t1, and the verification code are recorded. The verification code image is encrypted with K and IV and sent to the user terminal USER. The USER's unique identifier and request time are written to the log. The secondary verification server CAPT periodically checks the verification code information. If the verification code generation time exceeds the set time, the verification code information is deleted and written to the log. The user terminal USER receives the CAPT response data packet from the secondary authentication server, decrypts the verification image, identifies and enters the verification code, connects the new user password newkey with the system fixed parameter SPAR0, calls SM3 to generate a 32-byte hash value HEKY1, and generates a 32-byte random key tmpkey0. The hash value H1, hash value HEKY1, random key tmpkey0, and USER's unique identifier are concatenated to form key information M2. Using the unique identifier of the key generation server KGC as the public key, SM9 is called to encrypt and generate encrypted key information EM2. The encrypted key information EM2, the verification code, and the password modification request instruction are encrypted using key0 as the master key and sent to the secure access server KDC using the SM4 algorithm.

5. The user password management method based on the national cryptographic algorithm as described in claim 4, characterized in that, The method further includes: After receiving the USER's password change request, the secure access server KDC first decrypts it. If the decryption is successful, it checks the CAPT status. If the CAPT status is normal, it encrypts the USER's unique identifier, verification code, and verification code verification request using key2 and sends them to the CAPT. After receiving the verification code request sent by the secure access server KDC, the secondary verification server CAPT decrypts it. If decryption is successful, it extracts the USER's unique identifier and the verification code for verification. If the verification passes, it encrypts the verification information with key2 and sends it to the secure access server KDC, while deleting the verification code. Otherwise, it sends a verification failure message to KDC and writes the user terminal's USER's unique identifier, verification time, and verification result to the log. After receiving the confirmation information returned by the secondary verification server CAPT, if the verification fails, the KDC will return an error message to the user terminal USER; otherwise, it will send the encryption key information EM2, the USER's unique identifier, the KDC's unique identifier, and the password modification instruction to the key generation server KGC and wait for the key generation server KGC's response. After receiving the password modification instruction sent by KDC, the key generation server KGC first searches for the USER's private key file. If it is not found, it returns an error message to KDC. Otherwise, it uses the SM9 private key to decrypt EM2 to obtain H1, HEKY1 and the random key tmpkey0. Using the last 16 bytes of H1 as the master key and the first 16 bytes of H1 as the initial vector, the SM4 CTR algorithm is called to decrypt the USER private key file. If decryption fails, an error message is returned; otherwise, the private key information and public key information are regenerated. The SM4 white-box encryption algorithm is called to encrypt the private key information with the SM4 encryption white-box file as a parameter. The private key information and the decrypted USER information are encrypted with a 32-byte hash value HKEY1 and saved as a new private key file. The public key information is saved as a new public key file. The private key file is encrypted with tmpkey0 to obtain the encrypted private key file data. The public key file, the encrypted private key file data, and the response command are combined and sent to KDC. KGC records the log. After receiving the response information from KGC, KDC saves the public key file, sends the private key file to the user terminal USER, and sets the user terminal USER status to require re-login, disallowing heartbeats and key updates. KGC records the log. After receiving the encrypted private key file, the user terminal USER decrypts it using tmpkey0, saves the decrypted file as a local private key file, and then sends a logout command to log the terminal USER offline. The user terminal USER logs in with the new password.

6. The user password management method based on the national cryptographic algorithm as described in claim 1, characterized in that, The user management server UADMIN receives the password reset request and completes the password reset process, including: User management server UADMIN calls S102-4 and S102-5 to send verification code request commands and obtain verification codes; The user management server UADMIN receives the CAPT response data packet from the secondary authentication server, decrypts the verification image, the user identifies the verification code in the image and enters the verification code, and generates a 32-byte random key tmpkey1. The random key tmpkey1, the unique identifier of the user0 to be reset, and other information to be modified by user0 are combined into M3. Using the unique identifier of the key generation server KGC as the public key, SM9 is called to encrypt and generate the encrypted key information EM3. The unique identifier of user0, the verification code, the encrypted key information EM3, and the password reset request instruction are encrypted with key1 as the master key and sent to the secure access server KDC using the SM4 algorithm. After receiving a password reset request from the user management server UADMIN, the security access server KDC first checks the working status of the user management server UADMIN. If the working status is abnormal, it returns an error message. Then check if user0 is allowed to change the password. If not, return an error message. If allowed, decryption is performed. If decryption is successful, check the working status of the two-factor authentication server CAPT. If the secondary verification server CAPT is in a normal state, the unique identifier of the user management server UADMIN, the verification code, and the verification code verification request will be encrypted with key2 and sent to the secondary verification server CAPT.

7. The user password management method based on the national cryptographic algorithm as described in claim 6, characterized in that, The method further includes: after receiving the verification code verification request sent by the secure access server KDC, the secondary verification server CAPT decrypts the UADMIN unique identifier, verification code, and verification code verification request encrypted by KDC. If the decryption is successful, it verifies the UADMIN unique identifier and verification code of the user management server. If the verification passes, it encrypts the verification pass information using the session key key2 between CAPT and KDC and sends it to the secure access server KDC, while deleting the verification code information; otherwise, it sends a verification failure information to the secure access server KDC. The secondary verification server CAPT writes the UADMIN unique identifier of the user management server, the verification time, and the verification result into the log. After receiving the confirmation information returned by the secondary authentication server CAPT, if the authentication fails, the KDC returns an error message to the user management server UADMIN; otherwise, it combines the unique identifiers of EM3, user0, UADMIN, and KDC, sends the combined data to the key generation server KGC, and waits for a response from the key generation server KGC. The combination refers to sequentially concatenating the target objects into a data packet. After receiving the password reset command sent by KDC, the key generation server KGC first searches for user0's public key file and reads the user information. If it is not found, it returns an error message to the secure access server KDC. Otherwise, it uses the SM9 private key to decrypt EM3, obtains other information that user0 needs to modify, updates the user information, generates private key information and corresponding public key information, and calls the SM4 white-box encryption algorithm to encrypt the private key information with the SM4 encryption white-box file as a parameter. Generate a random password TKEY of no more than 30 bytes and no less than 16 bytes. After concatenating the input password with the fixed parameter SPAR0, call SM3 to generate a 32-byte hash value H4. Use the last 16 bytes of H4 as the master key and the first 16 bytes of H4 as the initial vector to call the SM4 CTR algorithm to encrypt the private key information. Save the private key file and the public key file. If the user type is server, generate an SEK file: copy the unique identifier user0 to a temporary array ttt, copy the random password TKEY to the position starting from the 32nd byte of ttt; generate a 256-byte random number Tstr, take the 32 bytes starting from the 0th byte%32 position of the random number Tstr as the private key, generate a 64-byte public key, encrypt ttt with the SM2 public key, and save the encrypted ttt to the 64+0th byte%32 position of Tstr; use the SM4 white-box encryption file as a parameter to call the SM4 white-box encryption algorithm to encrypt Tstr, and save it to the SEK file; Generate the UADMIN private key recovery parameter par0 and the KDC private key recovery parameter par1 for the user management server; Construct the data packet: Append the encrypted private key information to the 92nd byte of par0. If user0 is of type server, append TStr to the end of par0. Encrypt par0 with tmpkey1 and save it to epar0. Append the public key information and the encrypted epar0 to the end of par1. Connect par1 and epar0, use the connection result as an acknowledgment message, send the acknowledgment message to KDC, and log the connection. After receiving the KGC response message, KDC decrypts par1 and the public key file, and sends par0 to the user management server UADMIN. After receiving epar0, the user management server UADMIN decrypts par0 using tmpkey1, generates a one-time login code, and sends it to user0's email address. The user management server UADMIN records user0's unique identifier, the one-time login code, and the current time to the local login code record file, and also logs the information.

8. The user password management method based on the national cryptographic algorithm as described in claim 1, characterized in that, After the password is reset, the user terminal (USER) receives a login request and logs in, including: User0 logs in to the email, obtains a one-time login code code, generates a 64-digit random number nounce, concatenates the unique identifier of user0, the unique identifier of KDC, and nounce, performs an SM3 hash operation, uses the result of the SM3 hash operation as HASH, uses HASH+6+(HASH[23]%8) as Key, uses HASH+(HASH[7]%16) as the initial vector IV of the SM4 CTR algorithm, calls the SM4 CTR algorithm to encrypt (code|USER unique identifier) ​​to obtain the encrypted one-time login information EDATA, and sends EDATA, nounce, current time, USER unique identifier and login code login instructions to KDC; After receiving the login code login data packet, KDC first uses the unique identifier of USER to look up USER; if not found or USER status is abnormal, an error message is returned; otherwise, it searches for USER's par0 file, and if not found, an error message is returned; otherwise, it checks the UADMIN status, and if the status is abnormal, an error message is returned; otherwise, it generates a random number noounce1; using key1 as the master key, the concatenation result of the current time and noounce1 is used as the initial vector IV of the SM4 CTR algorithm to encrypt EDATA, and the encrypted EDATA, current time, noounce1, KDC unique identifier, user0 unique identifier, and login code verification command are sent to UADMIN; After receiving the login code verification data packet from KDC, UADMIN first decrypts EDATA; if decryption fails, it returns an error message; otherwise, it searches for user0 information in the local login code record file; if not found, it returns an error message to KDC; if the login code generation timeout exceeds 24 hours, it resends the login code and returns a login code timeout instruction to KDC. If the verification code is incorrect, an error message is returned to the KDC; otherwise, a random number nounce2 is generated, the unique identifier of UADMIN is concatenated with nounce2, the concatenation result is encrypted using SM4 CTR, UADMIN sends the login code verification data packet to the KDC, and the information of user0 is recorded. If KDC receives a login code verification data packet, it decrypts nounce2, packages nounce2, the UADMIN unique identifier, the UADMIN IP address, the UADMIN port, and the user password fragment par1, and encrypts them using the SM4 CTR algorithm to obtain EDATA2. KDC then sends EDATA2 and the login code verification command to USER. If KDC does not receive the data packet, it sends an error message to USER. After receiving the login code verification data packet, USER uses the SM4 CTR command to decrypt the UADMIN unique identifier, UADMIN IP port, nobounce2 and par1, extract the public key file and save it; otherwise, return an error message and exit; after concatenating nobounce2, UADMIN unique identifier, nobounce1, code, and USER unique identifier, perform SM3 hash operation to obtain a 32-byte hash value HASH; use HASH+5+(HASH[31]%8) as the key; use HASH+(HASH[5]%16) as the IV, perform SM4 CTR encryption on the code|user0 unique identifier, and send the encryption result to UADMIN; After receiving the parameter file request instruction sent by user0, UADMIN decrypts the data packet. If the decryption is successful, it sends par0 to user0 and deletes the USER information, the par0 file, and the USER record in the local login code record file. Otherwise, it returns an error message. After receiving the parameter file response data packet, the USER extracts par0; The user uses the Shamir threshold cipher to decrypt the data and saves the private key file.

9. The user password management method based on the national cryptographic algorithm as described in claim 1, characterized in that, After the password is reset, the application server receives the login request and implements the login, including: The application server SERVER logs in to the email, obtains a one-time login code code, generates a special random number nounce of 64, uses SM3 (SERVER unique identifier | KDC unique identifier | nounce) as the hash array HASH, uses HASH+6+(HASH[23]%8) as the key, uses HASH+(HASH[7]%16) as the initial vector IV in the SM4 CTR algorithm, calls the SM4CTR algorithm to encrypt (code|SERVER unique identifier) ​​to obtain the encrypted user unique identifier EDATA, and sends the encrypted user unique identifier EDATA, nounce, current time, USER unique identifier and login code login instruction to KDC; After receiving the one-time login code login data packet, KDC first uses the unique identifier of the application server to find the application server. If it is not found or the application server status is abnormal, an error message is returned. Otherwise, it searches the par0 file of the application server. If it is not found, an error message is returned. Otherwise, it checks the UADMIN status. If the status is abnormal, an error message is returned. Otherwise, it generates a random number nounce1, uses key1 as the master key, and the current time|nounce1 as the IV to encrypt EDATA. The encrypted EDATA, the current time, nounce1, the unique identifier of KDC, the unique identifier of USER, and the login code verification command are sent to UADMIN. After receiving the login code verification data packet from KDC, UADMIN first decrypts EDATA; If decryption fails, return an error message; otherwise, search for USER information in the local login code record file. If not found, return an error message to KDC. If the login code generation timeout exceeds 24 hours, resend the login code and return a login code timeout instruction to KDC. If the verification code is incorrect, return an error message to the KDC; otherwise, generate a random number nounce2, connect the UADMIN unique identifier and nounce2, call SM4 CTR to encrypt the connection result, send the login code verification data packet to the KDC, and record the SERVER information. If KDC receives a login code verification successful data packet, it decrypts nounce2, packages nounce2|UADMIN unique identifier, UADMIN IP, UADMIN port, and par1, encrypts them using the SM4_CTR algorithm, and obtains EDATA2. KDC then sends EDATA2 and the login code verification successful command to SERVER; otherwise, it sends an error message to USER. After the SERVER receives the login code verification data packet, it uses the SM4 CTR command to decrypt the UADMIN unique identifier, UADMIN IP port, nobounce2 and par1, extracts the public key file and saves it; otherwise, it returns an error message and exits; after concatenating nobounce2|UADMIN unique identifier|nounce1|code|SERVER unique identifier, it performs an SM3 hash operation to obtain a 32-byte hash value HASH; it uses HASH+5+(HASH[31]%8) as the key; it uses HASH+(HASH[5]%16) as the IV, encrypts code|USER unique identifier, and sends the encryption result to UADMIN; After receiving the parameter file request instruction sent by the user terminal USER, UADMIN decrypts the data packet. If the decryption is successful, par0 is sent to SERVER. At the same time, the user management server UADMIN deletes the SERVER information, par0 file and SERVER record in the local login code record file. Otherwise, an error message is returned. After receiving the parameter file response data packet sent by UADMIN, the SERVER extracts par0; The application server extracts u1G from par0, recovers u2G and x1 from par1, and performs an SM3 hash operation to obtain the key after the server's unique identifier is connected with the system's fixed parameters. The server recovers the password, extracts and saves the private key file and the encrypted server password information file SEK. The application server recovers the hash from SEK, decrypts the private key file, obtains the private key information, and then reconnects to KDC.

10. A user password management system based on Chinese national cryptographic algorithms, characterized in that: include: User terminal (USER), user management server (UADMIN), and secure access server (KDC); The user terminal (USER) obtains a login verification request, constructs password verification information, completes password verification based on the password verification information, and after successful verification, the user terminal (USER) establishes a secure connection with the secure access server (KDC). The user terminal (USER) receives a password change request, completes the password change, and enables the user terminal (USER) to log in using the new password. The user management server UADMIN receives the password reset request and completes the password reset. After the password is reset, the user terminal USER receives a login request and logs in. After the password is reset, the application server receives the login request and then logs in.