Password verification method and apparatus, and electronic device and readable storage medium
By generating and matching digest information in the password input interface, the problem of login failure and time consumption caused by users forgetting their passwords is solved, and a fast and secure login process is achieved.
Patent Information
- Application Number
- PCT/CN2025/109601
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-24
- Filing Date
- 2025-07-21
- Publication Date
- 2026-01-29
AI Technical Summary
Forgotten account and password information by users can lead to multiple failed login attempts on electronic devices, resulting in excessively long login times and posing a risk of information leakage.
When displaying account information on the password input interface, a digest of the password is generated by obtaining a portion of the password characters entered by the user and matched with the pre-stored digest information. The verification success message is only displayed when a match is found, avoiding direct matching of account and password and reducing the number of login operations.
It reduces the probability of login failure, lowers the risk of information leakage, and shortens login time while ensuring security.
Smart Images

Figure CN2025109601_29012026_PF_FP_ABST
Abstract
Description
Password verification methods, devices, electronic devices and readable storage media
[0001] This application claims priority to Chinese Patent Application No. 202411000044.4, filed on July 24, 2024, entitled "Password Verification Method, Apparatus, Electronic Device and Readable Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application belongs to the field of information security technology, specifically relating to a cryptographic verification method, apparatus, electronic device, and readable storage medium. Background Technology
[0003] Typically, when a user wants to log in to an application on their electronic device, if the user has forgotten the account information and password information previously created for that application, the user can trigger the electronic device to perform login operations one by one using the account information and password information the user has remembered, until the account information and password information remembered by the user match the previously created account information and password information, thus allowing the electronic device to log in to the application.
[0004] However, due to the possibility that the electronic device may fail to log in multiple times, it may be unable to use the user's remembered account information and corresponding password information to log in for a long time. In this case, the user may need to wait for a long time before they can log in again using the remembered account information and corresponding password information. Therefore, the electronic device may need to wait for a long time to log in to the above-mentioned applications, resulting in a longer time consumption for logging into the application. Summary of the Invention
[0005] The purpose of this application is to provide a password verification method, device, electronic device, and readable storage medium that can reduce the probability of a user being unable to perform a login operation for a long time due to multiple failed login attempts. Therefore, it can reduce the waiting time required for users to log in to applications, thereby reducing the time spent logging into applications on electronic devices.
[0006] In a first aspect, embodiments of this application provide a password verification method, the method comprising: when displaying first account information in a password input interface, acquiring first verification information input by a user, the first verification information comprising N first password characters, where N is a positive integer; generating first digest information based on M of the N first password characters, where M is a positive integer less than or equal to N; and displaying verification success information when the first digest information and the second digest information associated with the first account information match; wherein the verification success information is used to indicate that the first verification information and the second verification information corresponding to the first account information match, the second verification information comprising M second password characters, and the second digest information being generated based on the M second password characters.
[0007] Secondly, embodiments of this application provide a password verification device, comprising: an acquisition module, configured to acquire first verification information input by a user when first account information is displayed on a password input interface, the first verification information including N first password characters, where N is a positive integer; a processing module, configured to generate first digest information based on M of the N first password characters included in the first verification information acquired by the acquisition module, where M is a positive integer less than or equal to N; and a display module, configured to display verification success information when the first digest information generated by the processing module matches second digest information associated with the first account information. The verification success information indicates that the first verification information and the second verification information corresponding to the first account information match; the second verification information includes M second password characters, and the second digest information is generated based on the M second password characters.
[0008] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0009] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0010] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the steps of the method described in the first aspect.
[0011] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the steps of the method described in the first aspect.
[0012] In this embodiment, when the first account information is displayed on the password input interface, the electronic device can obtain first verification information, including N first password characters (where N is a positive integer), input by the user, and generate first digest information, where M is a positive integer less than or equal to N, based on M of the N first password characters. If the first digest information matches the second digest information associated with the first account information, the electronic device can display verification success information. The verification success information indicates that the first verification information matches the second verification information corresponding to the first account information. The second verification information includes M second password characters, and the second digest information is generated based on these M second password characters. Since the first account information is associated with the second digest information, and this second digest information is generated based on the M second password characters included in the second verification information, meaning the second digest information is related to these M second password characters, and after the electronic device obtains the first verification information, it can generate the first digest information based on at least a portion of the first password characters (i.e., the M first password characters) included in the first verification information, meaning the first digest information is related to these M first password characters, after generating the first digest information, the electronic device can determine that the M first password characters and the M second password characters match if the first digest information and the second digest information match, thus confirming that the first verification information and the second verification information match. At this point, the electronic device can indicate to the user that the first verification information and the second verification information match by displaying a verification success message, so that the user can determine that the first verification information and the second verification information match through this verification success message, and further confirm that the first verification information and the second verification information match. Only when a match is found will the electronic device be triggered to perform a login operation using the password information corresponding to the first account information and the first verification information. Instead of triggering the login operation based on the first account information and the corresponding password information if it cannot be determined that the first and second verification information match, this reduces the probability of login failures and consequently reduces the likelihood of prolonged periods without access to the account information and corresponding password due to multiple login failures. This reduces the waiting time required for users to log in to applications. Furthermore, since the first account information is associated with the second digest information, rather than directly with the second verification information, the probability of leakage of the password information corresponding to the second verification information is reduced, thus reducing the probability of application information leakage within the electronic device. Therefore, while ensuring the security of application information within the electronic device, the time required for logging into applications can be reduced. Attached Figure Description
[0013] Figure 1 is a flowchart of one of the password verification methods provided in the embodiments of this application;
[0014] Figure 2A is one of the schematic diagrams of a mobile phone interface provided in an embodiment of this application;
[0015] Figure 2B is a second schematic diagram of the mobile phone interface provided in the embodiment of this application;
[0016] Figure 3 is a third schematic diagram of the mobile phone interface provided in the embodiment of this application;
[0017] Figure 4 is a second schematic flowchart of the password verification method provided in the embodiments of this application;
[0018] Figure 5A is a fourth schematic diagram of the mobile phone interface provided in the embodiment of this application;
[0019] Figure 5B is the fifth schematic diagram of the mobile phone interface provided in the embodiment of this application;
[0020] Figure 6 is a third flowchart illustrating the password verification method provided in this application embodiment;
[0021] Figure 7 is a fourth flowchart illustrating the password verification method provided in the embodiments of this application;
[0022] Figure 8 is a fifth flowchart illustrating the password verification method provided in the embodiments of this application;
[0023] Figure 9 is a flowchart of the password verification method provided in the embodiments of this application, number six;
[0024] Figure 10 is a schematic diagram of the electronic device generating first verification information in the password verification method provided in the embodiment of this application;
[0025] Figure 11 is a flowchart of the password verification method provided in the embodiment of this application (the seventh one).
[0026] Figure 12 is a schematic diagram of the electronic device generating first digest information in the cryptographic verification method provided in the embodiments of this application;
[0027] Figure 13 is a schematic diagram of the structure of the password verification device provided in an embodiment of this application;
[0028] Figure 14 is one of the hardware structure diagrams of the electronic device provided in the embodiments of this application;
[0029] Figure 15 is a second schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0031] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0032] The following description, in conjunction with the accompanying drawings, details the password verification method, apparatus, electronic device, and readable storage medium provided in the embodiments of this application through specific implementations and application scenarios.
[0033] The password verification method provided in this application is applied to scenarios where users trigger the login request of electronic devices.
[0034] In a specific application scenario, in the relevant technology, suppose a user wants to trigger an electronic device to log in to application 'a' on the electronic device, and the user previously created an account information of a123456 using application 1, and the password information corresponding to this account information is b123456. If the user has forgotten the password for account information a123456, they can first recall the possible passwords for account information a123456 (i.e., commonly used passwords), such as passwords c123456, b112233, b112244, and b123456. Then, they can use account information a123456 and password c123456 to log in. If the login attempt fails, they can use account information a123456 and password b112233 to log in, and so on. Finally, if the login attempt fails again, the user can use account information a123456 and password b123456 to log in. At this point, the electronic device can log in to application 1. However, in the above steps, when a user attempts to log in using account information a123456 and password information b112233, and the login attempt fails, there may be a situation where, due to a large number of failed login attempts, the user cannot attempt to log in again using account information a123456 for a considerable period of time (e.g., 5 minutes). In this case, the user needs to wait 5 minutes before attempting to log in again using account information a123456 and password information b112244. If this attempt fails again, there may be a similar situation where, due to a large number of failed login attempts, the user cannot attempt to log in again using account information a123456 for a considerable period of time (e.g., 30 minutes). In this case, the user needs to wait a considerable amount of time (i.e., 35 minutes) to log in to application 1, thus resulting in a long login time for the electronic device.
[0035] However, in this embodiment, the electronic device pre-stores the association between account information a123456 and digest information a1cd3fcd. This digest information a1cd3fcd is generated from verification information 2 in password information b123456 (which may include some password characters b1234 from password information b123456). Thus, the user can input account information a123456 and password information c123456 into the password input interface of application 1, allowing the electronic device to generate digest information c123456 based on verification information 1 in password information c123456 (e.g., verification information 1 includes some password characters c1234 from password information c123456). 3a1df2c, and if it is determined that the digest information a1cd3fcd and the digest information c3a1df2c do not match, a verification failure message can be displayed or no prompt message can be displayed. The verification failure message is used to indicate that verification information 2 and verification information 1 do not match, so that the user can determine that the password information c123456 and the password information b123456 may not match, and continue to enter the account information a123456 and the password information b112233 in the password input interface of application 1, so that the electronic device can generate digest information b1 based on the verification information 3 in the password information b112233 (for example, the verification information 3 includes part of the password characters b1122 in the password information b112233). If the digest information a1cd3fcd and the digest information b1b8ed2e do not match, a verification failure message is displayed or no message is displayed. This verification failure message indicates that verification information 2 and verification information 3 do not match, so the user knows that password information b112233 and password information b123456 may not match, and continues to enter account information a123456 and password information b112244 in the password input interface of application 1. This allows the electronic device to generate digest information b1b8 based on verification information 4 in password information b112244 (for example, verification message 4 includes part of the password characters b1122 in password information b112244). If the digest information a1cd3fcd and the digest information b1b8ed2e do not match, a verification failure message is displayed or no message is displayed. This verification failure message indicates that verification information 2 and verification information 4 do not match, so the user can determine that password information b112244 and password information b123456 do not match, and continue to enter account information a123456 and password information b123456 in the password input interface of application 1. This allows the electronic device to generate digest information a1cd3fcd based on verification information 5 in password information b123456 (for example, verification message 5 includes part of the password characters b1234 in password information b123456).If the summary information a1cd3fcd matches the summary information a1cd3fcd, a verification success message is displayed, which indicates that verification information 2 and verification information 5 match. In this way, the user can confirm that verification information 2 and verification information 5 match, and use account information a123456 and the password information corresponding to verification information 5 (i.e., password information b123456) to perform the login operation, without triggering the electronic device to perform the login operation one by one using account information a123456 and each incorrect password information. Therefore, the probability of the electronic device failing to perform the login operation can be reduced, thereby reducing the probability of the electronic device being unable to perform the login operation for a long time due to multiple login operation failures, and thus reducing the waiting time required for the user to log in to application 1. Furthermore, since account information a123456 is associated with digest information a1cd3fcd, rather than directly associated with password information b123456, the probability of password information b123456 being leaked can be reduced, thereby reducing the probability of information leakage in application 1. In this way, the time spent logging into the application on the electronic device can be reduced while ensuring the security of application information in the electronic device.
[0036] It should be noted that the password verification method provided in this application can be executed by electronic devices such as mobile phones, tablets, laptops, PDAs, and in-vehicle electronic devices. Some embodiments of this application use a mobile phone as the executing entity to illustrate the password verification method provided in this application.
[0037] This application provides a password verification method. Figure 1 shows a flowchart of a password verification method provided by this application. As shown in Figure 1, the password verification method provided by this application may include the following steps 101 to 103.
[0038] Step 101: When the electronic device displays the first account information on the password input interface, it obtains the first verification information entered by the user.
[0039] In some embodiments of this application, the password input interface can be the application login interface of a first application. The application type of the first application can be any of the following: chat, music, video, game, tutorial, etc. Of course, the application type of the first application can also be other types, which are not limited in this embodiment.
[0040] In some embodiments of this application, the aforementioned first account information may be account information created by the user using the first application.
[0041] In this embodiment of the application, the first verification information includes N first password characters, where N is a positive integer.
[0042] In some embodiments of this application, the aforementioned first verification information may be at least a portion of the password information recalled by the user from the password information corresponding to the first account information. It is understood that the first verification information may include at least a portion of the password characters recalled by the user from the password information corresponding to the first account information.
[0043] In some embodiments of this application, the aforementioned N first password characters can be all the password characters included in the first verification information. The first password characters can be any of the following: English letters, numbers, symbols, etc. Of course, the first password characters can also be other characters, and this application embodiment does not limit this.
[0044] In some embodiments of this application, when an electronic device opens a first application, the electronic device can first determine whether the first application has enabled the password mnemonic function. If the electronic device determines that the first application has enabled the password mnemonic function, it can display a first window containing a first prompt message. This first prompt message prompts the user whether assistance in verifying password information is required. Then, based on the user's input of this first prompt message, the electronic device can display an account input box and a password input box in the first window. The account input box is used to input account information, and the password input box is used to input verification information. In this way, the electronic device can display the first account information entered by the user in the account input box, and obtain the first verification information based on the user's input of the first verification information in the password input box.
[0045] In some examples, when an electronic device determines that the password mnemonic function of the first application has been enabled, it can display a first window floating on the interface of the first application to avoid the content of the first application interface from obscuring the first window, thereby ensuring that the user can see the first prompt information.
[0046] In some examples, a first control and a second control are also displayed on the first prompt message. The first control is used to trigger the electronic device to cancel the display of the first window, and the second control is used to trigger the electronic device to display the account input box and the password input box. Thus, the electronic device can display the account input box and the password input box in the first window based on the user's input to the second control (e.g., clicking to input).
[0047] In some examples, a third control is also displayed in the account input box. This third control is used to trigger the electronic device to display at least one historical account information, which includes first account information. Thus, the electronic device can display at least one historical account information in a first window based on the user's input to the third control (e.g., click input), and display the first account information in the account input box based on the user's input to the first account information (e.g., click input).
[0048] In some examples, the electronic device can display the first verification information in the password input box based on the user's input of the first verification information.
[0049] For example, let's take a mobile phone as an example. Assume the phone displays the application interface 1 of the first application, and the phone determines that the password mnemonic function of the first application is enabled, as shown in Figure 2A. The phone can display a first window 10 floating on the application interface 1. The first window 10 displays a first prompt message, such as "The current application has enabled the password mnemonic function. Do you need to assist in verification?" prompt message 11. The "The current application has enabled the password mnemonic function. Do you need to assist in verification?" prompt message 11 displays a first control and a second control, such as a "No" control 12 and a "Yes" control 13. The "No" control 12 is used to trigger the phone to cancel the display of the first window 10, and the "Yes" control 13 is used to trigger the phone to display the account input box and password input box, so that the user can click on the "Yes" control 13 to input. As shown in Figure 2B, after the user clicks the "Yes" control 13, the mobile phone can update the content displayed in the first window 10 to the account input box 14 and the password input box 15. The user can then enter the first account information 16 in the account input box 14, so that the mobile phone can display the first account information 16 in the account input box 14. The user can also enter the first verification information in the password input box 15, so that the mobile phone can display the first verification information 17 in the password input box 15.
[0050] Step 102: The electronic device generates first digest information based on M of the N first password characters.
[0051] In this embodiment of the application, M is a positive integer less than or equal to N.
[0052] In this embodiment of the application, the above-mentioned M first password characters can be at least a portion of the N first password characters.
[0053] In this embodiment of the application, in order to avoid the number of characters of the M first password characters used to generate the first digest information being different from the number of characters of the second password characters used to generate the second digest information, the electronic device may first determine the number of characters of the M first password characters based on the number of characters of the second password characters used to generate the second digest information. An example will be given below.
[0054] In some embodiments of this application, referring to FIG1 and FIG3, before step 102 above, the password verification method provided in the embodiments of this application may further include the following steps 201 and 202.
[0055] Step 201: The electronic device obtains the first character count.
[0056] In this embodiment of the application, the number of the first character is the number of characters in M second password characters.
[0057] It can be understood that the aforementioned M second password characters are at least a portion of the password information corresponding to the first account information. Specifically, the password information corresponding to the first account information is the password information corresponding to the first account information created by the user using the first application; that is, the electronic device can successfully log in to the first application using the first account information and the password information corresponding to that first account information. The number of the aforementioned first characters equals M.
[0058] It should be noted that the execution order of steps 201 and 101 is not limited in this embodiment. In one example, the electronic device may execute step 101 first and then step 201; in another example, the electronic device may execute step 201 simultaneously with step 101. Figure 3 illustrates the scenario where the electronic device executes step 101 first and then step 201.
[0059] In some embodiments of this application, a first character count (i.e., the number of characters of M second password characters) is pre-stored in the electronic device, so that the electronic device can directly obtain the first character count from the electronic device.
[0060] Step 202: The electronic device determines the first M first password characters from the N first password characters as the M first password characters.
[0061] It is understandable that electronic devices can determine M first password characters from N first password characters.
[0062] In this embodiment, since the number of characters in the first password character that generates the first digest information and the second password character that generates the second digest information are different, even if some password characters in the first password character that generates the first digest information and the second password character that generates the second digest information are the same, the first digest information and the second digest information will still be different. That is, even if the user enters the correct password characters, the first digest information and the second digest information will still be different. Therefore, in order to avoid the above situation, the electronic device can first obtain the number of characters in the first password character that generates the second digest information, and then determine the first M first password characters of the N first password characters as M first password characters to ensure that the number of characters in the first password character that generates the first digest information and the second password character that generates the second digest information are the same.
[0063] Thus, since the electronic device can first obtain the number of first characters of the second password character used to generate the second digest information, and then determine the first M first password characters of the N first password characters as the M first password characters, in subsequent steps, the electronic device can generate the first digest information based on the first password characters whose character count is the same as the number of characters of the second password character used to generate the second digest information. Therefore, it can avoid the situation where the first digest information and the second digest information do not match because the number of characters of the first password character used to generate the first digest information and the second password character used to generate the second digest information are different. This can improve the accuracy of the electronic device in determining whether the first verification information and the second verification information match.
[0064] In some embodiments of this application, the electronic device can use a predetermined algorithm to calculate and generate first digest information based on M first password characters. Specifically, the predetermined algorithm can be a hash algorithm, and the first digest information can be a hash value. Of course, the predetermined algorithm can also be other algorithms, and this application does not limit this.
[0065] The following example illustrates a specific scheme for generating first summary information using electronic devices.
[0066] In some embodiments of this application, before step 102 above, the password verification method provided in the embodiments of this application may further include step 203 below, and step 102 above can be specifically implemented by step 102a below.
[0067] Step 203: The electronic device retrieves the first random number associated with the first account information from the database.
[0068] In some embodiments of this application, the aforementioned first random number is the random number used by the electronic device when generating second digest information based on M second password characters using a predetermined algorithm. It can be understood that when the electronic device generates the second digest information, it can store the first account information, the second digest information, and the first random number in a database, so that the electronic device can retrieve the first random number associated with the first account information from the database based on the first account information.
[0069] Step 102a: The electronic device uses M first password characters and a first random number to calculate the first digest information.
[0070] In some embodiments of this application, the electronic device can use the aforementioned predetermined algorithm to calculate and generate first digest information using M first password characters and a first random number. Specifically, the predetermined algorithm can be a hash algorithm, such as a slow hash algorithm, and the first digest information can be a hash value. Of course, the predetermined algorithm can also be other algorithms, and this application does not limit this.
[0071] It is understandable that, due to the irreversible nature of hash algorithms, other users cannot use the calculated first digest information to deduce the M first password characters, i.e., they cannot deduce the first verification information. Therefore, the probability of the password information corresponding to the first verification information being leaked can be reduced.
[0072] In some examples, the above-mentioned predefined algorithm can be specifically: pwdHash 1 = PBKDF 2(PRF, Password 1, pwdSalt, c, dkLen);
[0073] Where pwdHash1 is the first digest information, PRF is the pseudo-random function, Password1 is the M first password characters, pwdSalt is the salt value (i.e. the first random number), c is the number of iterations, dkLen is the length of the desired output digest information, and PBKDF2 is used to indicate the algorithm formula of the predetermined algorithm.
[0074] Here, the pseudo-random function mentioned above can be a hash function, such as the SHA-256 function; the salt value (i.e., the first random number) can be 8 bytes; the number of iterations can be 1000; and the length of the desired output digest information can be 256 bytes. Of course, the parameters used in the predetermined algorithm can also be other things, and this application embodiment does not limit them.
[0075] Therefore, since the first random number is the random number associated with the first account information, that is, the random number used when generating the second digest information associated with the first account information, after the electronic device obtains the first random number from the database, the electronic device can use the same first password character with the same number of characters as M second password characters and the same random number to generate the first digest information, instead of using the same first password character with the same number of characters as M second password characters and a new random number to generate the first digest information. Therefore, it can avoid the situation where the first digest information and the second digest information are mismatched due to the random number used to generate the first digest information being different from the random number used to generate the second digest information, thereby improving the accuracy of password verification by the electronic device.
[0076] In some embodiments of this application, a third control is also displayed in the first window. The third control is used to trigger the electronic device to generate digest information, so that the electronic device can generate first digest information based on M first password characters according to the user's input to the third control.
[0077] For example, referring to Figure 2B, as shown in Figure 4, a third control is also displayed in the first window 10, such as a "verification" control 18. This "verification" control 18 is used to trigger the mobile phone to generate summary information, so that the electronic device can generate first summary information based on the user's input to the "verification" control 18 (e.g., clicking to input).
[0078] Step 103: If the electronic device matches the second digest associated with the first digest information and the first account information, it displays a verification success message.
[0079] In some embodiments of this application, the above matching can be understood as: identical, or the similarity between the two is greater than or equal to a preset similarity.
[0080] In some embodiments of this application, multiple sets of verification data are pre-stored in the database of the electronic device. Each set of verification data includes associated account information, summary information and random number. Thus, the electronic device can first determine a set of verification data containing the first account information from the multiple sets of verification data, and determine the summary information in the set of verification data as the second summary information, and then determine whether the first summary information and the second summary information match.
[0081] In this embodiment of the application, the above-mentioned successful verification information is used to indicate that the second verification information corresponding to the first verification information and the first account information matches; the second verification information includes M second password characters, and the above-mentioned second digest information is generated based on the M second password characters.
[0082] In this embodiment, the second verification information can be at least a portion of the password information corresponding to the first account information, which is the password information corresponding to the first account information created by the user using the first application. That is, the electronic device can successfully log in to the first application using the first account information and the password information corresponding to that first account information, which is the correct password information for the first account information.
[0083] In some embodiments of this application, the aforementioned M second password characters can be all the password characters included in the second verification information. These second password characters can be any of the following: English letters, numbers, symbols, etc. Of course, the second password characters can also be other characters, and this application does not limit this.
[0084] In this embodiment, if the first digest information and the second digest information match, it can be assumed that the M first password characters and the M second password characters are the same. Alternatively, it can be assumed that the N first password characters and the M second password characters are very likely to be the same. That is, it can be assumed that the password information corresponding to the first verification information and the password information corresponding to the second verification information are very likely to be the same. Therefore, the electronic device can display a verification success message to indicate to the user that the password information corresponding to the first verification information is very likely to match the password information corresponding to the second verification information.
[0085] In one scenario, since users may use frequently used password information when creating account information, the electronic device can use at least M second password characters from the password information corresponding to the first account information (i.e., the password information corresponding to the second verification information, which is the correct password information that can successfully log in to the first account information in the first application) to generate second digest information. The user can then input at least a portion of their frequently used password information (i.e., the first verification information), allowing the electronic device to use the M first password characters from the first verification information to generate first digest information. If the first digest information and the second digest information match, the electronic device will prompt the user with a successful verification message indicating that the input of at least a portion of the frequently used password information (i.e., the first verification information) matches the input of at least a portion of the password information corresponding to the first account information (i.e., the second verification information). This allows the user to quickly recall the correct password information for the first account information and quickly input it.
[0086] In some embodiments of this application, the electronic device may display verification success information in the first window described above.
[0087] For example, referring to Figure 4, as shown in Figure 5A, when the first summary information and the second summary information match, the mobile phone can display a verification success message in the first window 10, such as "Verification result: success!" message 19. This "Verification result: success!" message 19 is used to indicate that the first verification information and the second verification information match, so that the user can know that the input first verification information and the second verification information match.
[0088] In some embodiments of this application, step 103 described above may also be replaced by step 104 described below.
[0089] Step 104: If the first digest information and the second digest information do not match, the electronic device displays a verification failure message.
[0090] In this embodiment of the application, the above-mentioned verification failure information is used to indicate that the first verification information and the second verification information do not match.
[0091] For example, referring to Figure 4, as shown in Figure 5B, if the first summary information and the second summary information do not match, the mobile phone can display a verification failure message in the first window 10, such as "Verification result: fail!" message 20. This "Verification result: fail!" message 20 is used to indicate that the first verification information and the second verification information do not match, so that the user can know that the first verification information and the second verification information entered do not match.
[0092] Therefore, since the electronic device can display a verification failure message when the first and second summary information do not match, it can notify the user that the first and second verification information do not match. This can prevent the user from using the first account information and an incorrect password to perform the login operation. Thus, it can avoid the situation where the electronic device fails to perform the login operation, thereby avoiding the situation where the electronic device cannot perform the login operation for a long time due to multiple login failures, and thus reducing the waiting time required for users to log in to the application.
[0093] In summary, in this embodiment, after obtaining the first account information and the first verification information, the electronic device does not directly perform a login operation. Instead, it generates first digest information based on M first password characters. If the first digest information and the second digest information match, the device prompts the user to match the first verification information and the second verification information. This allows the user to know whether the first verification information and the second verification information match without the electronic device performing a login operation. Thus, if no successful verification message is displayed, i.e., if the first verification information and the second verification information do not match, the user can re-enter the recalled verification information until the input verification information and the second verification information match, triggering the electronic device to perform a login operation. Therefore, the probability of the electronic device failing to perform login operations multiple times can be reduced. Furthermore, since the electronic device only stores the first account information and the second digest information, instead of the first account information and the second verification information, and only uses the first digest information and the second digest information in the above verification process, instead of the first verification information and the second verification information, the probability of deciphering the first verification information and / or the second verification information can be reduced. This avoids the probability of obtaining the password information corresponding to the first verification information and / or the password information corresponding to the second verification information, thereby ensuring the security of application information in the electronic device.
[0094] This application provides a password verification method. When a first account information is displayed on the password input interface, the electronic device can obtain first verification information, including N first password characters (N is a positive integer), input by the user. Based on M of the N first password characters, a first digest information is generated, where M is a positive integer less than or equal to N. If the first digest information matches the second digest information associated with the first account information, the electronic device can display a verification success message. The verification success message indicates that the first verification information matches the second verification information corresponding to the first account information. The second verification information includes M second password characters, and the second digest information is generated based on these M second password characters. Since the first account information is associated with the second digest information, and this second digest information is generated based on the M second password characters included in the second verification information, meaning the second digest information is related to these M second password characters, and after the electronic device obtains the first verification information, it can generate the first digest information based on at least a portion of the first password characters (i.e., the M first password characters) included in the first verification information, meaning the first digest information is related to these M first password characters, after generating the first digest information, the electronic device can determine that the M first password characters and the M second password characters match if the first digest information and the second digest information match, thus confirming that the first verification information and the second verification information match. At this point, the electronic device can indicate to the user that the first verification information and the second verification information match by displaying a verification success message, so that the user can determine that the first verification information and the second verification information match through this verification success message, and further confirm that the first verification information and the second verification information match. Only when a match is found will the electronic device be triggered to perform a login operation using the password information corresponding to the first account information and the first verification information. Instead of triggering the login operation based on the first account information and the corresponding password information if it cannot be determined that the first and second verification information match, this reduces the probability of login failures and consequently reduces the likelihood of prolonged periods without access to the account information and corresponding password due to multiple login failures. This reduces the waiting time required for users to log in to applications. Furthermore, since the first account information is associated with the second digest information, rather than directly with the second verification information, the probability of leakage of the password information corresponding to the second verification information is reduced, thus reducing the probability of application information leakage within the electronic device. Therefore, while ensuring the security of application information within the electronic device, the time required for logging into applications can be reduced.
[0095] The following example illustrates a specific scheme for storing verification data in a database using electronic devices.
[0096] In some embodiments of this application, referring to FIG1 and FIG6, before step 101 above, the password verification method provided in the embodiments of this application may further include the following steps 301 to 303.
[0097] Step 301: The electronic device obtains the first account information and the first password information entered by the user.
[0098] In this embodiment of the application, the first password information includes L second password characters, where L is a positive integer greater than or equal to M.
[0099] It can be understood that the above M second password characters are at least some of the password characters among the L second password characters.
[0100] In some embodiments of this application, when a password input interface is displayed, the user can enter first account information and first password information on the password input interface. The electronic device can then retrieve the first account information and first password information by calling the autofill capability through system capabilities. This autofill capability can be the AutofillService capability in Android.
[0101] In some embodiments of this application, the first password information can be understood as: the password information corresponding to the second verification information, that is, the correct password information that can be used to successfully log in to the first account information in the first application.
[0102] Step 302: If the electronic device successfully performs a login operation using the first account information and the first password information, it generates second digest information based on M of the L second password characters.
[0103] In some embodiments of this application, a "login" control is also displayed in the password input interface, so that the electronic device can perform a login operation using the first account information and the first password information according to the user's input to the "login" control (e.g., clicking to enter), and if the login operation is successfully performed using the first account information and the first password information, a second digest information is generated based on M of the L second password characters.
[0104] It should be noted that for explanations regarding the successful login operation of an electronic device using the first account information and the first password information, please refer to the specific descriptions in related technologies, and the embodiments of this application will not be repeated here.
[0105] In some embodiments of this application, the electronic device may first determine M second password characters from L second password characters, and then generate second digest information based on the M second password characters.
[0106] The following example illustrates a specific scheme for an electronic device to determine M second password characters from L second password characters.
[0107] In some embodiments of this application, referring to FIG6 and FIG7, before step 302 above, the password verification method provided in the embodiments of this application may further include the following steps 304 and 305.
[0108] Step 304: The electronic device determines the ratio of the second character count to the first value as the third character count.
[0109] In this embodiment of the application, the number of the second character is the number of L second password characters, and the number of the third character is the number of M second password characters.
[0110] It is understandable that the number of characters in the second character is equal to L, and the number of characters in the third character is equal to M.
[0111] In some embodiments of this application, the first value mentioned above may be a default value or a value entered by the user.
[0112] Step 305: The electronic device determines the first M second password characters of the L second password characters as M second password characters.
[0113] In this embodiment of the application, since there may be a situation where the number of characters L in the L second password characters is relatively large, if the second digest information is generated directly based on the L second password characters, it may result in the second digest information occupying a large amount of storage space. Therefore, the electronic device can first determine the ratio of the number of second characters to the first value as the number of third characters, and then determine the number of the first third characters (i.e., M) of the L second password characters as M second password characters, so as to reduce the storage space occupied by the generated second digest information.
[0114] Thus, it can be seen that since the electronic device can accurately determine the number of third characters M of the second cipher characters required to generate the second digest information based on the number of second characters of the L second cipher characters and the first value, and directly determine the first M second cipher characters of the L second cipher characters as the second cipher characters required to generate the second digest information, instead of directly determining the L second cipher characters as the second cipher characters required to generate the second digest information, the number of characters of the second cipher characters required to generate the second digest information can be reduced, thereby reducing the storage space occupied by the generated second digest information, thus saving storage space of the electronic device.
[0115] In some embodiments of this application, the electronic device can use the aforementioned predetermined algorithm to calculate and generate second digest information using M second password characters and a first random number. Specifically, the predetermined algorithm can be a hash algorithm, and the second digest information can be a hash value. Of course, the predetermined algorithm can also be other algorithms, and this application does not limit this.
[0116] Step 303: The electronic device is associated with the storage of the first account information and the second summary information.
[0117] In some embodiments of this application, the electronic device may store a set of verification data in a database, which includes associated first account information and second digest information.
[0118] In some examples, the above set of verification data also includes at least one of the following: the application ID of the first application and the aforementioned first random number.
[0119] It is understood that electronic devices can execute steps 301 to 303 above multiple times to store multiple sets of verification data in the database.
[0120] The following example illustrates a specific scheme for generating second summary information using electronic devices.
[0121] In some embodiments of this application, step 302 can be implemented by step 302a, and step 303 can be implemented by step 303a.
[0122] Step 302a: If the electronic device successfully performs a login operation using the first account information and the first password information, it calculates the second digest information using M second password characters and the first random number.
[0123] In some embodiments of this application, when an electronic device successfully performs a login operation using the first account information and the first password information, it can first randomly generate a first random number, and then use M second password characters and the first random number to calculate the second digest information.
[0124] In some embodiments of this application, the electronic device can use the aforementioned predetermined algorithm to calculate and generate second digest information using M second password characters and a first random number. Specifically, the predetermined algorithm can be a hash algorithm, such as a slow hash algorithm, and the aforementioned second digest information can be a hash value. Of course, the predetermined algorithm can also be other algorithms, and this application does not limit this.
[0125] It is understandable that, due to the irreversible nature of hash algorithms, other users cannot use the calculated second digest information to deduce the M second password characters, that is, they cannot deduce the second verification information, and thus cannot deduce the password information corresponding to the second verification information (i.e., the correct password information of the first account information). Therefore, the probability of the password information corresponding to the second verification information being leaked can be reduced.
[0126] In some examples, the above-mentioned predefined algorithm can be: pwdHash 2 = PBKDF 2(PRF, Password 2, pwdSalt, c, dkLen);
[0127] Where pwdHash2 is the second digest information, PRF is the pseudo-random function, Password2 is the M second password characters, pwdSalt is the salt value (i.e. the first random number), c is the number of iterations, dkLen is the length of the desired output digest information, and PBKDF2 is used to indicate the algorithm formula of the predetermined algorithm.
[0128] Step 303a: The electronic device stores the first random number, the first account information, and the second summary information in the database.
[0129] Thus, when an electronic device successfully logs in, it can use M second password characters and a first random number to calculate the second digest information and store the first random number, first account information, and second digest information in the database. This ensures that, in subsequent steps, the electronic device can obtain the first random number and second digest information based on the first account information and use the first random number and the M first password characters input by the user to generate the first digest information. This avoids mismatches between the first and second digest information due to differences between the random numbers used to generate the first and second digest information. Furthermore, the electronic device does not need to store the password information corresponding to the first account information and the second verification information (i.e., the correct password information for the first account information), thus reducing the probability of leakage of the password information corresponding to the second verification information. Therefore, while ensuring the security of application information within the electronic device, the accuracy of password verification can be improved.
[0130] In some embodiments of this application, after the electronic device stores multiple sets of verification data in the database, when the electronic device opens the first application, the electronic device can first obtain the application ID of the first application, then determine whether the application ID in the multiple sets of verification data includes the application ID of the first application, and if it is determined that the application ID in the multiple sets of verification data includes the application ID of the first application, it is determined that the first application has enabled the password mnemonic function, so that the electronic device can display the first window in the above embodiments.
[0131] Of course, during the process of using the first application, there may be situations where the user changes the password information corresponding to the first account information (i.e., the correct password information) on other electronic devices. In this case, the electronic device can update the second digest information in the electronic device to ensure the accuracy of verification based on the second digest information. The following will illustrate this with an example.
[0132] In some embodiments of this application, referring to FIG6 and FIG8, after step 303 above, the password verification method provided by the embodiments of this application may further include the following steps 401 to 403.
[0133] Step 401: The electronic device obtains the first account information and the second password information entered by the user.
[0134] In this embodiment of the application, the second password information includes T third password characters, where T is a positive integer.
[0135] In some embodiments of this application, when a password input interface is displayed, the user can enter first account information and second password information on the interface. The electronic device can then retrieve this first account information and second password information by invoking the autofill capability through system capabilities. This autofill capability can be the AutofillService capability in Android.
[0136] Step 402: If the electronic device successfully performs a login operation using the first account information and the second password information, it generates third digest information based on M third password characters out of T third password characters.
[0137] It should be noted that the description of the electronic device determining M third password characters from T third password characters and generating third digest information based on the M third password characters can be found in the above embodiment, which describes the electronic device determining M first password characters from N first password characters and generating first digest information based on the M first password characters. This application embodiment will not repeat the description here.
[0138] Step 403: If the third summary information and the second summary information do not match, the electronic device updates the summary information associated with the first account information from the second summary information to the third summary information.
[0139] In some embodiments of this application, the electronic device can delete the second digest information associated with the first account information from the aforementioned set of verification data in the database, and store the third digest information in the set of verification data.
[0140] Thus, since the electronic device can generate a third digest based on M third password characters and update the digest associated with the first account information from the second digest to the third digest when the login operation is successfully performed using the first account information and the second password information, the probability of the verification result obtained by using the second digest information being inaccurate due to the user modifying the password information corresponding to the first account information on other electronic devices can be reduced, thereby ensuring the accuracy of the verification result obtained by using the digest information.
[0141] The following will illustrate the complete process of the password verification method provided in the embodiments of this application by referring to the solutions in various embodiments.
[0142] As shown in Figure 9, the password verification method provided in this application embodiment may include the following steps:
[0143] Step 501: When the user triggers the electronic device to open the first application, the user can enter the first account information and the second password information in the password input interface of the first application to trigger the electronic device to perform a login operation using the first account information and the second password information. If the login operation is successful, the electronic device can display the first prompt information, which is used to prompt the user whether to use the password mnemonic function, so as to prompt the user whether the password mnemonic function is needed.
[0144] Step 502: If the user selects the password mnemonic function, the electronic device can obtain the first account information and the first password information by calling the autofill capability through the system capability.
[0145] Step 503: The electronic device can determine whether the number L of the L second password characters included in the first password information is greater than or equal to the preset number of characters, so as to determine whether the password length of the first password information supports mnemonic devices.
[0146] Step 504: When the number of characters L of the L second password characters included in the first password information is greater than or equal to the preset number of characters, that is, when the password length of the first password information supports mnemonic devices, referring to Figure 10, the electronic device can determine the ratio of the number of characters L of the L second password characters included in the first password information to the first value set by the user (e.g., 2) as the number of characters L / 2 (i.e., M), and determine the first M second password characters of the L second password characters as M second password characters, and use a slow hash algorithm to generate second digest information (pwdHash2) based on the M second password characters and the first random number (pwdSalt).
[0147] Step 505: Referring to Figure 10, the electronic device can store a set of verification data in the database. This set of verification data includes the application ID of the first application, the first account information (not shown in Figure 10), the first random number (pwdSalt), and the second digest information (pwdHash2).
[0148] Step 506: If the number of characters L of the L second password characters included in the first password information is less than the preset number of characters, that is, if the password length of the first password information does not support mnemonic devices, the electronic device can display a third prompt message. The third prompt message is used to inform the user that the mnemonic function has failed, so that the electronic device can execute the above step 501 again.
[0149] It is understood that after the electronic device performs steps 501 to 505, the electronic device can store the first set of verification data in the database so that in subsequent use, the verification information entered by the user can be verified based on the second summary information to see if it matches the second verification information.
[0150] As shown in Figure 11, the password verification method provided in this application embodiment may further include the following steps:
[0151] Step 507: When the user triggers the electronic device to open the first application and the electronic device displays the password input interface, the electronic device can first obtain the application ID of the first application and determine whether there is any verification data containing the application ID of the first application among the multiple sets of verification data in the database.
[0152] Step 508: If the electronic device determines that the first application has enabled the password mnemonic function when it has verification data including the application ID of the first application, it will display a first window. The first window displays a first prompt message, which is used to prompt the user whether assistance is needed to verify the password information. The user can then choose whether assistance is needed to verify the password information.
[0153] Step 509: The electronic device can update the content displayed in the first window to the account input box and password input box.
[0154] Step 510: The electronic device determines whether at least one account information (i.e., at least one historical account information mentioned above) can be determined from the verification data including the application ID of the first application, that is, the electronic device can determine whether there is a corresponding account.
[0155] Step 511: If the electronic device determines that at least one account information can be identified from the verification data including the application ID of the first application, the electronic device may display a third control in the account input box, so that the user can input the third control to enable the electronic device to display the at least one account information. Then, the user can input the first account information in the at least one account information, so that the electronic device can display the first account information in the account input box and input the first verification information in the password input box.
[0156] Step 512: If the electronic device determines that it cannot determine at least one account information from the verification data including the application ID of the first application, the electronic device may display a fourth prompt message to inform the user that an error has occurred in the application.
[0157] Step 513: The electronic device can determine M first password characters from N first password characters. Referring to Figure 12, the electronic device can first determine the above set of verification data from multiple sets of verification data based on the application ID of the first application and the first account signal (the first account information is not shown in Figure 12). Then, the electronic device uses a slow hash algorithm to generate the first digest information (pwdHash1) based on the M first password characters and the first random number (pwdSalt) in the set of verification data.
[0158] Step 514: The electronic device can determine whether the first digest information (pwdHash1) and the second digest information (pwdHash2) in the above set of verification data match (are equal).
[0159] Step 515: If the first digest information (pwdHash1) and the second digest information (pwdHash2) match, the electronic device can display a verification success message to prompt the user that the first verification information matches the second verification information.
[0160] Step 516: If the first digest information (pwdHash1) and the second digest information (pwdHash2) do not match, the electronic device can display a verification failure message to prompt the user that the first verification information and the second verification information do not match.
[0161] The password verification method provided in this application can be executed by a password verification device. This application uses an example of a password verification device executing the password verification method to illustrate the password verification device provided in this application.
[0162] Figure 13 shows a possible structural schematic diagram of the password verification device involved in an embodiment of this application. As shown in Figure 13, the password verification device 60 may include: an acquisition module 61, used to acquire first verification information input by the user when first account information is displayed in the password input interface, the first verification information including N first password characters, where N is a positive integer; a processing module 62, used to generate first digest information based on M of the N first password characters included in the first verification information acquired by the acquisition module 61, where M is a positive integer less than or equal to N; and a display module 63, used to display verification success information when the first digest information generated by the processing module 62 matches the second digest information associated with the first account information.
[0163] The aforementioned successful verification information is used to indicate that the first verification information and the second verification information corresponding to the first account information match; the second verification information includes M second password characters, and the aforementioned second digest information is generated based on the M second password characters.
[0164] This application provides a password verification device. Since the first account information is associated with second digest information, and the second digest information is generated based on M second password characters included in the second verification information (i.e., the second digest information is related to the M second password characters), and after the password verification device obtains the first verification information, it can generate the first digest information based on at least a portion of the first password characters (i.e., the M first password characters) included in the first verification information (i.e., the first digest information is related to the M first password characters), after generating the first digest information, the password verification device can determine that the M first password characters and the M second password characters match if the first digest information and the second digest information match, thus confirming that the first verification information and the second verification information match. At this time, the password verification device can indicate to the user that the first verification information and the second verification information match by displaying a verification success message, so that the user can determine that the first verification information and the second verification information match through the verification success message, and further confirm the match between the first verification information and the second verification information. The password verification device is only triggered to perform a login operation using the password information corresponding to the first account information and the first verification information if the authentication information matches. Instead of triggering the login operation based on the first account information and the corresponding password information if it cannot be determined that the first and second verification information match, this reduces the probability of the password verification device failing to perform the login operation. This reduces the probability of prolonged periods of inability to use the account information and corresponding password information to log in due to multiple failed login attempts, thus reducing the waiting time for users to log in to applications. Furthermore, since the first account information is associated with the second digest information, rather than directly with the second verification information, the probability of leakage of the password information corresponding to the second verification information is reduced, thereby reducing the probability of application information leakage within the password verification device. Thus, the time consumed by the password verification device to log in to applications can be reduced while ensuring the security of application information within the password verification device.
[0165] In one possible implementation, the acquisition module 61 is further configured to acquire the first account information and first password information input by the user before acquiring the first verification information input by the user when the first account information is displayed on the password input interface. The first password information includes L second password characters, where L is a positive integer greater than or equal to M. The processing module 62 is further configured to generate second digest information based on M of the L second password characters when a login operation is successfully performed using the first account information and first password information acquired by the acquisition module 61; and to store the first account information and the second digest information in association.
[0166] In some embodiments of this application, the processing module 62 is further configured to determine the ratio of the number of second characters to the first value as the number of third characters before generating the second digest information based on M of the L second password characters. The number of second characters is the number of characters in the L second password characters, and the number of third characters is the number of characters in the M second password characters.
[0167] In some embodiments of this application, the processing module 62 is specifically used to calculate the second digest information using M second password characters and a first random number; and to store the first random number, the first account information, and the second digest information in association in the database.
[0168] In some embodiments of this application, the acquisition module 61 is further configured to acquire the first account information and the second password information input by the user after the processing module 62 associates and stores the first account information and the second digest information. The second password information includes T third password characters, where T is a positive integer. The processing module 62 is further configured to generate third digest information based on M of the T third password characters when a login operation is successfully performed using the first account information and the second password information; and to update the digest information associated with the first account information from the second digest information to the third digest information if the third digest information and the second digest information do not match.
[0169] In some embodiments of this application, the acquisition module 61 is further configured to acquire a first character count, which is the number of characters in the M second password characters, before the processing module 62 generates the first digest information based on the M first password characters out of the N first password characters. The processing module 62 is further configured to determine the first M first password characters of the N first password characters as the M first password characters.
[0170] In some embodiments of this application, the acquisition module 61 is further configured to acquire a first random number associated with the first account information from the database before the processing module 62 generates the first digest information based on M of the N first password characters. Specifically, the processing module 62 is configured to calculate the first digest information using the M first password characters and the first random number acquired by the acquisition module 61.
[0171] In some embodiments of this application, the display module 63 is further configured to display verification failure information when the first summary information and the second summary information do not match; wherein the verification failure information is used to indicate that the first verification information and the second verification information do not match.
[0172] The password verification device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific type of device.
[0173] The password verification device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0174] The password verification device provided in this application embodiment can implement the various processes implemented in the method embodiments of Figures 1 to 12. To avoid repetition, it will not be described again here.
[0175] In some embodiments of this application, as shown in FIG14, this application also provides an electronic device 70, including a processor 71 and a memory 72. The memory 72 stores a program or instructions that can be executed on the processor 71. When the program or instructions are executed by the processor 71, they implement the various process steps of the above-described password verification method embodiments and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0176] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0177] Figure 15 is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of this application.
[0178] The electronic device 100 includes, but is not limited to, components such as: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.
[0179] Those skilled in the art will understand that the electronic device 100 may also include a power supply (such as a battery) for powering various components. The power supply may be logically connected to the processor 110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in Figure 15 does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0180] The processor 110 is used to obtain first verification information input by the user when the first account information is displayed on the password input interface. The first verification information includes N first password characters, where N is a positive integer. The processor 110 is used to generate first digest information based on M of the N first password characters, where M is a positive integer.
[0181] The display unit 106 is used to display a verification success message when the first summary information and the second summary information associated with the first account information match.
[0182] In this embodiment of the application, the above-mentioned successful verification information is used to indicate that the second verification information corresponding to the first verification information and the first account information matches; the second verification information includes M second password characters, and the above-mentioned second digest information is generated based on the M second password characters.
[0183] This application provides an electronic device. Since first account information is associated with second digest information, and this second digest information is generated based on M second password characters included in second verification information (i.e., the second digest information is related to the M second password characters), and after the electronic device obtains first verification information, it can generate first digest information based on at least a portion of the first password characters (i.e., the M first password characters) included in the first verification information (i.e., the M first password characters). Thus, after generating the first digest information, the electronic device can determine that the M first password characters and the M second password characters match if the first digest information and the second digest information match, thereby confirming that the first verification information and the second verification information match. At this time, the electronic device can indicate to the user that the first verification information and the second verification information match by displaying a verification success message, allowing the user to determine that the first verification information and the second verification information match through the verification success message. The electronic device is only triggered to perform a login operation using the first account information and the password information corresponding to the first verification information if the second verification information matches. Instead of triggering the login operation based on the first account information and the password information if the first and second verification information cannot be determined to match, this reduces the probability of login failures and consequently the probability of prolonged login attempts being unavailable due to multiple failures. This reduces the waiting time for users to log in to applications. Furthermore, since the first account information is associated with the second digest information, rather than directly with the second verification information, the probability of password information leakage is reduced, thus reducing the probability of application information leakage. In this way, the time spent logging into applications on the electronic device can be reduced while ensuring the security of application information.
[0184] In some embodiments of this application, the user input unit 107 is used to obtain the first account information and the first password information input by the user before obtaining the first verification information input by the user when the first account information is displayed in the password input interface. The first password information includes L second password characters, where L is a positive integer greater than or equal to M.
[0185] The processor 110 is also configured to, when a login operation is successfully performed using the first account information and the first password information, generate second digest information based on M of the L second password characters; and store the first account information and the second digest information in association.
[0186] In some embodiments of this application, the processor 110 is further configured to, before generating second digest information based on M second cryptographic characters out of L second cryptographic characters, determine the ratio of the number of second characters to the first value as the number of third characters, where the number of second characters is the number of characters in the L second cryptographic characters and the number of third characters is the number of characters in the M second cryptographic characters; and determine the first M second cryptographic characters of the L second cryptographic characters as the M second cryptographic characters.
[0187] In some embodiments of this application, the processor 110 is specifically used to calculate the second digest information using M second password characters and a first random number; and to store the first random number, the first account information, and the second digest information in association in a database.
[0188] In some embodiments of this application, the user input unit 107 is further configured to obtain the first account information and the second password information input by the user after the processor 110 associates and stores the first account information and the second digest information. The second password information includes T third password characters, where T is a positive integer.
[0189] The processor 110 is also configured to, when a login operation is successfully performed using the first account information and the second password information, generate third digest information based on M third password characters out of T third password characters; and, if the third digest information and the second digest information do not match, update the digest information associated with the first account information from the second digest information to the third digest information.
[0190] In some embodiments of this application, the processor 110 is further configured to obtain a first character count, which is the number of characters in the M second password characters, before generating first digest information based on M first password characters out of N first password characters; and to determine the first M first password characters of the N first password characters as the M first password characters.
[0191] In some embodiments of this application, the processor 110 is further configured to obtain a first random number associated with the first account information from the database before generating first digest information based on M first password characters out of N first password characters.
[0192] The processor 110 is specifically used to calculate the first digest information using M first password characters and a first random number.
[0193] In some embodiments of this application, the display unit 106 is used to display verification failure information when the first digest information and the second digest information do not match.
[0194] The aforementioned verification failure information is used to indicate that the first verification information and the second verification information do not match.
[0195] It should be understood that, in this embodiment, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0196] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM). The memory 109 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.
[0197] Processor 110 may include one or more processing units; optionally, processor 110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 110.
[0198] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described password verification method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0199] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0200] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described password verification method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0201] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0202] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described password verification method embodiments, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0203] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0204] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0205] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A password verification method, comprising: in a case where first account information is displayed in a password input interface, obtaining first verification information input by a user, the first verification information comprising N first password characters, N being a positive integer; generating first digest information based on M first password characters among the N first password characters, M being a positive integer less than or equal to N; in a case where the first digest information matches second digest information associated with the first account information, displaying verification success information; wherein the verification success information is used to indicate that the first verification information matches second verification information corresponding to the first account information; the second verification information comprising M second password characters, and the second digest information being generated based on the M second password characters.
2. The method of claim 1, wherein, Before the step of, in a case where first account information is displayed in a password input interface, obtaining first verification information input by a user, the method further comprises: obtaining the first account information and first password information input by the user, the first password information comprising L second password characters, L being a positive integer greater than or equal to M; in a case where a login operation is successfully performed using the first account information and the first password information, generating the second digest information based on M second password characters among the L second password characters; storing the first account information and the second digest information in association.
3. The method of claim 2, wherein, Before the step of, generating the second digest information based on M second password characters among the L second password characters, the method further comprises: determining a ratio of a second character number and a first value as a third character number, the second character number being a character number of the L second password characters, and the third character number being a character number of the M second password characters; determining the first M second password characters of the L second password characters as the M second password characters.
4. The method of claim 2, wherein, The step of, generating the second digest information based on M second password characters among the L second password characters, comprises: calculating the second digest information using the M second password characters and a first random number; The step of, storing the first account information and the second digest information in association, comprises: storing the first random number, the first account information, and the second digest information in association in a database.
5. The method of claim 2, wherein, After the step of, storing the first account information and the second digest information in association, the method further comprises: obtaining the first account information and second password information input by the user, the second password information comprising T third password characters, T being a positive integer; in a case where a login operation is successfully performed using the first account information and the second password information, generating third digest information based on M third password characters among the T third password characters; in a case where the third digest information does not match the second digest information, updating the digest information associated with the first account information from the second digest information to the third digest information.
6. The method of claim 1, wherein, Before the first digest information is generated based on the M first password characters from the N first password characters, the method further includes: obtaining a first character number, the first character number being a character number of the M second password characters; determining the first M first password characters from the N first password characters as the M first password characters.
7. The method of claim 1, wherein, Before the first digest information is generated based on the M first password characters from the N first password characters, the method further includes: obtaining a first random number associated with the first account information from a database; the first digest information is generated based on the M first password characters from the N first password characters, including: calculating the first digest information by using the M first password characters and the first random number.
8. The method of claim 1, wherein, The method further includes: in a case where the first digest information and the second digest information do not match, displaying verification failure information; wherein the verification failure information is used to indicate that the first verification information and the second verification information do not match. 9.A password verification apparatus, comprising: an obtaining module configured to, in a case where first account information is displayed in a password input interface, obtain first verification information input by a user, the first verification information including N first password characters, N being a positive integer; a processing module configured to generate first digest information based on M first password characters from the N first password characters included in the first verification information obtained by the obtaining module, M being a positive integer less than or equal to N; a display module configured to, in a case where the first digest information generated by the processing module and second digest information associated with the first account information match, display verification success information; wherein the verification success information is used to indicate that the first verification information and second verification information corresponding to the first account information match; the second verification information including M second password characters, and the second digest information being generated based on the M second password characters. 10.An electronic device, comprising a processor and a memory, the memory storing programs or instructions executable on the processor, the programs or instructions being executed by the processor to implement steps of the password verification method according to any one of claims 1 to 8. 11.A readable storage medium, the readable storage medium storing programs or instructions, the programs or instructions being executed by a processor to implement steps of the password verification method according to any one of claims 1 to 8. 12.A chip, the chip comprising a processor and a communication interface, the communication interface and the processor being coupled, the processor being configured to run programs or instructions to implement steps of the password verification method according to any one of claims 1 to 5. 13.A computer program product, the computer program product being stored in a non-volatile storage medium, the computer program product being executed by at least one processor to implement steps of the password verification method according to any one of claims 1 to 5.
14. An electronic device comprising the electronic device is configured to perform the steps of the password verification method of any one of claims 1 to 5.
Citation Information
Patent Citations
Password authentication method and device
CN104424427A
Password peep-prevention method and user terminal
CN104717064A
Information transmission method, client, server and computer readable storage medium
CN109347835A
Password verification method and device
CN111917728A
Password verification method and device, electronic equipment and storage medium
CN115130076A