Password resetting method, device, apparatus and storage medium

By generating an encrypted result from a historical password and decrypting it to update the current password, the convenience and security issues when users forget their lock screen password are resolved, achieving convenient and secure password reset.

CN122365478APending Publication Date: 2026-07-10SHENZHEN HEYTAP TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510048046.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In existing technologies, when users forget their lock screen password, they can only remove the lock screen function by flashing the ROM, which makes password reset inconvenient and has low security.

Method used

A method is provided to reset the current password by inputting a historical password. The method generates an encrypted result using the historical password and the current password, and decrypts it in the password reset interface to obtain the password to be verified. If the conditions are consistent, the current password is updated.

Benefits of technology

It improves the convenience and security of password reset, ensuring that you can easily update your password even if you forget it, while maintaining a high level of security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122365478A_ABST
    Figure CN122365478A_ABST
Patent Text Reader

Abstract

This application discloses a password reset method, apparatus, device, and storage medium, belonging to the field of encryption technology. The method includes: responding to a historical password input operation within a password reset interface, obtaining a first password, wherein the password reset interface is used to reset the current password by inputting a historical password; decrypting an encryption result using the first password to obtain a password to be verified, wherein the encryption result is generated based on the historical password and the current password; and, if the password to be verified matches the current password, responding to a password reset operation within the password reset interface, updating the current password to a second password indicated by the password reset operation. By employing the solution provided in this application, resetting the current password by inputting a historical password can improve the convenience of password reset while ensuring its security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of encryption technology, and in particular to a password reset method, apparatus, device, and storage medium. Background Technology

[0002] Currently, mobile devices all have a screen lock function, which uses a numeric password or pattern password to lock the screen of the mobile device to prevent accidental operation caused by the screen or buttons coming into contact with other objects while the mobile device is in standby mode. At the same time, it can also protect personal privacy and security.

[0003] In related technologies, during the use of a mobile terminal, the user first needs to enter a pre-set lock screen password on the mobile terminal screen. After the password is verified correctly, the terminal changes from a locked state to an unlocked state, and the user can view and use the software or files stored on the mobile terminal.

[0004] However, if a user forgets their lock screen password, the screen cannot be unlocked, and the user cannot use the device. If the user is unable to unlock the device normally, the only solution is to remove the lock screen function by flashing the ROM, or similar methods, and then use the device. Summary of the Invention

[0005] This application provides a password reset method, apparatus, device, and storage medium, the technical solution of which is as follows:

[0006] On one hand, embodiments of this application provide a password reset method, the method comprising:

[0007] In response to a historical password input operation within the password reset interface, a first password is obtained, wherein the password reset interface is an interface for resetting the current password by inputting a historical password;

[0008] The encryption result is decrypted using the first password to obtain the password to be verified. The encryption result is generated based on the historical password and the current password.

[0009] If the password to be verified is the same as the current password, in response to the password reset operation in the password reset interface, the current password is updated to the second password indicated by the password reset operation.

[0010] On the other hand, embodiments of this application provide a password reset device, the device comprising:

[0011] The first acquisition module is used to acquire the first password in response to the historical password input operation in the password reset interface. The password reset interface is an interface for resetting the current password by inputting a historical password.

[0012] The decryption module is used to decrypt the encryption result using the first password to obtain the password to be verified, wherein the encryption result is generated based on the historical password and the current password;

[0013] An update module is used to update the current password to the second password indicated by the password reset operation in the password reset interface when the password to be verified is the same as the current password.

[0014] On the other hand, embodiments of this application provide a computer device including a processor and a memory, wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the password reset method as described above.

[0015] On the other hand, embodiments of this application provide a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to implement the password reset method as described above.

[0016] On the other hand, embodiments of this application provide a computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the password reset method provided above.

[0017] In this embodiment, for users who have forgotten their current password, a method is provided to reset their current password by inputting a historical password. This method uses the historical password and the current password to generate an encrypted result. Then, within the password reset interface, the user's historical password input is responded to, a first password is obtained, and the encrypted result is decrypted using the first password to obtain the password to be verified. If the password to be verified matches the current password, a password reset operation is initiated, thus resetting the password. Using the solution provided in this embodiment, both the convenience and security of password reset can be improved. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart of a password reset method provided in an exemplary embodiment of this application is shown;

[0020] Figure 2 A schematic diagram of the interface for a password reset process provided in an exemplary embodiment of this application is shown;

[0021] Figure 3 A flowchart of a password reset method provided in another exemplary embodiment of this application is shown;

[0022] Figure 4 A flowchart illustrating the storage of the first cryptographic obfuscation result provided in an exemplary embodiment of this application is shown;

[0023] Figure 5 A flowchart of a password reset method provided in another exemplary embodiment of this application is shown;

[0024] Figure 6 This application illustrates a flowchart of a method for calculating cryptographic obfuscation results using an obfuscation algorithm, provided in an exemplary embodiment.

[0025] Figure 7 This application illustrates a flowchart of decryption via inverse operation of an obfuscation algorithm, provided by an exemplary embodiment.

[0026] Figure 8 This invention provides a structural block diagram of a password reset device according to an exemplary embodiment of the present application.

[0027] Figure 9 A structural block diagram of a computer device provided in an exemplary embodiment of this application is shown. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0029] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0030] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0031] It should be understood that although the terms first, second, etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, a first parameter may also be referred to as a second parameter, and similarly, a second parameter may also be referred to as a first parameter. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0032] First, a brief introduction to the terms used in the embodiments of this application:

[0033] Password reset: refers to the process by which a user recovers or creates a new password through a series of verification steps when they forget or need to change their password.

[0034] Lock screen password: This is a security mechanism used to protect mobile devices (such as smartphones, tablets, etc.) from unauthorized access when they are locked. The lock screen password is set by the user and is used for authentication on the device's lock screen to ensure that only users who know the password can access the device's home screen and internal data.

[0035] To ensure user information security, password setting functions are usually provided for users. For example, when using an application, users can log in to their corresponding user account by entering a verification password, thus using the user account as the unique identifier for the user to use the application; another example is when using a mobile terminal, users can set a lock screen password to authenticate their identity on the lock screen interface.

[0036] In related technologies, when a user forgets their password, a dynamic verification code is typically used to reset the password for security purposes. However, if the lock screen password is forgotten, the only solution is to remove the lock screen function of the mobile device by flashing the ROM and restoring the device to factory settings before it can be used again.

[0037] In this embodiment, to improve the convenience of password reset while ensuring its security, a method is proposed to reset the current password by inputting a historical password. This method uses the historical password and the current password to generate an encrypted result. Then, within the password reset interface, it responds to the user's historical password input, obtains a first password, and decrypts the encrypted result using the first password to obtain the password to be verified. If the password to be verified matches the current password, it responds to the password reset operation, thus resetting the password.

[0038] The password reset method proposed in this application will be described below through specific embodiments.

[0039] Please refer to Figure 1 This document illustrates a flowchart of a password reset method provided in an exemplary embodiment of this application. This embodiment uses the method applied to a computer device as an example for illustration. The method includes the following steps:

[0040] Step 101: In response to the historical password input operation in the password reset interface, obtain the first password. The password reset interface is an interface used to reset the current password by entering a historical password.

[0041] In some embodiments, to ensure the security of user information, a password setting function is typically provided to encrypt user information using the password set by the user. Then, when a user needs to view or use user information, they must enter the correct password to complete user authentication. Considering that users may forget their passwords after setting them, a password reset function can also be provided for user convenience. Furthermore, to ensure the security of user information, security verification is required before using the password reset function.

[0042] Unlike related technologies that rely on obtaining dynamic verification codes to reset the current password, resulting in low security, this application provides a method for users to reset their current password by entering a previous password. This allows users to reset their current password simply by entering the correct previous password into the password reset interface if they forget it.

[0043] Optionally, a historical password refers to the password set by the user before setting the current password. For example, if a user sets their password to A, and then resets the current password by entering the current password, changing password A to password B, then password A is the historical password, and password B is the current password.

[0044] Optionally, the password may include numbers, letters, special characters, and numeric patterns, etc., and this application embodiment does not limit this.

[0045] Optionally, the password reset interface is used to reset the current password by entering a previous password. In one possible implementation, if the user forgets the current password, they can trigger the display of the password reset interface by clicking the corresponding interface activation control.

[0046] Optionally, the password reset interface may include a prompt text and a history password input window. The prompt text prompts the user to enter a history password to reset the current password, and the history password input window receives the user's input of a history password. In one possible implementation, upon receiving a history password input from the user within the password reset interface, the computer device acquires the first password indicated by that history password input.

[0047] Indicative, such as Figure 2 As shown, the computer device responds to the user's historical password input operation in the password reset interface 201, and obtains the first password indicated by the historical password input operation upon receiving a click operation on the historical password input confirmation control.

[0048] Step 102: Decrypt the encryption result using the first password to obtain the password to be verified. The encryption result is generated based on the historical password and the current password.

[0049] In some embodiments, to ensure the security of resetting the current password using a historical password, when a user resets a historical password to the current password, the computer device can first generate an encrypted result based on the historical password and the current password, and save the encrypted result. Then, when the user resets the current password by entering a historical password, the computer device can decrypt the encrypted result using the first password entered by the user, thereby obtaining the password to be verified.

[0050] For example, the historical password is A, the current password is B, the encryption result generated based on the historical password and the current password is N, and the first password indicated by the historical password input operation is A. ′ The password to be verified obtained by decrypting the encryption result using the first password is B. ′ .

[0051] In one possible implementation, the computer device can generate an encrypted result by performing mathematical operations on the historical and current passwords, such as addition, subtraction, multiplication, and division. Correspondingly, decrypting the encrypted result using the first password is equivalent to performing the inverse operation on the first password and the encrypted result, and the result of the inverse operation is the password to be verified.

[0052] In another possible implementation, the computer device can also encode and then compute the historical password and the current password, or compute and then encode, to generate an encrypted result. Correspondingly, decrypting the encrypted result using the first password involves performing an inverse operation on the first password and the encrypted result before decoding, or decoding and then performing an inverse operation, to obtain the password to be verified.

[0053] Regarding the method of generating encrypted results, it can also be a combination of encryption algorithms, such as hash algorithms, obfuscation algorithms, etc., but this application embodiment does not limit this.

[0054] Step 103: If the password to be verified is the same as the current password, in response to the password reset operation in the password reset interface, update the current password to the second password indicated by the password reset operation.

[0055] In some embodiments, after decrypting the password to be verified, the computer device can compare the password to be verified with the current password. If the password to be verified matches the current password, the computer device can respond to the password reset operation in the password reset interface and update the current password to the second password indicated by the password reset operation, so that the user can use the updated second password for authentication.

[0056] In one possible implementation, if the password to be verified matches the current password, the computer device can update the password reset interface, display a password reset input window within the password reset interface, thereby receiving the user's password reset operation in the password reset input window, and updating the current password to the second password indicated by the password reset operation after the user confirms the password reset.

[0057] Indicative, such as Figure 2 As shown, when the password to be verified is the same as the current password, the computer device displays a password reset input window in the password reset interface 201, thereby receiving the password reset operation from the user in the password reset input window.

[0058] In another possible implementation, if the password to be verified does not match the current password, the computer device needs to update the historical password input window and display a historical password input error message to prompt the user to re-enter the historical password.

[0059] It should be noted that the password reset function proposed in this application, which allows users to reset the current password by entering a historical password, can be applied to both the lock screen password reset process on a mobile terminal and the account password reset process within an application. This application does not limit this application to such applications.

[0060] In summary, this application provides a method for users who have forgotten their current password to reset it by inputting a historical password. This method uses the historical password and the current password to generate an encrypted result. The system then responds to the user's historical password input within the password reset interface, obtains a first password, decrypts the encrypted result using the first password to obtain the password to be verified, and, if the password to be verified matches the current password, responds to the password reset operation, thus resetting the password. By adopting the solution provided in this application embodiment, both the convenience and security of password reset can be improved.

[0061] In some embodiments, to improve the security of password reset, a password obfuscation result can be generated using an obfuscation algorithm, and this obfuscation result can be used as the encryption result. The process of generating a password obfuscation result using an obfuscation algorithm and decrypting it using the inverse operation of the obfuscation algorithm will be described below through specific embodiments.

[0062] Please refer to Figure 3 This document illustrates a flowchart of a password reset method provided in another exemplary embodiment of this application. This embodiment uses the method applied to a computer device as an example for illustration. The method includes the following steps:

[0063] Step 301: In response to the historical password input operation in the password reset interface, obtain the first password. The password reset interface is an interface used to reset the current password by entering a historical password.

[0064] Optionally, to facilitate user access to the password reset function proposed in this application, a corresponding function entry point needs to be set for the password reset interface. Optionally, the function entry point for the password reset interface can be set in the password input interface, which is used to verify identity by entering the current password.

[0065] In one possible implementation, in response to a password input operation on the password input interface, the computer device obtains a third password indicated by the password input operation. If the third password matches the current password, it indicates that the password input is correct and authentication is successful. If the third password does not match the current password, it indicates that the password input is incorrect and authentication fails.

[0066] In one possible implementation, if the third password is inconsistent with the current password and the number of password input operations reaches a threshold, the computer device can display a password reset control to prompt the user to use the password reset function, thereby displaying a password reset interface in response to the triggering operation of the password reset control.

[0067] The threshold for the number of password input operations can be a preset fixed value, which is not limited in this embodiment. Optionally, the triggering operation for the password reset control can be a click operation or other operation methods, which are not limited in this embodiment.

[0068] It should be noted that the embodiments of this application only provide an exemplary description of the timing of the password reset control. The timing of the password reset control may also be independent of the number of password input operations and may be directly displayed on the password input interface. The embodiments of this application do not limit this.

[0069] In another possible implementation, if the third password is inconsistent with the current password and the number of password input operations reaches a threshold, the computer device can directly display the password reset interface to prompt the user to use the password reset function, without waiting for the user to trigger the password reset control.

[0070] The implementation method of this step can be referred to step 101, and will not be repeated here in this embodiment.

[0071] Step 302: Decrypt the first password obfuscation result using the first password to obtain the password to be verified. The first password obfuscation result is calculated based on the historical password and the current password using an obfuscation algorithm.

[0072] In some embodiments, when a user resets a historical password to the current password, the computer device calculates a first password obfuscation result based on the historical password and the current password using an obfuscation algorithm, and saves the first password obfuscation result. Then, when the user resets the current password by entering a historical password, the computer device can obtain the first password obfuscation result, decrypt the first password obfuscation result using the first password, and thus obtain the password to be verified.

[0073] Regarding the process of generating the first password confusion result, in one possible implementation, the computer device can first calculate the first password hash value corresponding to the historical password, and then perform character conversion on the current password based on the target encoding rule to obtain the password encoding corresponding to the current password. Thus, based on the first password hash value and the password encoding, the first password confusion result is obtained by addition calculation.

[0074] The target encoding rule is determined based on the password character type. When the password character type only includes numbers, it encodes characters from 0 to 9 (0 to 0, 1 to 1, etc., a total of 10 characters). When the password character type includes numbers (0 to 9), letters (52 uppercase and lowercase letters), and characters (33 special characters), it encodes characters from 0 to 94 (0 to 0, 9 to 9, A to 10, B to 11, Z to 35, a to 36, b to 37, etc., a total of 95 characters). Optionally, the computer device can encode each character in the current password according to the target encoding rule to obtain the corresponding password code.

[0075] Optionally, the computer device performs a hash calculation on the historical password to obtain the first password hash value corresponding to the historical password. For example, the hash function SHA-256 (Secure Hash Algorithm 256-bit) can be used to perform the hash calculation on the historical password. This application embodiment does not specifically limit the hash function used.

[0076] Optionally, considering that the character length of the password encoding may differ from the character length of the first password hash value, to facilitate subsequent addition calculations, the computer device can first truncate the first password hash value according to the character length of the password encoding, so that the character length of the truncated first password hash value is the same as the character length of the password encoding. Then, the computer device performs addition calculations on each character element in the truncated first password hash value and each character element in the password encoding to obtain the addition result, and obtains the first password confusion result by taking the modulo of the addition result.

[0077] For illustration, the historical password is A, the current password is B, the first password hash value is HASH_A, the password encoding is B1, the truncated first password hash value can be represented as HASH_A_B, the i-th character element in the password encoding can be represented as B1[i], and the i-th character element in the truncated first password hash value can be represented as HASH_A_B[i].

[0078] In one possible implementation, the computer device can calculate the i-th addition value by adding the i-th character element in the cryptographic encoding and the i-th character element in the truncated first cryptographic hash value. Illustratively, the i-th addition value N[i] = HASH_A_B[i] + B1[i]. Further, according to the target modulo value corresponding to the target encoding rule, the i-th addition value is moduloed, and the various addition values ​​N[i] after modulo processing can then form the first cryptographic confusion result N.

[0079] The target modulus value corresponding to the target encoding rule is related to the password character type. For pure numeric passwords, the target modulus value is 10; for mixed-type passwords, the target modulus value is 95.

[0080] Optionally, to securely store the first password obfuscation result, the computer device can also use a HUK (Hardware Unique Key) to encrypt and save the first password obfuscation result using AES (Advanced Encryption Standard).

[0081] In some embodiments, after receiving a historical password input operation in the password reset interface and obtaining the first password indicated by the historical password input operation, the computer device can obtain the first password obfuscation result, and decrypt the first password obfuscation result using the first password according to the inverse operation of the obfuscation algorithm to obtain the password to be verified.

[0082] Optionally, decrypting the first password obfuscation result is equivalent to performing the inverse operation of the obfuscation algorithm. In one possible implementation, the computer device can first calculate the second password hash value corresponding to the first password, and based on the second password hash value and the first password obfuscation result, obtain the code to be verified through subtraction. Then, based on the target encoding rule, the code to be verified is converted into characters to obtain the password to be verified.

[0083] Optionally, the computer device performs a hash calculation on the first password to obtain the hash value of the second password corresponding to the first password. Optionally, the hash function used for the first password needs to be the same as the hash function used for the historical passwords. For example, the SHA-256 (Secure Hash Algorithm 256-bit) hash function can be used to perform the hash calculation on the first password.

[0084] Optionally, considering that the character length of the second cryptographic hash value may differ from the character length of the first cryptographic obfuscation result, to facilitate subsequent inverse operations, the computer device also needs to truncate the second cryptographic hash value according to the character length of the first cryptographic obfuscation result, ensuring that the character length of the truncated second cryptographic hash value is the same as that of the first cryptographic obfuscation result. Then, the computer device subtracts the corresponding character element from the truncated second cryptographic hash value from each character element in the first cryptographic obfuscation result to obtain the code to be verified.

[0085] For illustration, the first password is A′, the second password hash value is HASH_A′, the truncated second password hash value can be represented as HASH_A′_N, the i-th character element in the truncated second password hash value can be represented as HASH_A′_N[i], and the i-th character element in the first password confusion result can be represented as N[i].

[0086] In one possible implementation, the computer device subtracts the i-th character element from the truncated second cryptographic hash value from the i-th character element in the first cryptographic obfuscation result to obtain the i-th subtraction value. Illustratively, the i-th subtraction value B1′[i] = N[i] - HASH_A′_N[i]. Further, based on each subtraction value, the code to be verified, B1′, can be constructed. Then, according to the target encoding rules, character conversion is performed on the code to be verified to obtain the password to be verified, B′.

[0087] Optionally, considering that the character elements in the first password confusion result are the element values ​​after modulo processing, i.e., N[i] may be less than HASH_A′_N[i], the computer device can first compare the size of N[i] with HASH_A′_N[i] before performing the subtraction calculation. If N[i] is not less than HASH_A′_N[i], then subtract HASH_A′_N[i] from N[i]. If N[i] is less than HASH_A′_N[i], then N[i] can be added according to the target modulo value M, N[i] = N[i] + M, so that if N[i] is not less than HASH_A′_N[i], then subtract HASH_A′_N[i] from the added N[i].

[0088] Considering the finite nature of the encoding difference, a maximum number of addition operations on N[i] using the target modulus M needs to be set. According to the target encoding rules, the maximum number of operations can be set to 4. That is, if N[i] is less than HASH_A′_N[i], the target modulus M can be used to perform addition operations on N[i] a maximum of 4 times. If N[i] is still less than HASH_A′_N[i] after 4 addition operations, an error is reported.

[0089] Step 303: If the password to be verified is the same as the current password, in response to the password reset operation in the password reset interface, update the current password to the second password indicated by the password reset operation.

[0090] The implementation method of this step can be referred to step 103, and will not be repeated here in this embodiment.

[0091] In the above embodiments, a confusion algorithm is used to generate an encryption result based on historical passwords and the current password, and the encryption result is decrypted by performing the inverse operation of the confusion algorithm, which improves the complexity of the encryption result and optimizes the security of password reset.

[0092] In some embodiments, from the perspective of user information security, and considering the special nature of the function of resetting the current password by entering a historical password, corresponding usage conditions can be set for the password reset function to ensure the security of decryption.

[0093] 1) Set the time conditions for the password reset function.

[0094] Optionally, considering that users may forget their current password but remember their previous password, which usually occurs in the early stages of a password change, a time condition can be set for the password reset function that allows users to reset their current password by entering a previous password in order to improve the security of the password reset.

[0095] In one possible implementation, after obtaining the first password indicated by the historical password input operation, the computer device can determine the current decryption time and calculate the time interval between the current decryption time and the result generation time corresponding to the first password obfuscation result. If the time interval between the two does not reach the time interval threshold, the computer device can then decrypt the first password obfuscation result using the first password to obtain the password to be verified.

[0096] If the time interval between the current decryption time and the time of the generation of the result corresponding to the first password obfuscation result reaches the time interval threshold, the computer device can delete the first password obfuscation result. The user will then be unable to reset the current password by entering a historical password and can only use other password reset methods.

[0097] For example, the time interval threshold can be set to 96 hours. If the time interval between the current decryption time and the result generation time corresponding to the first password obfuscation result does not exceed 96 hours, the password reset function proposed in this application can be used to reset the current password by entering a historical password; if the time interval between the current decryption time and the result generation time corresponding to the first password obfuscation result exceeds 96 hours, the password reset function cannot be used.

[0098] Optionally, the first cryptographic obfuscation result and the corresponding result generation time can be stored together. Before decrypting the first cryptographic obfuscation result, the computer device first performs a time condition judgment based on the result generation time.

[0099] In one possible implementation, upon receiving a password setting operation to update the historical password to the current password, the computer device calculates a first password obfuscation result based on the historical password and the current password using an obfuscation algorithm, determines the result generation time corresponding to the first password obfuscation result, and then stores the first password obfuscation result in association with the result generation time corresponding to the first password obfuscation result.

[0100] The password setting operation of updating historical password A to current password B refers to the operation where the user remembers password A and resets password A to password B by entering the current password.

[0101] In one possible implementation, the computer device can first calculate the first hash value corresponding to the historical password, and then perform character conversion on the current password based on the target encoding rule to obtain the password encoding corresponding to the current password. Based on the first hash value and the password encoding, a first password obfuscation result is obtained through addition. The specific process for generating the first password obfuscation result can be referred to the above embodiments, and will not be repeated here.

[0102] Optionally, if the time interval between the current decryption time and the result generation time corresponding to the first password obfuscation result does not reach the time interval threshold, the computer device obtains the password to be verified through decryption. If the password to be verified matches the current password, the user can perform a password reset operation to reset the current password. Optionally, considering that the user is resetting the current password by entering a historical password after forgetting the current password, in response to the password reset operation in the password reset interface, after the computer device obtains the second password indicated by the password reset operation, it can again calculate the second password obfuscation result based on the second password and the historical password using an obfuscation algorithm, and determine the result generation time corresponding to the second password obfuscation result. This updates the first password obfuscation result and its corresponding result generation time to the second password obfuscation result and its corresponding result generation time.

[0103] For example, the historical password is A, the current password is B, and the second password indicated by the password reset operation is C. The computer device then regenerates a second password obfuscation result based on the historical password A and the second password C, and updates the storage of the second password obfuscation result and the corresponding result generation time.

[0104] Then, if the user forgets the second password C again, the computer device obtains the second password obfuscation result and the corresponding result generation time. Based on the result generation time corresponding to the second password obfuscation result, it performs a time condition judgment, and if the time condition is met, it decrypts the second password obfuscation result.

[0105] Optionally, the storage period corresponding to the second password obfuscation result can be the same as or different from the storage period corresponding to the first password obfuscation result; this embodiment does not limit this. In one possible implementation, considering that the user is resetting the current password by entering a historical password after forgetting it (i.e., the user has a longer memory time for historical passwords and a shorter memory time for new passwords), in order to optimize the user experience, the storage period corresponding to the second password obfuscation result can be set to a longer time to meet the user's needs for using the password reset function.

[0106] Optionally, if the historical password is A and the current password is B, and the user has not forgotten the current password B, and resets the current password B to password D by entering the current password, the computer device will determine password B as the historical password and password D as the current password, and generate a third password obfuscation result based on the historical password B and the current password D.

[0107] Regarding the timing of deleting the first password obfuscation result, in another possible implementation, after storing the first password obfuscation result in association with the result generation time corresponding to the first password obfuscation result, the computer device can also set a result storage timer. The storage validity period of the first password obfuscation result can be controlled by the result storage timer. Thus, after the result storage timer expires, the computer device can directly delete the first password obfuscation result without waiting for the decryption stage of the first password obfuscation result, effectively saving storage space.

[0108] For example, after storing the first password obfuscation result in association with the result generation time corresponding to the first password obfuscation result, the computer device starts a result storage timer and sets the storage validity period of the first password obfuscation result to 96 hours. After 96 hours, the computer device directly deletes the first password obfuscation result.

[0109] 2) Set the number of times the password reset function can be used.

[0110] Optionally, to prevent users from frequently trying to reset their current password by entering a previous password when they forget it, and to improve the security of password reset, a limit can be set for the number of times the password reset function can be reset by entering a previous password.

[0111] In one possible implementation, after obtaining the first password indicated by the historical password input operation, the computer device obtains the decryption count corresponding to the first password obfuscation result. If the decryption count has not reached the decryption count threshold, the computer device decrypts the first password obfuscation result using the first password to obtain the password to be verified. If the decryption count has reached the decryption count threshold, the computer device deletes the first password obfuscation result.

[0112] For example, the decryption count threshold can be set to 3 times. If the number of decryption counts corresponding to the first password obfuscation result is less than 3, the password reset function proposed in this application can be used to reset the current password by entering a historical password; if the number of decryption counts corresponding to the first password obfuscation result has reached 3, then the password reset function cannot be used.

[0113] Optionally, the first password obfuscation result and the corresponding decryption count can be stored together. Before decrypting the first password obfuscation result, the computer device first performs a count condition check based on the decryption count.

[0114] In one possible implementation, upon receiving a password setting operation to update the historical password to the current password, the computer device calculates a first password obfuscation result based on the historical password and the current password using an obfuscation algorithm. Simultaneously, it initializes a decryption counter, which indicates the number of decryption attempts corresponding to the first password obfuscation result, and stores the first password obfuscation result in association with the corresponding number of decryption attempts. The specific process for generating the first password obfuscation result can be referred to the above embodiments, and will not be repeated here.

[0115] For example, after the decryption counter is initialized, the number of decryption times corresponding to the first password obfuscation result is 0. For each pair of the first password obfuscation results decrypted once, the corresponding decryption time is incremented by one. Thus, when the number of decryption times has reached the decryption time threshold, the computer device deletes the first password obfuscation result.

[0116] Optionally, if the number of decryption attempts has not reached the decryption threshold, the computer device obtains the password to be verified through decryption. If the password to be verified matches the current password, the user can perform a password reset operation to reset the current password. Optionally, considering that the user is resetting the current password by entering a historical password after forgetting the current password, in response to the password reset operation on the password reset interface, after the computer device obtains the second password indicated by the password reset operation, it can again calculate the second password obfuscation result based on the second password and the historical password using an obfuscation algorithm, and reset the decryption counter. This decryption counter indicates the number of decryption attempts corresponding to the second password obfuscation result, thereby updating the first password obfuscation result and its corresponding decryption attempts to the second password obfuscation result and its corresponding decryption attempts.

[0117] For example, the historical password is A, the current password is B, and the second password indicated by the password reset operation is C. The computer device then generates a second password obfuscation result based on the historical password A and the second password C, and updates the storage of the second password obfuscation result and the corresponding decryption count. At this point, the decryption count corresponding to the second password obfuscation result is 0.

[0118] Furthermore, if the user forgets the second password C again, the computer device obtains the second password obfuscation result and the corresponding number of decryption attempts. Based on the number of decryption attempts corresponding to the second password obfuscation result, it performs a count condition judgment, and if the count condition is met, it decrypts the second password obfuscation result.

[0119] Optionally, the decryption count threshold corresponding to the second cryptographic obfuscation result can be the same as or different from the decryption count threshold corresponding to the first cryptographic obfuscation result. This application embodiment does not limit this.

[0120] 3) Set the account conditions for the password reset function.

[0121] Optionally, considering that passwords are usually stored in association with user accounts, the results of password obfuscation can also be stored in association with user accounts.

[0122] In one possible implementation, after obtaining the first password indicated by the historical password input operation, the computer device further obtains the currently logged-in user account in the password reset interface. If a first password obfuscation result corresponding to the user account exists, the computer device decrypts the first password obfuscation result using the first password to obtain the password to be verified. If no first password obfuscation result corresponding to the user account exists, the computer device displays a password input interface to prompt the user to authenticate by entering the current password.

[0123] The password input interface is the parent interface of the password reset interface, and the function entry point of the password reset interface can be set within the password input interface.

[0124] In one possible implementation, upon receiving a password setting operation to update a historical password to the current password, the computer device determines the user account corresponding to the password setting operation, and calculates a first password obfuscation result based on the historical password and the current password using an obfuscation algorithm, thereby associating and storing the first password obfuscation result with the user account. The specific process for generating the first password obfuscation result can be referred to the above embodiments, and will not be repeated here.

[0125] Optionally, if a first password obfuscation result exists corresponding to the user account, the computer device decrypts the password to be verified. If the password to be verified matches the current password, the user can perform a password reset operation to reset the current password. Optionally, considering that the user is resetting the current password by entering a historical password after forgetting it, in response to the password reset operation on the password reset interface, after obtaining the second password indicated by the password reset operation, the computer device can again calculate a second password obfuscation result based on the second password and the historical password using an obfuscation algorithm, and update the first password obfuscation result to the second password obfuscation result, so that the second password obfuscation result is associated with and stored with the user account.

[0126] It should be noted that the three usage conditions corresponding to the above password reset function can be set simultaneously, or one or two of them can be set. This application embodiment does not limit this.

[0127] In the above embodiments, by setting time conditions, frequency conditions, and account conditions for the password reset function, it can be ensured that users can only reset their current password by entering a historical password when the function usage conditions are met, thus further ensuring the security of password reset.

[0128] In some embodiments, to ensure the security of the encrypted result storage and the security of the decryption process, the encrypted result can be stored in a trusted execution environment, and the decryption process can be completed in the trusted execution environment.

[0129] In one possible implementation, upon receiving a password setting operation to update the historical password to the current password, the computer device generates an encryption result based on the historical password and the current password, and stores the encryption result in a trusted execution environment (TEA) for secure storage. Then, after obtaining the first password indicated by the historical password input operation, the computer device can decrypt the encryption result in the TEA using the first password to obtain the password to be verified.

[0130] The process of generating the encrypted result can be referred to in the above embodiments, and will not be repeated here.

[0131] Optionally, the Trusted Execution Environment (TEE) may include a Trusted Application (TA), while the Client Application (CA) runs in a Rich Execution Environment (REE). Data is transferred between the Client Application and the Trusted Application through the Hardware Abstraction Layer (HAL).

[0132] Among them, the password reset interface and password input interface involved in the above embodiments, which are user-facing content, belong to the client application; the encryption result, the user account associated with the encryption result, the result generation time and decryption count, and the decryption process of the encryption result can be stored in the trusted application.

[0133] In one possible implementation, the computer device obtains a first password indicated by a historical password input operation from a client application, and transmits the first password to a trusted application through a HAL layer. The trusted application then decrypts the encryption result using the first password and returns the obtained password to be verified to the client application through the HAL layer. The client application then compares the password to be verified with the current password.

[0134] In the above embodiments, by storing the encryption result in a trusted execution environment and setting the decryption process of the encryption result to be completed in the trusted execution environment, the security of password reset can be further improved and the password reset process can be optimized.

[0135] Please refer to Figure 4 This document illustrates a flowchart of storing the first password obfuscation result according to an exemplary embodiment of this application. This embodiment is illustrated using the example of a password reset method executed in a trusted execution environment, with time conditions, number of attempts, and account conditions set simultaneously.

[0136] Step 401, Begin.

[0137] Step 402: Receive the user's password setting operation to change the historical password to the current password.

[0138] If a user needs to change their password, they can reset it in their personal account management center. For example, for the lock screen password, the user can change it within the settings app.

[0139] In one possible implementation, the computer device receives a password setting operation from a user to change a historical password to the current password, obtains the current password, and determines the operation time of the password setting operation.

[0140] Step 403: Pass the historical password, the current password, and the operation time of the password setting operation to the trusted application through the HAL interface.

[0141] In one possible implementation, in order to provide users with the password reset function involved in this solution, and to ensure the security of the encrypted result storage, the computer device transmits the historical password, the current password, and the operation time of the password setting operation to the trusted application through the HAL interface.

[0142] Step 404: Generate a first password obfuscation result based on the historical password and the current password, and store the first password obfuscation result in a trusted application in association with the user account.

[0143] In one possible implementation, the computer device, in a trusted execution environment, calculates a first password obfuscation result using an obfuscation algorithm based on historical passwords and the current password, and stores the first password obfuscation result in a trusted application in association with the user account.

[0144] Step 405: Store the result generation time corresponding to the first password obfuscation result, and set the storage validity period corresponding to the first password obfuscation result to 96 hours.

[0145] Optionally, to improve the security of password reset, a corresponding time condition can be set for the password reset function. In one possible implementation, the computer device stores the result generation time corresponding to the first password obfuscation result and sets the storage validity period of the first password obfuscation result to 96 hours, wherein the result generation time corresponding to the first password obfuscation result is the operation time of the password setting operation.

[0146] Step 406: Set the decryption count threshold corresponding to the first password obfuscation result to 3 times, and initialize the decryption count to 0 times.

[0147] Optionally, to prevent users from frequently trying to reset their current password by entering previous passwords when they forget it, a limit can be set for the number of times the password reset function can be executed. In one possible implementation, the computer device sets the decryption count threshold corresponding to the first password obfuscation result to 3 times and initializes the decryption count to 0 times.

[0148] Step 407, End.

[0149] Please refer to Figure 5 This embodiment illustrates a flowchart of a password reset method provided in another exemplary embodiment of this application. The example describes a password reset method executed in a trusted execution environment, with time conditions, number of attempts, and account conditions set simultaneously.

[0150] Step 501, Begin.

[0151] Step 502: Receive the user's click on the password reset control and display the password reset interface.

[0152] In one possible implementation, if a user forgets their password, they can enter the password reset process by clicking the password reset control. The computer device then responds to the user's click on the password reset control and displays the password reset interface.

[0153] Step 503: Based on the currently logged-in user account in the password reset interface, query the first password obfuscation result corresponding to the user account.

[0154] In one possible implementation, the computer device obtains the currently logged-in user account on the password reset interface and queries the first password obfuscation result corresponding to that user account. If a first password obfuscation result exists, proceed to step 504; if no first password obfuscation result exists, proceed to step 505.

[0155] Step 504: Check if the storage duration of the first password obfuscation result exceeds the storage validity period of 96 hours.

[0156] If a first password obfuscation result exists, the computer device further queries whether the storage duration of the first password obfuscation result exceeds the storage validity period of 96 hours. Optionally, the computer device determines the time interval between the operation time of the historical password input operation and the result generation time of the first password obfuscation result, and compares the time interval with 96 hours. If the time interval does not reach 96 hours, proceed to step 506; if the time interval reaches 96 hours, proceed to step 507.

[0157] Step 505: If there is no first password obfuscation result corresponding to the user account, the password input interface is displayed.

[0158] If there is no initial password obfuscation, the computer device displays a password input interface to prompt the user to continue trying to enter the current password to complete authentication, or to reset the password using other password reset methods.

[0159] Step 506: Determine whether the number of decryption attempts for the first password obfuscation result is greater than 3.

[0160] If the time interval is less than 96 hours, the computer device further determines the number of decryption attempts corresponding to the first password obfuscation result, and if the number of decryption attempts is less than 3, proceeds to step 508; if the number of decryption attempts reaches 3, proceeds to step 509.

[0161] Step 507 has timed out. Delete the first password obfuscation result.

[0162] If the time interval reaches 96 hours, the computer device deletes the first password obfuscation result corresponding to the user account.

[0163] Step 508: Activate the password reset function.

[0164] If the number of decryption attempts has not reached 3, the computer device can activate the password reset function to reset the current password by entering a previous password.

[0165] Step 509: The number of attempts has exceeded the limit. Delete the first password obfuscation result.

[0166] If the number of decryption attempts reaches 3, the computer device deletes the first password obfuscation result corresponding to the user account.

[0167] Step 510: Pass the first password and user account obtained from the password reset interface to the trusted application through the HAL layer.

[0168] The computer device obtains the first password indicated by the historical password input operation based on the historical password input operation in the password reset interface, and passes the first password and user account to the trusted application through the HAL layer.

[0169] Step 511: Decrypt the first password obfuscation result using the first password to obtain the password to be verified, and increment the decryption count corresponding to the first password obfuscation result by one.

[0170] Within a trusted execution environment, the computer device decrypts the first password obfuscation result using the first password to obtain the password to be verified, and increments the decryption count corresponding to the first password obfuscation result by one.

[0171] Furthermore, if the number of decryption attempts corresponding to the first password obfuscation result has reached 3, the computer device deletes the first password obfuscation result.

[0172] Step 512: Return the password to be verified to the client application.

[0173] The computer device returns the password to be verified to the client application through the HAL layer.

[0174] Step 513: Determine if the password to be verified is correct.

[0175] The computer device determines whether the password to be verified is the same as the current password. If the password to be verified is the same as the current password, proceed to step 514; if the password to be verified is not the same as the current password, proceed to step 515.

[0176] Step 514: Receive the password reset operation from the user in the password reset interface.

[0177] If the password to be verified matches the current password, the computer device continues to receive password reset operations from the user in the password reset interface.

[0178] Step 515: The historical password was entered incorrectly. Please re-enter the historical password.

[0179] If the password to be verified does not match the current password, the computer device will prompt the user on the password reset interface that the historical password was entered incorrectly and that the historical password needs to be re-entered to enable the password reset function of resetting the current password by entering the historical password.

[0180] Step 516: Update the current password to the second password indicated by the password reset operation.

[0181] The computer device responds to the user's password reset operation in the password reset interface and updates the current password to the second password indicated by the password reset operation.

[0182] Step 517: Pass the historical password, second password, user account, and password reset operation time to the trusted application via the HAL interface.

[0183] To meet the user's need to continue using the password reset function, the computer device retransmits the historical password, the second password, the user account, and the operation time of the password reset operation to the trusted application through the HAL interface, so as to regenerate the second password obfuscation result.

[0184] Step 518: Based on the historical password and the second password, calculate the second password obfuscation result using an obfuscation algorithm, and store the second password obfuscation result in association with the user account and the result generation time.

[0185] Within a trusted execution environment, the computer device calculates the obfuscation result of the second password based on the historical password and the second password using an obfuscation algorithm. The obfuscation result of the second password is then stored in association with the user account and the result generation time. At the same time, the number of decryption attempts corresponding to the obfuscation result of the second password is set to 0.

[0186] Step 519, End.

[0187] Please refer to Figure 6 The diagram illustrates a flowchart of a cryptographic obfuscation result calculated by an obfuscation algorithm, provided in an exemplary embodiment of this application.

[0188] Step 601: Pass the historical password, current password, user account, and password setting operation time to the trusted application via the HAL interface.

[0189] In one possible implementation, the computer device receives a password setting operation from a user to change a historical password to a current password, and transmits the historical password, the current password, and the operation time of the password setting operation to a trusted application through the HAL interface.

[0190] Step 602: Calculate the first hash value corresponding to the historical password.

[0191] Computer equipment performs hash calculations on historical passwords to obtain the first hash value corresponding to the historical password. For example, the SHA-256 hash function can be used to perform hash calculations on historical passwords to obtain the first hash value.

[0192] Step 603: Encode the current password according to the password character type to obtain the password encoding.

[0193] Furthermore, the computer device encodes the current password according to the password character type, resulting in a password encoding. When the password character type only includes numbers, it is encoded from 0 to 9; when the password character type includes numbers, letters, and characters, it is encoded from 0 to 94.

[0194] Step 604: Extract the first password hash value based on the character length of the password encoding.

[0195] To facilitate subsequent addition calculations, the computer device can also truncate the first password hash value according to the character length of the password encoding, so that the character length of the truncated first password hash value is the same as the character length of the password encoding.

[0196] Step 605: Perform an addition operation on the password encoding and the truncated first password hash value to obtain the addition calculation value N[i].

[0197] The computer device can calculate the i-th addition value N[i] = HASH_A_B[i] + B1[i] by adding the i-th character element in the password encoding and the i-th character element in the truncated first password hash value.

[0198] Step 606: If the password character type is a pure numeric password, take the modulo 10 of the addition calculation value N[i].

[0199] Step 607: If the password character type is a mixed type password, take the modulo 95 of the addition calculation value N[i].

[0200] Step 608: Generate the first cryptographic obfuscation result based on the addition calculation value after modulo operation.

[0201] The computer device takes the modulus of the i-th addition value according to the target modulus value corresponding to the target encoding rule. Thus, the various addition values ​​N[i] after the modulus taking process can form the first cryptographic confusion result N.

[0202] Step 609: Use HUK to perform AES encryption on the first password obfuscation result and save it.

[0203] To securely store the first password obfuscation result, the computer device uses HUK to encrypt and save the first password obfuscation result using AES encryption.

[0204] Step 610: Store the first password obfuscation result in association with the user account and the result generation time.

[0205] In order to determine the decryption conditions corresponding to the first password obfuscation result, the computer device stores the first password obfuscation result in association with the user account and the result generation time.

[0206] Step 611: Set the decryption count threshold corresponding to the first password obfuscation result. The current decryption count is 0.

[0207] The computer device sets a decryption count threshold corresponding to the first password obfuscation result, and sets the current decryption count to 0. Therefore, the current password can only be reset by using a historical password if the decryption count has not reached the decryption count threshold.

[0208] Step 612: Set the storage time for the first password obfuscation result to 96 hours.

[0209] The computer device sets the storage validity period for the first password obfuscation result to 96 hours, so that the current password can only be reset by using a historical password if the storage validity period has not been reached.

[0210] Step 613, End.

[0211] Please refer to Figure 7 The diagram illustrates a flowchart of decryption via inverse operation of an obfuscation algorithm provided in an exemplary embodiment of this application.

[0212] Step 701: Pass the first password, user account, and operation time of the historical password input operations to the trusted application through the HAL interface.

[0213] The computer device obtains the first password indicated by the historical password input operation based on the historical password input operation in the password reset interface, and passes the first password, user account, and operation time of the historical password input operation to the trusted application through the HAL layer.

[0214] Step 702: Obtain the first password obfuscation result based on the user account, and determine that the storage time limit corresponding to the first password obfuscation result has not been exceeded.

[0215] In the case where a first password obfuscation result exists corresponding to a user account, the computer device obtains the first password obfuscation result and determines that the operation time of the historical password input operation and the result generation time corresponding to the first password obfuscation result do not exceed the storage validity period corresponding to the first password obfuscation result.

[0216] Step 703: Calculate the hash value of the second password corresponding to the first password.

[0217] If the storage time corresponding to the first password obfuscation result has not expired, the computer device performs a hash calculation on the first password to obtain the second password hash value corresponding to the first password.

[0218] Step 704: Extract the second password hash value based on the character length of the first password obfuscation result.

[0219] To facilitate subsequent inverse operations, the computer device also needs to first truncate the second hash value based on the character length of the first hash result, so that the character length of the truncated second hash value is the same as the character length of the first hash result.

[0220] Step 705: Determine the password character type.

[0221] In order to correct the values ​​of character elements in the first password obfuscation result, the computer device needs to determine the password character type in order to determine the corresponding target modulus value.

[0222] Step 706: If the password character type is a pure numeric password, set the target modulus value to 10.

[0223] Step 707: If the password character type is a mixed type password, set the target modulus value to 95.

[0224] Step 708: Compare the size of the character elements in the truncated second password hash value with the size of the character elements in the first password confusion result.

[0225] Since the subtraction result cannot be negative, the computer device needs to compare the size of the character elements in the truncated second cryptographic hash value with the size of the character elements in the first cryptographic confusion result.

[0226] Step 709: Subtract the character elements in the truncated second cryptographic hash value from the character elements in the first cryptographic obfuscation result to obtain the subtraction calculation value, and form the code to be verified.

[0227] The computer device subtracts the i-th character element from the truncated second cryptographic hash value from the i-th character element in the first cryptographic obfuscation result, obtaining the i-th subtraction calculation value B1′[i] = N[i] - HASH_A′_N[i]. Furthermore, the computer device can construct the code to be verified based on each subtraction calculation value.

[0228] Step 710: Convert the code to be verified into the password to be verified according to the target encoding rules.

[0229] The computer equipment performs character conversion on the code to be verified according to the target encoding rules, thereby obtaining the password to be verified.

[0230] Step 711: Return the password to be verified to the client application.

[0231] Then, the computer device returns the password to be verified to the client application, so that the client application can determine whether the password to be verified is consistent with the current password, and then determine whether to reset the password based on the judgment result.

[0232] Please refer to Figure 8 The diagram illustrates a structural block diagram of a password reset apparatus provided in an exemplary embodiment of this application, the apparatus comprising:

[0233] The first acquisition module 801 is used to acquire the first password in response to the historical password input operation in the password reset interface. The password reset interface is an interface for resetting the current password by inputting a historical password.

[0234] The decryption module 802 is used to decrypt the encryption result using the first password to obtain the password to be verified, wherein the encryption result is generated based on the historical password and the current password;

[0235] The update module 803 is used to update the current password to the second password indicated by the password reset operation in the password reset interface when the password to be verified is consistent with the current password.

[0236] Optionally, the decryption module 802 is used for:

[0237] The first password is used to decrypt the first password obfuscation result to obtain the password to be verified. The first password obfuscation result is calculated based on the historical password and the current password using an obfuscation algorithm.

[0238] Optionally, the decryption module 802 is used for:

[0239] Determine the current decryption time;

[0240] If the time interval between the current decryption time and the result generation time corresponding to the first password obfuscation result does not reach the time interval threshold, the first password obfuscation result is decrypted using the first password to obtain the password to be verified.

[0241] The device further includes:

[0242] The first deletion module is used to delete the first password obfuscation result when the time interval between the current decryption time and the result generation time corresponding to the first password obfuscation result reaches the time interval threshold.

[0243] Optionally, the device further includes:

[0244] The first result calculation module is used to calculate the first password obfuscation result based on the historical password and the current password by using an obfuscation algorithm when a password setting operation is received to update the historical password to the current password.

[0245] The first-time determination module is used to determine the result generation time corresponding to the first password obfuscation result;

[0246] The first storage module is used to associate the first password obfuscation result with the result generation time corresponding to the first password obfuscation result.

[0247] Optionally, the device further includes:

[0248] The second result calculation module is used to respond to the password reset operation in the password reset interface and calculate the second password obfuscation result based on the second password and the historical password through an obfuscation algorithm.

[0249] The second time determination module is used to determine the result generation time corresponding to the second password obfuscation result;

[0250] The first storage module is used to update the first password obfuscation result and the result generation time corresponding to the first password obfuscation result to the result generation time corresponding to the second password obfuscation result.

[0251] Optionally, the first result calculation module is used for:

[0252] Calculate the first cryptographic hash value corresponding to the historical password;

[0253] Based on the target encoding rule, the current password is converted into characters to obtain the password encoding corresponding to the current password. The target encoding rule is determined based on the password character type.

[0254] Based on the first cryptographic hash value and the cryptographic encoding, the first cryptographic obfuscation result is obtained by addition.

[0255] Optionally, the decryption module 802 is used for:

[0256] Obtain the number of decryption attempts corresponding to the first password obfuscation result;

[0257] If the number of decryption attempts does not reach the decryption attempt threshold, the first password obfuscation result is decrypted using the first password to obtain the password to be verified.

[0258] The device further includes:

[0259] The second deletion module is used to delete the first password obfuscation result when the number of decryption attempts reaches the decryption attempt threshold.

[0260] Optionally, the device further includes:

[0261] The third result calculation module is used to calculate the first password obfuscation result based on the historical password and the current password by using an obfuscation algorithm when a password setting operation is received to update the historical password to the current password.

[0262] A counting module is used to initialize a decryption counter, which indicates the number of decryptions corresponding to the first password obfuscation result;

[0263] The second storage module is used to associate and store the first password obfuscation result with the number of decryption attempts corresponding to the first password obfuscation result.

[0264] Optionally, the device further includes:

[0265] The fourth result calculation module is used to respond to the password reset operation in the password reset interface, and calculate the second password obfuscation result based on the second password and the historical password using an obfuscation algorithm;

[0266] A counter reset module is used to reset the decryption counter, which indicates the number of decryptions corresponding to the second password obfuscation result;

[0267] The second storage module is used to update the first password obfuscation result and the decryption count corresponding to the first password obfuscation result to the second password obfuscation result and the decryption count corresponding to the second password obfuscation result.

[0268] Optionally, the decryption module 802 is used for:

[0269] Retrieve the currently logged-in user account in the password reset interface;

[0270] If the first password obfuscation result corresponding to the user account exists, the first password obfuscation result is decrypted using the first password to obtain the password to be verified;

[0271] The device further includes:

[0272] The first display module is used to display a password input interface when there is no first password obfuscation result corresponding to the user account. The password input interface is the parent interface of the password reset interface.

[0273] Optionally, the device further includes:

[0274] The account determination module is used to determine the user account corresponding to the password setting operation when a password setting operation is received that updates the historical password to the current password.

[0275] The fifth result calculation module is used to calculate the first password obfuscation result based on the historical password and the current password using an obfuscation algorithm;

[0276] The third storage module is used to associate and store the first password obfuscation result with the user account.

[0277] Optionally, the device further includes:

[0278] The sixth result calculation module is used to respond to the password reset operation in the password reset interface, and calculate the second password obfuscation result based on the second password and the historical password through an obfuscation algorithm;

[0279] The third storage module is used to update the first password obfuscation result to the second password obfuscation result and store it in association with the user account.

[0280] Optionally, the decryption module 802 is used for:

[0281] Calculate the hash value of the second password corresponding to the first password;

[0282] Based on the second cryptographic hash value and the first cryptographic obfuscation result, the code to be verified is obtained by subtraction.

[0283] Based on the target encoding rule, the character conversion of the code to be verified is performed to obtain the password to be verified, wherein the target encoding rule is determined based on the password character type.

[0284] Optionally, the device further includes:

[0285] The seventh result calculation module is used to generate the encryption result based on the historical password and the current password when a password setting operation is received to update the historical password to the current password;

[0286] The fourth storage module is used to store the encryption result in a trusted execution environment, wherein the trusted execution environment is used to securely store the encryption result.

[0287] The decryption module 802 is used for:

[0288] In the trusted execution environment, the encryption result is decrypted using the first password to obtain the password to be verified.

[0289] Optionally, the device further includes:

[0290] The second acquisition module is used to acquire the third password indicated by the password input operation in response to the password input interface.

[0291] The second display module is used to display a password reset control when the third password is inconsistent with the current password and the number of password input operations reaches a threshold.

[0292] The third display module is used to display the password reset interface in response to a trigger operation of the password reset control.

[0293] In summary, this application provides a method for users who have forgotten their current password to reset it by inputting a historical password. This method uses the historical password and the current password to generate an encrypted result. The system then responds to the user's historical password input within the password reset interface, obtains a first password, decrypts the encrypted result using the first password to obtain the password to be verified, and, if the password to be verified matches the current password, responds to the password reset operation, thus resetting the password. By adopting the solution provided in this application embodiment, both the convenience and security of password reset can be improved.

[0294] It should be noted that the apparatus provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the apparatus can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their implementation process can be found in the method embodiments, which will not be repeated here.

[0295] Figure 9 This illustration shows a structural block diagram of a computer device provided in an exemplary embodiment of this application. The computer device 900 may include one or more components such as a processor 910 and a memory 920.

[0296] The processor 910 may include one or more processing cores. The processor 910 connects to various parts within the computer device 900 using various interfaces and lines, and performs various functions and processes data of the computer device 900 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 920, and by calling data stored in the memory 920. Optionally, the processor 910 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 910 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), Neural-network Processing Unit (NPU), and modem. Specifically, the CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required to be displayed on the touch screen; the NPU is used to implement Artificial Intelligence (AI) functions; and the modem is used to handle wireless communication. Understandably, the aforementioned modem may also be implemented separately as a single chip, rather than being integrated into the processor 910.

[0297] The memory 920 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 920 may include a non-transitory computer-readable storage medium. The memory 920 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 920 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, instructions for implementing the various method embodiments described above, etc.; the data storage area may store data created based on the use of the computer device 900, etc.

[0298] In addition, those skilled in the art will understand that the structure of the computer device 900 shown in the above figures does not constitute a limitation on the terminal. The terminal may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the computer device 900 also includes components such as a display screen, camera assembly, microphone, speaker, radio frequency circuit, sensor, audio circuit, WiFi module, power supply, and Bluetooth module, which will not be described in detail here.

[0299] This application also provides a computer-readable storage medium storing at least one program that is loaded and executed by a processor to implement the password reset method described in the above embodiments.

[0300] According to one aspect of this application, a computer program product is provided, comprising computer instructions stored in a computer-readable storage medium. A terminal's processor reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the terminal to perform the password reset method provided in various alternative implementations of the above aspect.

[0301] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or code on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media can be any available medium accessible to a general-purpose or special-purpose computer.

[0302] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A password reset method, characterized in that, The method includes: In response to a historical password input operation within the password reset interface, a first password is obtained, wherein the password reset interface is an interface for resetting the current password by inputting a historical password; The encryption result is decrypted using the first password to obtain the password to be verified. The encryption result is generated based on the historical password and the current password. If the password to be verified is the same as the current password, in response to the password reset operation in the password reset interface, the current password is updated to the second password indicated by the password reset operation.

2. The method according to claim 1, characterized in that, The step of decrypting the encryption result using the first password to obtain the password to be verified includes: The first password is used to decrypt the first password obfuscation result to obtain the password to be verified. The first password obfuscation result is calculated based on the historical password and the current password using an obfuscation algorithm.

3. The method according to claim 2, characterized in that, The step of decrypting the first password obfuscation result using the first password to obtain the password to be verified includes: Determine the current decryption time; If the time interval between the current decryption time and the result generation time corresponding to the first password obfuscation result does not reach the time interval threshold, the first password obfuscation result is decrypted using the first password to obtain the password to be verified. The method further includes: If the time interval between the current decryption time and the result generation time corresponding to the first password obfuscation result reaches the time interval threshold, the first password obfuscation result is deleted.

4. The method according to claim 3, characterized in that, The method further includes: Upon receiving a password setting operation that updates the historical password to the current password, the first password obfuscation result is calculated using an obfuscation algorithm based on the historical password and the current password. Determine the result generation time corresponding to the first password obfuscation result; The first password obfuscation result is associated with the generation time of the result corresponding to the first password obfuscation result and stored together.

5. The method according to claim 4, characterized in that, The method further includes: In response to the password reset operation in the password reset interface, a second password obfuscation result is calculated based on the second password and the historical password using an obfuscation algorithm; Determine the result generation time corresponding to the second password obfuscation result; The generation time of the first password obfuscation result and the result corresponding to the first password obfuscation result are updated to the generation time of the second password obfuscation result and the result corresponding to the second password obfuscation result.

6. The method according to claim 4, characterized in that, The step of calculating the first password obfuscation result based on the historical password and the current password using an obfuscation algorithm includes: Calculate the first cryptographic hash value corresponding to the historical password; Based on the target encoding rule, the current password is converted into characters to obtain the password encoding corresponding to the current password. The target encoding rule is determined based on the password character type. Based on the first cryptographic hash value and the cryptographic encoding, the first cryptographic obfuscation result is obtained by addition.

7. The method according to claim 2, characterized in that, The step of decrypting the first password obfuscation result using the first password to obtain the password to be verified includes: Obtain the number of decryption attempts corresponding to the first password obfuscation result; If the number of decryption attempts does not reach the decryption attempt threshold, the first password obfuscation result is decrypted using the first password to obtain the password to be verified. The method further includes: If the number of decryption attempts reaches the decryption attempt threshold, the first password obfuscation result is deleted.

8. The method according to claim 7, characterized in that, The method further includes: Upon receiving a password setting operation that updates the historical password to the current password, the first password obfuscation result is calculated using an obfuscation algorithm based on the historical password and the current password. Initialize a decryption counter, which indicates the number of decryptions corresponding to the first password obfuscation result; The first password obfuscation result is associated with and stored in relation to the number of decryption attempts corresponding to the first password obfuscation result.

9. The method according to claim 8, characterized in that, The method further includes: In response to the password reset operation in the password reset interface, a second password obfuscation result is calculated based on the second password and the historical password using an obfuscation algorithm; Reset the decryption counter, which is used to indicate the number of decryption attempts corresponding to the second password obfuscation result; The first password obfuscation result and the corresponding number of decryption attempts are updated to the second password obfuscation result and the corresponding number of decryption attempts.

10. The method according to claim 2, characterized in that, The step of decrypting the first password obfuscation result using the first password to obtain the password to be verified includes: Retrieve the currently logged-in user account in the password reset interface; If the first password obfuscation result corresponding to the user account exists, the first password obfuscation result is decrypted using the first password to obtain the password to be verified; The method further includes: If the first password obfuscation result corresponding to the user account does not exist, a password input interface is displayed, which is the parent interface of the password reset interface.

11. The method according to claim 10, characterized in that, The method further includes: Upon receiving a password setting operation that updates the historical password to the current password, the user account corresponding to the password setting operation is determined; Based on the historical password and the current password, the first password obfuscation result is calculated using an obfuscation algorithm; The first password obfuscation result is associated with and stored with the user account.

12. The method according to claim 11, characterized in that, The method further includes: In response to the password reset operation in the password reset interface, a second password obfuscation result is calculated based on the second password and the historical password using an obfuscation algorithm; The first password obfuscation result is updated to the second password obfuscation result and stored in association with the user account.

13. The method according to claim 2, characterized in that, The step of decrypting the first password obfuscation result using the first password to obtain the password to be verified includes: Calculate the hash value of the second password corresponding to the first password; Based on the second cryptographic hash value and the first cryptographic obfuscation result, the code to be verified is obtained by subtraction. Based on the target encoding rule, the character conversion of the code to be verified is performed to obtain the password to be verified, wherein the target encoding rule is determined based on the password character type.

14. The method according to any one of claims 1 to 13, characterized in that, The method further includes: Upon receiving a password setting operation that updates the historical password to the current password, the encryption result is generated based on the historical password and the current password; The encryption result is stored in a trusted execution environment, which is used to securely store the encryption result. The step of decrypting the encryption result using the first password to obtain the password to be verified includes: In the trusted execution environment, the encryption result is decrypted using the first password to obtain the password to be verified.

15. The method according to any one of claims 1 to 14, characterized in that, The method further includes: In response to a password input operation on the password input interface, obtain the third password indicated by the password input operation; If the third password is inconsistent with the current password, and the number of password input operations reaches a threshold, a password reset control is displayed. In response to a trigger operation on the password reset control, the password reset interface is displayed.

16. A password reset device, characterized in that, The device includes: The first acquisition module is used to acquire the first password in response to the historical password input operation in the password reset interface. The password reset interface is an interface for resetting the current password by inputting a historical password. The decryption module is used to decrypt the encryption result using the first password to obtain the password to be verified, wherein the encryption result is generated based on the historical password and the current password; An update module is used to update the current password to the second password indicated by the password reset operation in the password reset interface when the password to be verified is the same as the current password.

17. A computer device, characterized in that, The computer device includes a processor and a memory; the memory stores at least one instruction, which is executed by the processor to implement the password reset method as described in any one of claims 1 to 15.

18. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, which is executed by a processor to implement the password reset method as described in any one of claims 1 to 15.

19. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to implement the password reset method as described in any one of claims 1 to 15.