User password encryption method and device
By encrypting user passwords using RSA asymmetric encryption algorithm and generating Google tokens in combination with the two-factor authentication mechanism, the problem of insufficient security of user password encryption transmission in the prior art is solved, and more efficient and secure user authentication is achieved.
Patent Information
- Application Number
- CN202411484925.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, there is a risk of being cracked during transmission after the user's password is encrypted, and the encryption algorithm is fixed and public, the operation is complex and costly, and the dynamic password card itself lacks security measures, and there is a risk of user identity theft.
The RSA asymmetric encryption algorithm is used to generate a key to encrypt the plain text password, and based on the private key and the time-based one-time password algorithm, combined with the two-factor authentication mechanism, generate Google tokens for verification of user identity. After encryption, The user password is stored in the local database.
It improves the security of user passwords, reduces the possibility of passwords and password transformation methods being stolen, simplifies the authentication process, improves authentication efficiency, and avoids the need for third-party authentication.
Smart Images

Figure CN119475315A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of password encryption, and in particular to a method and device for encrypting a user password. Background Art
[0002] User password encryption is an important measure to protect user privacy and data security. It is of great significance to enhance user trust and loyalty and prevent data leakage and password reuse risks.
[0003] At present, symmetric encryption algorithms or asymmetric encryption algorithms are commonly used to encrypt passwords before transmission. However, since the encryption algorithm is fixed and public, there is a risk of being cracked, and the key must be managed, and sometimes third-party authentication is involved. The operation method is complicated and costly. Another security measure is to use a dynamic password card to generate a dynamic password. Users can enter the current dynamic password to log in. Although this improves the security of user identity information to a certain extent, the dynamic password card itself has no security measures, and there is still a risk of user identity theft. Summary of the invention
[0004] In view of this, the present application provides a method and device for encrypting a user password, aiming to improve the security of the user password.
[0005] In a first aspect, the present application provides a method for encrypting a user password, the method comprising:
[0006] Get the plain text password entered by the user;
[0007] The plain text password is encrypted using a key generated by an RSA asymmetric encryption algorithm to obtain an encrypted user password, wherein the key includes a public key and a private key;
[0008] Generate a Google token based on the private key and a time-based one-time password algorithm in combination with a two-factor authentication mechanism, wherein the Google token is used to verify the identity of the user;
[0009] The encrypted user password is stored in the local database.
[0010] Optionally, the method further comprises:
[0011] Receive a request for querying the user password, wherein the request includes a Google code input by the user, and the Google code is a one-time verification code generated by the Google token;
[0012] Verifying the Google code according to the Google token;
[0013] If the verification is successful, the encrypted user password is decrypted using the private key to obtain the plaintext password;
[0014] Enter the plain text password into the clipboard.
[0015] Optionally, verifying the Google code according to the Google token includes:
[0016] A verification Google code generated according to the Google token is compared with the Google code;
[0017] If the verification Google code is consistent with the Google code, the verification is successful.
[0018] Optionally, after storing the encrypted user password in the local database, the method further includes:
[0019] Classifying the encrypted user passwords to obtain classified encrypted user passwords;
[0020] The classified and encrypted user passwords are backed up.
[0021] Optionally, the method further comprises:
[0022] Save the public key and private key to the specified directory file.
[0023] In a second aspect, the present application provides a device for encrypting a user password, the device comprising:
[0024] The acquisition module is used to obtain the plain text password input by the user;
[0025] An encryption module, used to encrypt the plain text password using a key generated by an encryption algorithm to obtain an encrypted user password, wherein the key includes a public key and a private key;
[0026] A generation module, used to generate a Google token based on the private key and a time-based one-time password algorithm in combination with a two-factor authentication mechanism, wherein the Google token is used to verify the identity of the user;
[0027] The saving module is used to store the encrypted user password into a local database.
[0028] Optionally, the device further comprises:
[0029] A receiving module, configured to receive a request for querying the user password, wherein the request includes a Google code input by the user, and the Google code is a one-time verification code generated by the Google token;
[0030] A verification module, used for verifying the Google code according to the Google token;
[0031] A decryption module, used to decrypt the encrypted user password using the private key to obtain the plaintext password if the verification is successful;
[0032] An input module is used to input the plain text password into a clipboard.
[0033] Optionally, the verification module is specifically used to:
[0034] A verification Google code generated according to the Google token is compared with the Google code;
[0035] If the verification Google code is consistent with the Google code, the verification is successful.
[0036] Optionally, after storing the encrypted user password in the local database, the device further includes:
[0037] A classification module, used for classifying the encrypted user passwords to obtain classified encrypted user passwords;
[0038] The backup module is used to back up the classified and encrypted user passwords.
[0039] Optionally, the saving module is further used to save the public key and the private key to a specified directory file.
[0040] Optionally, the encryption algorithm is an RSA asymmetric encryption algorithm.
[0041] Optionally, after the public key and the private key are saved in a specified directory file, the method further comprises: setting access rights for the directory file, the access rights being used to verify the identity of the accessing user. In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:
[0042] A memory for storing one or more programs;
[0043] Processor; when the one or more programs are executed by the processor, the user password encryption method described in any one of the first aspects above is implemented.
[0044] In a fourth aspect, an embodiment of the present application provides a computer storage medium, in which a program is stored. When the program is executed by a processor, the user password encryption method described in any one of the first aspects is implemented.
[0045] The above technical solution has the following beneficial effects:
[0046] The embodiment of the present application provides a method and device for encrypting a user password. When executing the method, first obtain the plain text password input by the user; then encrypt the plain text password using the key generated by the RSA asymmetric encryption algorithm to obtain the encrypted user password; wherein the key includes a public key and a private key; then generate a Google token based on the private key and a time-based one-time password algorithm in combination with a two-factor authentication mechanism, and the Google token is used to verify the user's identity; finally, store the encrypted user password in a local database. In the above manner, the plain text password is encrypted using the public key generated by the RSA asymmetric encryption algorithm, and a Google token is generated based on the private key and a time-based one-time password algorithm in combination with a two-factor authentication mechanism, and the user's identity is authenticated using the Google token. No third-party authentication is required during the authentication process, the operation is simple, and the authentication efficiency is improved. Moreover, the user password is never transmitted in the channel, which reduces the possibility of the password and the password transformation method being stolen, thereby improving the security of the user password. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 A flow chart of a method for encrypting a user password provided in an embodiment of the present application;
[0049] Figure 2 An interactive diagram of a method for encrypting a user password provided in an embodiment of the present application;
[0050] Figure 3 A schematic diagram of the structure of a user password encryption device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0052] In order to facilitate further understanding of the technical solution provided by this application, the background technology involved in this application will be explained below.
[0053] In the current static password technology, the password entered by the user for each login verification is the same, and needs to be transmitted in the computer memory and over the network, so it is easy to be intercepted by Trojan programs or network monitoring devices. In addition, in order to avoid forgetting passwords, users often use easy-to-remember information such as birthdays, phone numbers, etc. as passwords, or use simpler strings as passwords, which increases the possibility of passwords being stolen or cracked.
[0054] Symmetric encryption algorithms or asymmetric encryption algorithms are commonly used to encrypt passwords before transmission. However, since the encryption algorithm is fixed and public, there is a risk of being cracked, and the key must be managed, and sometimes third-party authentication is involved. The operation method is complicated and costly. Another security measure is to use a dynamic password card to generate a dynamic password. Users can enter the current dynamic password to log in. Although this improves the security of user identity information to a certain extent, the dynamic password card itself has no security measures and there is still a risk of user identity theft.
[0055] In order to overcome the above technical problems, the embodiment of the present application provides a method and device for encrypting a user password. When executing the method, first obtain the plain text password input by the user; then use the key generated by the encryption algorithm to encrypt the plain text password to obtain the encrypted user password; wherein the key includes a public key and a private key; then according to the private key and the time-based one-time password algorithm, combined with the two-factor authentication mechanism, generate a Google token, and the Google token is used to verify the user identity; finally, store the encrypted user password in a local database. In the above manner, the plain text password is encrypted using the public key generated by the RSA asymmetric encryption algorithm, and the Google token is generated according to the private key and the time-based one-time password algorithm, combined with the two-factor authentication mechanism, and the user identity is authenticated using the Google token. No third-party authentication is required during the authentication process, the operation is simple, and the authentication efficiency is improved. Moreover, the user password is never transmitted in the channel, which reduces the possibility of the password and the password transformation method being stolen, thereby improving the security of the user password.
[0056] See also Figure 1 , Figure 1 A flowchart of a method for encrypting a user password provided in an embodiment of the present application. The method in the embodiment of the present application can be executed by a user password encryption device, which can be implemented in software and can generally be integrated into a terminal device.
[0057] The method may include:
[0058] Step S101: Obtain the plain text password input by the user.
[0059] In the embodiment of the present application, the user password encryption device first obtains the plain text password input by the user through the user interface or program interface, so as to subsequently encrypt the plain text password.
[0060] Step S102: Encrypt the plain text password using a key generated by an encryption algorithm to obtain an encrypted user password, wherein the key includes a public key and a private key.
[0061] In this embodiment, after obtaining the plain text password input by the user in step S101, the plain text password is encrypted using a key generated by an encryption algorithm to obtain an encrypted user password, wherein the key includes a public key and a private key.
[0062] In a possible implementation, the encryption algorithm is an RSA asymmetric encryption algorithm.
[0063] RSA asymmetric encryption algorithm is an asymmetric encryption algorithm based on number theory. It uses a pair of keys for encryption and decryption, including a public key and a private key. The public key can be made public, while the private key is only known to the owner. Information encrypted with the public key can only be decrypted with the private key, and vice versa.
[0064] Specifically, when using the RSA asymmetric encryption algorithm, a pair of keys, namely a public key and a private key, is generated. This pair of keys has a special property: data encrypted with the public key can only be decrypted with the private key, and vice versa. The plaintext password is encrypted using the public key in the pair of keys to obtain an encrypted user password. This encrypted password can only be decrypted using the corresponding private key to obtain the original plaintext password. This encryption method ensures data security because even if the encrypted password is leaked, it cannot be decrypted to obtain the original plaintext password without the private key.
[0065] In a possible implementation, the method further includes:
[0066] Save the public key and private key to the specified directory file.
[0067] Specifically, the user password encryption device saves the generated RSA public key and private key to a specific location (ie, a designated directory) of the computer file system in order to facilitate the subsequent use and management of these keys.
[0068] In a possible implementation, after the public key and the private key are saved in a designated directory file, the method further includes: setting access rights for the directory file, where the access rights are used to verify the identity of the accessing user.
[0069] Specifically, in practical applications, the preservation of public and private keys is very important because they are the key to encrypting and decrypting data. Saving the keys in a specified directory file ensures that they can be easily found and used when needed. At the same time, it is also necessary to ensure the security of these key files to prevent unauthorized access or disclosure.
[0070] Therefore, when saving public and private keys, you usually choose a secure directory and set appropriate file permissions. The access permissions are used to verify the identity of the accessing user to ensure that only authorized users or programs can access these keys.
[0071] Step S103: Generate a Google token based on the private key and the time-based one-time password algorithm in combination with a two-factor authentication mechanism. The Google token is used to verify the user's identity.
[0072] In this step, after the plain text password is encrypted by the key generated by the encryption algorithm in step S102 to obtain the encrypted user password, a Google token is generated based on the private key and the time-based one-time password algorithm in combination with the two-factor authentication mechanism. The Google token is used to verify the user's identity.
[0073] Time-based One-time Password (TOTP): This is an algorithm used to generate one-time passwords that are valid for a period of time and then expire. The TOTP algorithm is usually used in conjunction with some kind of time synchronization mechanism to ensure the validity of the password.
[0074] Two-factor authentication: This is an authentication method that requires the user to provide two different types of authentication factors. Typically, these factors include something the user knows (such as a password) and something the user has (such as a mobile phone or token generator).
[0075] Google Token: This is an authentication token developed by Google and is often used for two-factor authentication. It can be a physical device or a mobile phone app that generates one-time passwords.
[0076] It is understood that the present application generates a Google token by using a private key, TOTP algorithm and two-factor authentication mechanism, which is then used to verify the identity of the user. This mechanism improves the security of authentication because even if the user's password is leaked, a valid authentication token cannot be generated without the private key and token generator.
[0077] Step S104: storing the encrypted user password in a local database.
[0078] Specifically, after generating a Google token according to the private key and a time-based one-time password algorithm in combination with a two-factor authentication mechanism in step S103, the encrypted user password is further stored in a local JSON database.
[0079] It is understandable that the present application saves the encrypted password data to a local database system of the computer. A database is a software system for storing and managing data, which can efficiently store, retrieve and update large amounts of data. Storing the encrypted password in the database facilitates subsequent user identity authentication and management, thereby protecting the security and privacy of the user's password.
[0080] In a possible implementation, after storing the encrypted user password in the local database, the method further includes:
[0081] Classifying the encrypted user passwords to obtain classified encrypted user passwords;
[0082] The classified and encrypted user passwords are backed up.
[0083] Specifically, in the embodiment of the present application, the encrypted user passwords are classified according to certain rules or standards. The purpose of classification may be to better manage and retrieve passwords, or to group passwords according to factors such as password usage, user type, security level, etc. The classified encrypted passwords will be easier to process and analyze later.
[0084] Backup means copying the classified encrypted passwords to another storage location to prevent the original data from being lost or damaged. Backup is an important measure for data security, which can ensure that data can be restored in the event of an accident. Here, backing up the classified encrypted passwords is to protect the security and availability of user passwords.
[0085] It is understandable that the present application performs two steps of classification and backup after storing the encrypted user password in the local database. These two steps are intended to better manage and protect user passwords and ensure the security and availability of data.
[0086] It can be seen from the above technical solution that the embodiment of the present application first obtains the plain text password input by the user; then the plain text password is encrypted using the key generated by the encryption algorithm to obtain the encrypted user password; wherein the key includes a public key and a private key; then a Google token is generated based on the private key and a time-based one-time password algorithm in combination with a two-factor authentication mechanism, and the Google token is used to verify the user's identity; finally, the encrypted user password is stored in a local database. In the above manner, the plain text password is encrypted using the public key generated by the encryption algorithm, and a Google token is generated based on the private key and a time-based one-time password algorithm in combination with a two-factor authentication mechanism, and the user's identity is authenticated using the Google token. No third-party authentication is required during the authentication process, the operation is simple, and the authentication efficiency is improved. Moreover, the user password is never transmitted in the channel, which reduces the possibility of the password and the password transformation method being stolen, thereby improving the security of the user password.
[0087] In a possible implementation, the method further includes:
[0088] Receive a request for querying the user password, wherein the request includes a Google code input by the user, and the Google code is a one-time verification code generated by the Google token;
[0089] Verifying the Google code according to the Google token;
[0090] If the verification is successful, the encrypted user password is decrypted using the private key to obtain the plaintext password;
[0091] Enter the plain text password into the clipboard.
[0092] Specifically, the encryption device receives a request for querying a user password, wherein the request includes a Google code input by the user, and the Google code is a one-time verification code generated by a Google token.
[0093] The cryptographic device uses a Google token to verify that the Google code entered by the user is valid. This process is to ensure that the request is initiated by the legitimate user and is a one-time request for added security.
[0094] If the Google code verification is passed, the encryption device will use the private key to decrypt the encrypted user password stored in the database. The private key is a key paired with the public key and is used to decrypt data encrypted by the public key. After the decryption process is completed, the user's plaintext password, that is, the original password without encryption, is obtained.
[0095] Finally, the encryption device copies the plaintext password to the clipboard so that the user can paste it into other applications or fields.
[0096] It can be understood that the embodiment of the present application generates a Google token based on a private key and a time-based one-time password algorithm, combined with a two-factor authentication mechanism, and uses the Google token to authenticate the user's identity. No third-party authentication is required during the authentication process, the operation is simple, and the authentication efficiency is improved.
[0097] In a possible implementation, verifying the Google code according to the Google token includes:
[0098] A verification Google code generated according to the Google token is compared with the Google code;
[0099] If the verification Google code is consistent with the Google code, the verification is successful.
[0100] In this embodiment, the encryption device uses the Google token to generate a verification Google code. The verification Google code is a one-time verification code for comparison with the Google code input by the user.
[0101] If the verification Google code generated by the encryption device is exactly the same as the Google code entered by the user, the verification is successful, which means that the request is initiated by a user holding a valid Google token and can therefore be considered a legitimate request.
[0102] It is understandable that the embodiment of the present application uses the Google token to generate a verification Google code and compares it with the Google code entered by the user. If the two are consistent, the verification is passed, indicating that the request is legitimate. This process is to increase security and ensure that only users holding valid Google tokens can query or operate their passwords.
[0103] In order to further understand the technical solution of the present application, the embodiments of the present application are described below in combination with specific application scenarios:
[0104] See also Figure 2 , which is an interactive diagram of the user password encryption method provided in an embodiment of the present application.
[0105] like Figure 2 As shown, the encryption device uses the Google token Google code (a secret key associated with a user account, usually used to generate a one-time verification code) to verify the Google code entered by the user. This process is to ensure that the request is initiated by a legitimate user.
[0106] If the Google code entered by the user is verified, the encryption device will use the index key to query the encrypted user password stored in DataJSON (a database that stores data in JSON format).
[0107] The encryption device uses a private key generated by the RSA asymmetric encryption algorithm to decrypt the queried encrypted user password.
[0108] After the decryption process is completed, the encryption device will obtain the user's plain text password and send it to the user.
[0109] It can be understood that the present application uses the public key generated by the RSA asymmetric encryption algorithm to encrypt the plaintext password, and generates a Google token based on the private key and the time-based one-time password algorithm, combined with the two-factor authentication mechanism, and uses the Google token to authenticate the user's identity. No third-party authentication is required during the authentication process, the operation is simple, and the authentication efficiency is improved. Moreover, the user password is never transmitted in the channel, which reduces the possibility of the password and the password transformation method being stolen, thereby improving the security of the user password.
[0110] For the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the order of the actions described, because according to the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0111] The above are some specific implementations of the method for encrypting a user password provided in the embodiment of the present application. Based on this, the present application also provides a corresponding device. The following will introduce the device for encrypting a user password provided in the embodiment of the present application from the perspective of functional modularization.
[0112] See also Figure 3 , is a schematic diagram of a structure of a user password encryption device provided in an embodiment of the present application, the device comprising:
[0113] The acquisition module 301 is used to acquire the plain text password input by the user;
[0114] The encryption module 302 is used to encrypt the plain text password using a key generated by an encryption algorithm to obtain an encrypted user password, wherein the key includes a public key and a private key;
[0115] A generating module 303, configured to generate a Google token based on the private key and a time-based one-time password algorithm in combination with a two-factor authentication mechanism, wherein the Google token is used to verify the identity of the user;
[0116] The saving module 304 is used to store the encrypted user password into a local database.
[0117] Optionally, the device further comprises:
[0118] A receiving module, configured to receive a request for querying the user password, wherein the request includes a Google code input by the user, and the Google code is a one-time verification code generated by the Google token;
[0119] A verification module, used for verifying the Google code according to the Google token;
[0120] A decryption module, used to decrypt the encrypted user password using the private key to obtain the plaintext password if the verification is successful;
[0121] An input module is used to input the plain text password into a clipboard.
[0122] Optionally, the verification module is specifically used to:
[0123] A verification Google code generated according to the Google token is compared with the Google code;
[0124] If the verification Google code is consistent with the Google code, the verification is successful.
[0125] Optionally, after storing the encrypted user password in the local database, the device further includes:
[0126] A classification module, used for classifying the encrypted user passwords to obtain classified encrypted user passwords;
[0127] The backup module is used to back up the classified and encrypted user passwords.
[0128] Optionally, the saving module is further used to: save the public key and the private key to a specified directory file.
[0129] It can be seen from the above technical solution that the embodiment of the present application first obtains the plain text password input by the user; then the plain text password is encrypted using the key generated by the encryption algorithm to obtain the encrypted user password; wherein the key includes a public key and a private key; then a Google token is generated based on the private key and a time-based one-time password algorithm in combination with a two-factor authentication mechanism, and the Google token is used to verify the user's identity; finally, the encrypted user password is stored in a local database. In the above manner, the plain text password is encrypted using the public key generated by the encryption algorithm, and a Google token is generated based on the private key and a time-based one-time password algorithm in combination with a two-factor authentication mechanism, and the user's identity is authenticated using the Google token. No third-party authentication is required during the authentication process, the operation is simple, and the authentication efficiency is improved. Moreover, the user password is never transmitted in the channel, which reduces the possibility of the password and the password transformation method being stolen, thereby improving the security of the user password.
[0130] An embodiment of the present application further provides an electronic device, comprising: a memory for storing one or more programs;
[0131] Processor; when the one or more programs are executed by the processor, the user password encryption method described in the above embodiment is implemented.
[0132] An embodiment of the present application further provides a computer storage medium, in which a program is stored. When the program is executed by a processor, the method for encrypting the user password described in the above embodiment is implemented.
[0133] The "first" and "second" in the names such as "first" and "second" (if any) mentioned in the embodiments of the present application are only used as name identifiers and do not represent the first or second in order.
[0134] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0135] Those skilled in the art can understand that the flowchart shown in the figure is only an example in which the embodiments of the present application can be implemented, and the scope of application of the embodiments of the present application is not limited by any aspect of the flowchart.
[0136] In the several embodiments provided in the present application, it should be understood that the disclosed methods, devices and equipment can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0137] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0138] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0139] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for encrypting a user password, characterized in that: The method comprises: Get the plain text password entered by the user; Encrypt the plaintext password using a key generated by an encryption algorithm to obtain an encrypted user password, wherein the key includes a public key and a private key; Generate a Google token based on the private key and a time-based one-time password algorithm in combination with a two-factor authentication mechanism, wherein the Google token is used to verify the identity of the user; The encrypted user password is stored in the local database.
2. The method according to claim 1, characterized in that The method further comprises: Receive a request for querying the user password, wherein the request includes a Google code input by the user, and the Google code is a one-time verification code generated by the Google token; Verifying the Google code according to the Google token; If the verification is successful, the encrypted user password is decrypted using the private key to obtain the plaintext password; Enter the plain text password into the clipboard.
3. The method according to claim 2, characterized in that The verifying the Google code according to the Google token includes: A verification Google code generated according to the Google token is compared with the Google code; If the verification Google code is consistent with the Google code, the verification is successful.
4. The method according to claim 1, characterized in that: After storing the encrypted user password in the local database, the method further includes: Classifying the encrypted user passwords to obtain classified encrypted user passwords; The classified and encrypted user passwords are backed up.
5. The method according to claim 1, characterized in that The method further comprises: Save the public key and private key to the specified directory file.
6. The method according to claim 1, characterized in that The encryption algorithm is the RSA asymmetric encryption algorithm.
7. The method according to claim 5, characterized in that After saving the public key and the private key to the specified directory file, the method further includes: An access permission is set for the directory file, and the access permission is used to verify the identity of the accessing user.
8. A user password encryption device, characterized in that: The device comprises: The acquisition module is used to obtain the plain text password input by the user; An encryption module, used to encrypt the plain text password using a key generated by an encryption algorithm to obtain an encrypted user password, wherein the key includes a public key and a private key; A generation module, used to generate a Google token based on the private key and a time-based one-time password algorithm in combination with a two-factor authentication mechanism, wherein the Google token is used to verify the identity of the user; The saving module is used to store the encrypted user password into a local database.
9. The device according to claim 8, characterized in that The device also includes: A receiving module, configured to receive a request for querying the user password, wherein the request includes a Google code input by the user, and the Google code is a one-time verification code generated by the Google token; A verification module, used for verifying the Google code according to the Google token; A decryption module, used to decrypt the encrypted user password using the private key to obtain the plaintext password if the verification is successful; An input module is used to input the plain text password into a clipboard.
10. The device according to claim 8, characterized in that The verification module is specifically used for: A verification Google code generated according to the Google token is compared with the Google code; If the verification Google code is consistent with the Google code, the verification is successful.