Password management method and program product
By obfuscating and segmenting the passwords entered by users, and combining blacklist and whitelist detection with stack detection, the security shortcomings of the password protection mechanism in the existing technology are resolved, and protection against underlying attacks and support for legitimate requests are achieved.
Patent Information
- Application Number
- CN202511179327.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-08-22
AI Technical Summary
When facing underlying attacks, the existing technology has obvious security shortcomings in the password protection mechanism. Malicious programs can obtain plaintext password characters through mechanisms such as hooks, leading to leaks.
By obfuscating the password entered by the user, splitting it into multiple characters for storage, and deobfuscating it when a legitimate request is made, combined with blacklist and whitelist and stack detection, we ensure that the password is obtained through legitimate requests.
It effectively improves the security of password management, prevents the leakage of plaintext passwords, and enhances the protection against underlying attacks.
Smart Images

Figure CN120688093A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of password protection, and more specifically, to a password management method and program product. Background Art
[0002] In the prior art, when users log into a business system by entering a password, they typically use asterisks "*****" on the login interface to protect the privacy of the password they enter. However, the system temporarily stores the plaintext password characters entered by the user in a recognizable form in a temporary workspace on the client.
[0003] When a malicious program attacks the password box, it can use mechanisms such as the password box handle or keyboard hook to obtain the plaintext password characters cached by the system, thereby leaking the plaintext password characters.
[0004] To combat this type of malicious access, existing technologies typically employ security control technology, system hook protection, and multi-factor authentication to protect plaintext passwords. However, these methods are ineffective against low-level attacks like rootkits, as they typically employ advanced attack methods that embed malicious code into the target process's memory and execute it. These methods often bypass traditional security measures (such as file scanning and basic API monitoring) and are more adaptable and concealed to attacks like password theft. This results in significant security shortcomings in existing protection mechanisms. Summary of the Invention
[0005] The purpose of this application is to provide a password management method and program product for improving the security of password protection.
[0006] In order to achieve the above objectives, the technical solutions adopted in the embodiments of the present application are as follows: In a first aspect, an embodiment of the present application provides a password management method, comprising: Receiving password input characters obtained by the keyboard component; the password input characters are used to log in to the program; Obfuscate each password input character through the obfuscator, obtain the corresponding character obfuscation value, and delete the corresponding password input character; Storing each character obfuscation value in a corresponding storage area, and recording the association relationship between different storage areas; When there is a legitimate password reading request, obtaining the obfuscation value of each character according to the association relationship; Performing deobfuscation processing on each character obfuscated value by the obfuscator to obtain the corresponding password input character; All the password input characters are combined to form a temporary password which is displayed in the keyboard assembly.
[0007] Optionally, the step of recording associations between different storage areas includes: The character obfuscation value and the storage index of the character obfuscation value are recorded in a linked list; the storage index is used to point to the previous storage area or the next storage area.
[0008] Optionally, the step of performing deobfuscation processing on each of the character obfuscated values by the obfuscator includes: The storage index of each character obfuscation value in the linked list is traversed to obtain each character obfuscation value one by one, and each character obfuscation value is deobfuscated to obtain the corresponding password input character.
[0009] Optionally, the step of performing obfuscation processing on each password input character by an obfuscator to obtain a corresponding character obfuscation value includes: The obfuscator searches an obfuscation conversion table for a character obfuscation value corresponding to the password input character; The step of performing deobfuscation processing on each character obfuscated value by the obfuscator to obtain the corresponding password input character includes: The obfuscator searches the obfuscated conversion table for the password input character corresponding to the character obfuscation value.
[0010] Optionally, the method further includes: When receiving a password read request, obtaining execution context information in the stack of the program; Parsing the execution context information to obtain at least one functional module of the program; Verify the functional module in the black and white lists; If the functional module belongs to the legal module in the black and white list, the password reading request is the legal password reading request; If the functional module belongs to the illegal module in the black and white list, the password reading request is the illegal password reading request.
[0011] Optionally, the method further includes: If the functional module belongs to the legal module in the black and white list, the security mark switch is configured to be on to execute the step of obtaining the obfuscation value of each character according to the association relationship; If the functional module belongs to the illegal module in the black and white list, the security mark switch is configured to be in an off state to output a null value.
[0012] In a second aspect, an embodiment of the present application provides a password management device, comprising: A transceiver module, configured to receive password input characters obtained by the keyboard assembly; the password input characters are used to log into the program; A processing module is configured to perform obfuscation processing on each password input character using an obfuscator to obtain a corresponding character obfuscation value, and delete the corresponding password input character; store each character obfuscation value in a corresponding storage area and record the association relationship between different storage areas; when there is a legitimate password read request, obtain each character obfuscation value based on the association relationship; perform deobfuscation processing on each character obfuscation value using the obfuscator to obtain the corresponding password input character; The display module is used for displaying a temporary password formed by all the password input characters in the keyboard assembly.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory for storing one or more programs; processor; When the one or more programs are executed by the processor, the method as described in any one of the above-mentioned first aspects is implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the method as described in any one of the above-mentioned first aspects when the computer program is executed by a processor.
[0015] In a fifth aspect, an embodiment of the present application provides a program product, which, when executed by a processor, implements the method as described in any one of the above-mentioned first aspects.
[0016] Compared with the prior art, the password management method and program product provided by the embodiment of the present application performs obfuscation processing on the plain text password input characters entered by the user to obtain the corresponding character obfuscation value and delete the corresponding password input characters. This prevents external programs from directly maliciously obtaining the plain text of the password. Furthermore, when there is a legitimate password reading request, each character obfuscation value is obtained separately according to the association relationship of the stored character obfuscation values, and then a temporary password of the inscription is provided through deobfuscation processing, which effectively improves the security of password management and the protection against underlying attacks.
[0017] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A flowchart of a password management method provided by an embodiment of the present invention; Figure 2 A schematic diagram of plain text storage of passwords in the prior art; Figure 3 A flowchart of another password management method provided by an embodiment of the present invention; Figure 4 A schematic diagram of a character obfuscation value and storage index provided by an embodiment of the present invention; Figure 5 A schematic diagram of character obfuscation value storage provided by an embodiment of the present invention; Figure 6 A flowchart of another password management method provided by an embodiment of the present invention; Figure 7 A flowchart of another password management method provided by an embodiment of the present invention; Figure 8 A flowchart of another password management method provided by an embodiment of the present invention; Figure 9 A schematic diagram of a stack; Figure 10 A schematic diagram of another type of stack; Figure 11 A schematic diagram of a temporary password output provided by an embodiment of the present invention; Figure 12 An interactive diagram of a password management method provided by an embodiment of the present invention; Figure 13 An interactive diagram of a blacklist and whitelist verification provided by an embodiment of the present invention; Figure 14 A schematic diagram of a layered protection provided by an embodiment of the present invention; Figure 15 A schematic diagram of a password management device provided by an embodiment of the present invention; Figure 16 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Generally, the components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations.
[0021] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the present application without creative work are within the scope of protection of the present application.
[0022] It should be noted that similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and should not be understood as indicating or implying relative importance.
[0023] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0024] In the prior art, when a user enters a password to log into a business system, the system temporarily stores the plaintext password characters entered by the user in memory. At this point, if a malicious program finds the password box handle and then sends a specified message to the password box, the password box can return the cached plaintext password. Alternatively, if the user hooks the keyboard, the plaintext password characters entered by the user can be captured. These situations can pose significant security risks, causing the user's password to be maliciously read during and after password entry, resulting in password leakage.
[0025] In the existing technology, there are several common solutions to solve the problem of passwords being read maliciously: 1) Security control technology: Building an encrypted input channel (such as a bank's online banking control) through ActiveX or browser plug-ins, encrypting keyboard input at the driver layer, can prevent conventional keylogging. However, this technology has problems such as poor cross-platform compatibility and high update and maintenance costs.
[0026] 2) System Hook Protection: This prevents keyboard hook installation by intercepting or disabling functions such as SetWindowsHookEx through API Hook, but it cannot defend against kernel-level driver attacks.
[0027] 3) Multi-factor authentication: Combining SMS verification codes with biometrics (fingerprint / face) for secondary verification improves security but increases the complexity of user operations.
[0028] Existing technologies often focus on protecting a single attack surface and lack systematic design. Some solutions overly rely on system APIs (such as encryption controls), resulting in significant weaknesses in combating underlying attacks like rootkits. Furthermore, most fail to implement dynamic runtime detection mechanisms, making them incapable of addressing new injection attacks.
[0029] In response to the technical problems of the above-mentioned prior art, the present application provides a password management mechanism, the core idea of which is to implement memory obfuscation protection for password input characters. The system will dynamically split, obfuscate and encrypt the password input characters entered by the user and immediately destroy all plaintext traces after the input is completed.
[0030] Optionally, a possible implementation of a password management method is provided below. Specifically, Figure 1 A flowchart of a password management method provided by an embodiment of the present invention is shown in FIG. Figure 1 , the method comprising: Step 100: Receive password input characters obtained by the keyboard component.
[0031] Among them, the password input characters are used to log in to the program.
[0032] Step 101: Obfuscate each password input character through an obfuscator to obtain a corresponding character obfuscation value, and delete the corresponding password input character.
[0033] It should be noted that Figure 2 This is a schematic diagram of plain text storage of passwords in the prior art, see Figure 2In a conventional solution, when a user enters a password, for example, if the user presses the keyboard six times and enters six characters: abc456, the application will cache abc456 as a continuous string. Taking hexadecimal as an example, the hexadecimal representation of the password input characters "abc456" is 61 62 63 34 35 36 (corresponding to ASCII characters: 'a'=0x61, 'b'=0x62, 'c'=0x63, '4'=0x34, '5'=0x35, '6'=0x36). Therefore, see Figure 2 It can be seen that "61 62 63 34 35 36 are continuous, and the address 0056e3d8 clearly shows the starting position." Therefore, a malicious program can obtain the password by obtaining the storage address and plaintext.
[0034] Step 102: Store each character obfuscation value in a corresponding storage area, and record the association relationship between different storage areas.
[0035] Step 103: When there is a legitimate password reading request, obtain the obfuscation value of each character according to the association relationship.
[0036] Step 104: De-obfuscate each character obfuscated value using an obfuscator to obtain the corresponding password input character.
[0037] Step 105: All password input characters are used to form a temporary password and the temporary password is displayed on the keyboard component.
[0038] The password management method provided by the embodiment of the present invention performs obfuscation processing on the plain text password input characters entered by the user to obtain the corresponding character obfuscation value, and deletes the corresponding password input characters. This prevents external programs from directly maliciously obtaining the plain text of the password. Furthermore, when there is a legitimate password reading request, each character obfuscation value is obtained separately according to the association relationship of the stored character obfuscation values, and then a temporary password of the inscription is provided through deobfuscation processing, which effectively improves the security of password management and the protection against underlying attacks. Optionally, the storage method of the character obfuscation value can be implemented using a linked list. A possible implementation method is provided below. Specifically, in Figure 1 On the basis of Figure 3 A flowchart of another password management method provided by an embodiment of the present invention is shown in FIG. Figure 3 , the step 102 includes: Step 102 - 1 : Store each character obfuscation value in a corresponding storage area, and record the character obfuscation value and the storage index of the character obfuscation value in a linked list.
[0039] The storage index is used to point to the previous storage area or the next storage area.
[0040] Optionally, there are multiple ways for the obfuscator to perform obfuscation processing. For example, the obfuscation processing is defined as a "function F()", and the obfuscator can call the "function F()" to implement the obfuscation processing. Taking the password input characters entered by the user: abc456 as an example, in order to avoid the appearance of continuous abc456 ASCII character information in the memory as in the prior art, the example of this application provides a data structure definition as follows: struct KEY_DATA { char * Val; / / value void * pre_key_data; / / Previous Key data void * next_key_data; / / next key data }; Among them, "Val" indicates that the obfuscated value of the characters processed by the obfuscator is stored, "pre_key_data" points to the previous storage area; and "next_key_data" points to the next storage area.
[0041] When the user enters the password input characters, each password input character is divided into a storage area created in a memory, and after the function F() is obfuscated, the result of F(x) is assigned to Val storage. Specifically, Figure 4 A schematic diagram of a character confusion value and storage index provided by an embodiment of the present invention, see Figure 4 After the characters abc456 are split into characters, the linked list storage effect is as follows Figure 4 As shown, the password input characters "abc456" are split and stored in corresponding storage areas with a single character as the granularity. And these storage areas may not be continuous. The next storage area of F(a) points to the address of the storage area of F(b), and the previous storage area of F(b) points to the storage area of F(a), and so on. Figure 4 The previous pointer of the starting F(a) is empty, and the next pointer of the ending F(6) is empty.
[0042] In conventional technology, the storage of password input characters is usually implemented by the API provided by the underlying operating system, such as VirtualAlloc under Windows. However, the storage method using the API may cause different password input character storage areas to be continuous because the storage area specified by the API is ignored by the system. In this application, in order to avoid the above-mentioned problem of continuous storage areas and ensure the versatility of the technical solution, the system API is not used to complete the creation and designation of storage areas. Instead, the method of "one-time application, random use" is adopted. First, based on the size of the input password input characters, a storage area of a reasonable size of memory is applied for at one time. Generally, there is a length limit for passwords, such as 16 characters, and then it is allowed to apply for a storage area of 1M in size.
[0043] When allocating memory, within the 1MB continuous memory area, the 1MB address is allocated in intervals according to the maximum password input character length, resulting in 16 discrete address spaces, which serve as the storage areas for the obfuscated character values. When storing the obfuscated character value, an unused address (storage area) is randomly selected from the 16 discrete address spaces to store the obfuscated character value. This ensures that the storage areas for different obfuscated character values are discrete.
[0044] Optionally, Figure 5 A schematic diagram of a character obfuscation value storage provided by an embodiment of the present invention, taking the password entered by the user as "abc456" as an example, see Figure 5 , where the red solid circles: 1, 2, 3, 4, 5, 6 are serial numbers. The red boxes mark the plaintext password input characters corresponding to each serial number: a, b, c, 4, 5, 6. Taking serial number "1" as an example, the password input character "a" has a corresponding character obfuscation value of "0xda" after obfuscation. The front end "0x0057d8cc" of the row where serial number "1" is located represents the memory address of the corresponding storage area. Therefore, the meaning of this row is: the character obfuscation value of the password input character "a" after obfuscation is located at the memory address 0x0057d8cd (located at the second character in the current row, the address needs to be added by 1), and the value at this address is 0xda.
[0045] Similarly, the serial number "2" is located at the fourth character in the current row, which means that the obfuscated value of the password input character "b" is stored in the memory at 0x00580618 after obfuscation, and the obfuscated value of the character is 0x18.
[0046] It can be seen that, through the storage mechanism of the present application, each character obfuscation value is discontinuously divided and stored in each storage area.
[0047] Optionally, based on the linked list and the storage index, the password input characters, i.e. the plain text of the password, can be restored during the deobfuscation process. Figure 1 On the basis of Figure 6 A flowchart of another password management method provided by an embodiment of the present invention is shown in FIG. Figure 6 , the step 104 comprises: Step 104 - 1 , traverse the storage index of each character obfuscation value in the linked list, obtain each character obfuscation value one by one, and perform deobfuscation processing on each character obfuscation value to obtain the corresponding password input character.
[0048] There are many possible implementations for "obfuscation processing" and "deobfuscation processing", for example, using an obfuscation conversion table. Figure 1 On the basis of Figure 7 A flowchart of another password management method provided by an embodiment of the present invention is shown in FIG. Figure 7 , the step 101 includes: Step 101-1: The obfuscator searches the obfuscated conversion table for the character obfuscation value corresponding to the password input character, and deletes the corresponding password input character.
[0049] Similarly, step 104 includes: Step 104-2: The obfuscator searches the obfuscation conversion table for the password input character corresponding to the character obfuscation value.
[0050] Optionally, the obfuscation conversion table may be as shown in Table 1 below, establishing a correspondence between password input characters and character obfuscation values.
[0051]
[0052] Table 1 Optionally, since there may still be malicious attempts to obtain passwords during program execution, this application also provides a protection mechanism during program execution. The core logic of this mechanism is to perform real-time detection of the program stack during program execution, and to ensure that the modules of each processing step comply with security settings by tracking the upper and lower file stacks of the program in real time (e.g., detecting whether there are any abnormal transfer links). Specifically, Figure 8 A flowchart of another password management method provided by an embodiment of the present invention is shown in FIG. Figure 8 , the method further comprises: Step 106: When a password read request is received, the execution context information in the program stack is obtained.
[0053] Optionally, the execution context information may be obtained via a secure password control.
[0054] Step 107: parse the execution context information to obtain at least one functional module of the program.
[0055] Step 108: Verify the functional module in the blacklist and whitelist.
[0056] If the function module is a legal module in the black and white lists, then step 109 is executed. If the function module is an illegal module in the black and white lists, then step 110 is executed.
[0057] Step 109: Confirm that the password read request is a legal password read request.
[0058] Step 110: Confirm that the password read request is an illegal password read request.
[0059] Specifically, a program's stack and stack frame are memory management mechanisms for function calls. The stack is a memory storage area during program execution that follows the Last In First Out (LIFO) principle and is used to manage function calls and local variables. Each time a function is called, the operating system allocates a memory storage area on the stack, called a stack frame, to store the function's: Parameters Return Address Local Variables Saved Registers Other context information (such as base pointer) Furthermore, for active stack frames, the frame structure composed in the order of calls can be understood as a "call stack". Optionally, Figure 9 For a schematic diagram of a stack, see Figure 9 Each line of the call stack represents a stack frame, including ChildEBP (base pointer), return address, parameters, and the called function. For example, the top stack frame is ntdll!NtDuplicateToken+0xc, indicating a system call-level function. It then calls RtlImpersonateSelfEx, ImpersonateSelf, functions in the CRYPT32 and Wintrust modules, and finally functions related to S**ouWb (a Wubi input method).
[0060] As you can see, the stack maintains the program's execution context, ensuring that each function call and return is executed correctly. Whenever a function call occurs, the current execution context information (including register status, local variables, etc.) is saved on the stack so that it can be restored when the function returns. Whenever a function is called, the program creates a new stack frame, which contains the following information: Function parameters: parameters passed to the function. Local variables: variables defined inside the function. Return address: the address to which the program needs to return after the function is executed. Optionally, when there is a password read request (for example, calling the "password method GetPassword()"), the program actively obtains the current call stack, parses the existing modules frame by frame from the call stack, and performs a blacklist and whitelist check on the parsed modules. Optionally, Figure 10 For a schematic diagram of another stack, see Figure 10 , the PicFace module can be parsed out, and the blacklist and whitelist verification of the PicFace module can be performed using the above example.
[0061] Malicious programs may use hooking techniques to inject code and intercept user input. These hooks may modify normal function call paths to insert malicious code. Therefore, by examining the execution context information in the stack, we can detect abnormal call paths, such as those from unexpected function modules or addresses. By viewing the call stack information, if the PicFace module is hit by the blacklist verification logic, the illegal password read request can be identified as "illegal password read request."
[0062] Optionally, for the blacklist and whitelist, a possible implementation is provided below, for example, a parameter switch - blacklist and whitelist mode is provided, when the value is 0 - blacklist mode, 1 - whitelist mode, the default is 0 - blacklist mode.
[0063] The blacklist and whitelist include: module name, module hash value (using SHA-256), verification level (0-low, indicating verification of module name only, 1-high, indicating verification of both module name and hash value), type: 0-blacklist 1-whitelist, etc. An example of the blacklist and whitelist is shown in Table 2 below:
[0064] Table 2 The above step 108 can be verified by "parameter switch - blacklist and whitelist mode". Specifically: Blacklist mode judgment logic: First, based on the function module name appearing in the stack, a corresponding record is checked in the blacklist and whitelist. If so, the call is verified based on the verification level of the corresponding record. If the verification level is 0 (low), only the function module name is verified, indicating a hit on the blacklist. If the verification level is 1 (high), both the function module name and the hash value are verified. The hash value of the function module is calculated. If the calculated hash value matches the hash value of the corresponding function module record in the blacklist, it is considered a hit; otherwise, it is a miss. Only when at least one of all the function modules appearing in the stack is a hit is the call considered unsafe; if all misses are considered safe.
[0065] Whitelist mode judgment logic: First, based on the function module name appearing in the stack, a corresponding record is checked in the whitelist and blacklist. If so, the call is verified based on the verification level of the corresponding record. If the verification level is 0 (low), only the function module name is verified, indicating a hit on the whitelist. If the verification level is 1 (high), both the function module name and the hash value are verified. The hash value of the function module is calculated. If the calculated hash value matches the hash value of the corresponding function module record in the whitelist, the call is considered safe. Otherwise, it is considered unsafe. Only when all function modules appearing in the stack are hit in the whitelist, the call is considered safe. Otherwise, it is considered unsafe.
[0066] Optionally, the blacklist and whitelist can be the same table, with different names depending on the parameter switch - blacklist and whitelist mode. Optionally, the "parameter switch" can indicate two separate tables, for example, parameter switch (type): 0 corresponds to the blacklist table; parameter switch (type): 1 corresponds to the whitelist table.
[0067] Optionally, the secure password box that provides a "keyboard component" can be built based on a standard password component to ensure that a temporary password can be obtained for a "valid password read request," while a temporary password cannot be obtained for an "illegal password read request." The secure password box can also include a security flag switch that indicates whether a temporary password can be obtained based on the state of the security flag switch, depending on whether the functional module is a valid module or an illegal module.
[0068] Therefore, the following provides a mechanism for using a safe flag switch: If the functional module is a legitimate module in the blacklist or whitelist, the security mark switch is configured to be on to execute the above steps 103 to 105.
[0069] If the function module belongs to the illegal module in the blacklist and whitelist, the security mark switch is configured to be off to output a null value.
[0070] Specifically, in order to implement the "safe flag switch" function, in addition to adding the "safe flag switch" to the security password box, a password acquisition method GetPassword() and a method for opening the safe flag switch "OpenSafeFlag()" can also be added.
[0071] Optionally, the "safe flag switch" can be understood as a private attribute and cannot be directly operated. The "safe flag switch" needs to be operated through the open safe flag switch method "OpenSafeFlag()".
[0072] Optionally, Figure 11 A schematic diagram of a temporary password output provided by an embodiment of the present invention, see Figure 11 The user enters password characters through the keyboard component, for example, the first input is: a; the second input is: b; the third input is: c; the fourth input is: 4; the fifth input is: 5; and the sixth input is: 6. The obfuscator then obfuscates each password character input, obtaining an obfuscated value. These values are then stored in discrete memory areas. When reading password characters entered by the user, the program first turns on the security flag and calls the "Password method GetPassword()." At this point, the program performs a stack security check based on a blacklist and whitelist. If the check passes, the obfuscator traverses the linked list in the example above and deobfuscates each password character in the list, for example, by calling the "deobfuscation function UF()." The password characters generated from each deobfuscation are then concatenated into a temporary password variable, and the security flag is turned off. This ensures that the temporary password is only output once each time the security flag is turned on, further improving security.
[0073] Optionally, a possible interactive implementation of a password management method is provided below. Specifically, Figure 12 An interactive diagram of a password management method provided by an embodiment of the present invention, see Figure 12 , the interaction process includes: Step 200: The user enters password input characters on the keyboard component.
[0074] Step 201: The obfuscator performs obfuscation processing on each character of the password input to obtain an obfuscated value for each character.
[0075] Step 202: Delete the character obfuscation value corresponding to each character obfuscation value.
[0076] Step 203: Store each character obfuscation value in a corresponding storage area.
[0077] It should be noted that the execution order of step 202 and step 203 is not limited, and they can be performed sequentially or in parallel.
[0078] Step 204: Display the hidden symbol “****” of the password input characters in the security password box.
[0079] Step 205: The internal program sends a password reading request.
[0080] Optionally, for example, for hidden password input characters, if the user clicks the interactive button that displays "password input characters" in the security password box, it can be understood as a "password reading request" issued by the internal program.
[0081] Step 206: The external program sends a password reading request.
[0082] Step 207: The security password box is verified based on the black and white lists.
[0083] Specifically, referring to the above example, the verification finally determines whether the password read request is a valid password read request or an illegal password read request. If it is illegal, step 208 is executed. If it is valid, step 209 is executed.
[0084] Step 208: Output a null value to the external program.
[0085] Step 209: Output a temporary password to the internal program.
[0086] Optionally, this application can filter password read requests using blacklists and whitelists and security flag switches. The following provides a possible interactive implementation of blacklist and whitelist verification. Specifically, Figure 13 An interactive diagram of a blacklist and whitelist check provided by an embodiment of the present invention, see Figure 13 , the interaction process includes: Step 300: The internal program sends a password reading request.
[0087] Step 301: An external program sends a password reading request.
[0088] Optionally, to verify the source of password read requests, you can use the security flag switch to filter internal and external password read requests. The following is a possible mechanism: Step 302: The internal program sends a request to read the security flag switch.
[0089] Specifically, in the case where the password needs to be read, it can be set that a security mark switch request must be read at the same time as the password read request is sent, so that the corresponding temporary password can only be obtained when the "security mark switch" is "on".
[0090] Step 303: The external program sends a request to read the security flag switch.
[0091] Typically, if an external program is unaware of the mechanism that requires a security flag switch read request to be sent simultaneously with a password read request, it will not send the security flag switch read request in step 303. Therefore, the secure password box determines whether the password read request originated from an internal program or an external program based on whether the "security flag switch read request" has been sent.
[0092] Step 304: The security password box performs internal and external request verification.
[0093] Specifically, referring to the above, if both a "password read request" and a "security flag read switch request" are present, the requester can be identified as "pending" to prevent external programs from mimicking the "security flag read switch request." If only a "password read request" is sent, it can be identified as an external program, and step 307 is directly executed, outputting a null value.
[0094] Step 305: The security password box performs a blacklist and whitelist check.
[0095] Specifically, if it is legal, the security mark switch is configured to be “on”; if it is illegal, the security mark switch is configured to be “off” and step 307 is executed.
[0096] When the security mark switch is configured to "on", step 306, based on the above example, the security password box outputs the temporary password, and the security mark switch is configured to "off" to prevent the temporary password from being leaked.
[0097] Step 307: Based on the above example, the security password box outputs a null value.
[0098] Based on the above, it can be found that the present application provides layer-by-layer protection for the password method, from user input - password storage - password message filtering - blacklist and whitelist verification. Specifically, Figure 14 A schematic diagram of a layered protection provided by an embodiment of the present invention, see Figure 14 Among them, the first layer of protection: provides a dynamically changing virtual key combination on the keyboard component, which automatically reorganizes the key position each time it is used. Even if an attacker peeks at the input action, it is difficult to reproduce the real password.
[0099] Furthermore, the second layer of protection: the password input characters entered by the user are obfuscated and stored in corresponding, non-contiguous storage areas. All traces of the plaintext are immediately destroyed after the input is completed.
[0100] The third layer of protection: By using the security flag switch, a message filtering "firewall" is established. This accurately intercepts all illegal password-reading requests that attempt to steal input box contents. For example, the common WM_GETTEXT message, which retrieves control text, is specially processed. A valid temporary password is only returned when the security flag switch is turned on.
[0101] The fourth layer of protection: Introducing runtime monitoring: Real-time detection of the program stack during operation, by real-time tracking of the execution context information of the program (such as detecting whether there are any abnormal transfer links), to ensure that the functional modules of each processing step are legal.
[0102] Therefore, the basic protection currently used by mainstream systems (displaying asterisks and simple encryption) is like adding a common lock to a password. Professional hacking tools already possess "master keys" that can break through this basic protection and access sensitive information. Therefore, a more advanced, multi-layered protection system is needed to ensure that the entire password input process, from entry to verification, is protected at the level of a "safe." The solution provided in the above example of this application builds a multi-level, multi-dimensional password input protection system from four aspects: software virtual input, memory protection, window message filtering, and runtime monitoring. This effectively addresses the security flaws of traditional password input boxes.
[0103] In order to execute the steps of the above examples to achieve the corresponding technical effects, the present application also provides a possible implementation of a password management device. Specifically, Figure 15 A schematic diagram of a password management device provided by an embodiment of the present invention, see Figure 15 The device 40 includes: a transceiver module 400, a processing module 401 and a display module 402.
[0104] The transceiver module 400 is used to receive password input characters obtained by the keyboard component.
[0105] Processing module 401 is used to obfuscate each password input character through an obfuscator to obtain a corresponding character obfuscation value and delete the corresponding password input character; store each character obfuscation value in a corresponding storage area and record the association relationship between different storage areas; when there is a legitimate password read request, obtain each character obfuscation value based on the association relationship; and deobfuscate each character obfuscation value through an obfuscator to obtain the corresponding password input character.
[0106] The display module 402 is used to display the temporary password formed by all the password input characters in the keyboard component.
[0107] Optionally, the processing module 401 is specifically configured to record the character obfuscation value and the storage index of the character obfuscation value in a linked list.
[0108] Optionally, the processing module 401 is specifically configured to traverse the storage index of each character obfuscation value in the linked list, obtain each character obfuscation value one by one, and perform deobfuscation processing on each character obfuscation value to obtain the corresponding password input character.
[0109] Optionally, the processing module 401 is specifically configured to query the obfuscated conversion table for a character obfuscation value corresponding to a password input character through the obfuscator; and query the obfuscated conversion table for a password input character corresponding to the character obfuscation value through the obfuscator.
[0110] Optionally, the processing module 401 is specifically used to obtain execution context information in the program's stack when a password reading request is received; parse the execution context information to obtain at least one functional module of the program; and verify the functional module in the black and white list; if the functional module belongs to a legal module in the black and white list, the password reading request is a legal password reading request; if the functional module belongs to an illegal module in the black and white list, the password reading request is an illegal password reading request.
[0111] Optionally, the processing module 401 is specifically used to configure the security mark switch to an open state if the functional module belongs to a legal module in the black and white list, so as to execute the step of obtaining the obfuscation value of each character respectively according to the association relationship; if the functional module belongs to an illegal module in the black and white list, then configure the security mark switch to a closed state to output a null value.
[0112] The embodiment of the present invention further provides an electronic device that can execute all the steps of the above examples of the embodiment of the present invention to achieve the corresponding technical effects. Specifically, Figure 16 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, see Figure 16 , the electronic device 50 , comprises: a memory 501 , a processor 500 ; Memory 501, used to store one or more programs; Processor 500; When one or more programs are executed by the processor, when the electronic device 50 is used to perform the steps shown in the above-mentioned method examples, it can achieve each step and corresponding technical effects.
[0113] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0114] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0115] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the existing technology, or the part of the technical solution, can be embodied in the form of a program product. The program product is stored in a computer-readable storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.
[0116] The above are merely preferred embodiments of the present application and are not intended to limit the present application. Those skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
[0117] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above and that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the present application is defined by the appended claims, not the foregoing description, and all variations within the meaning and range of equivalents of the claims are intended to be included therein. Any reference sign in a claim should not be construed as limiting the claim to which it relates.
Claims
1. A password management method, characterized in that: include: Receive the password input characters obtained by the keyboard component; The password input characters are used to log in to the program; Obfuscate each password input character through the obfuscator, obtain the corresponding character obfuscation value, and delete the corresponding password input character; Storing each character obfuscation value in a corresponding storage area, and recording the association relationship between different storage areas; When there is a legitimate password reading request, obtaining the obfuscation value of each character according to the association relationship; Performing deobfuscation processing on each character obfuscated value by the obfuscator to obtain the corresponding password input character; All the password input characters are combined to form a temporary password which is displayed in the keyboard assembly.
2. The method according to claim 1, characterized in that The step of recording the association relationship between different storage areas includes: The character obfuscation value and the storage index of the character obfuscation value are recorded in a linked list; the storage index is used to point to the previous storage area or the next storage area.
3. The method according to claim 2, characterized in that The step of performing deobfuscation processing on each of the character obfuscated values by the obfuscator comprises: The storage index of each character obfuscation value in the linked list is traversed to obtain each character obfuscation value one by one, and each character obfuscation value is deobfuscated to obtain the corresponding password input character.
4. The method according to claim 1, wherein The step of performing obfuscation processing on each password input character by the obfuscator to obtain the corresponding character obfuscation value includes: The obfuscator searches an obfuscation conversion table for a character obfuscation value corresponding to the password input character; The step of performing deobfuscation processing on each character obfuscated value by the obfuscator to obtain the corresponding password input character includes: The obfuscator searches the obfuscated conversion table for the password input character corresponding to the character obfuscation value.
5. The method according to claim 1, wherein Also includes: When receiving a password read request, obtaining execution context information in the stack of the program; Parsing the execution context information to obtain at least one functional module of the program; Verify the functional module in the black and white lists; If the functional module belongs to the legal module in the black and white list, the password reading request is the legal password reading request; If the functional module belongs to the illegal module in the black and white list, the password reading request is the illegal password reading request.
6. The method according to claim 5, characterized in that Also includes: If the functional module belongs to the legal module in the black and white list, the security mark switch is configured to be on to execute the step of obtaining the obfuscation value of each character according to the association relationship; If the functional module belongs to the illegal module in the black and white list, the security mark switch is configured to be in an off state to output a null value.
7. A password management device, characterized in that: include: The transceiver module is used to receive the password input characters obtained by the keyboard component; The password input characters are used to log in to the program; A processing module is configured to perform obfuscation processing on each password input character using an obfuscator to obtain a corresponding character obfuscation value, and delete the corresponding password input character; store each character obfuscation value in a corresponding storage area and record the association relationship between different storage areas; when there is a legitimate password read request, obtain each character obfuscation value based on the association relationship; perform deobfuscation processing on each character obfuscation value using the obfuscator to obtain the corresponding password input character; The display module is used for displaying a temporary password formed by all the password input characters in the keyboard assembly.
8. An electronic device, characterized in that: include: a memory for storing one or more programs; processor; When the one or more programs are executed by the processor, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A program product, characterized in that When the program product is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Progress authentication method based on password
CN104408365A
Method for preventing network application program interface from being maliciously attacked
CN108471432A
Mobile payment password keyboard based on key splitting protection in iOS system and implementation method thereof
CN111915290A
Login code security management method, alarm mail sending method, and related equipment
CN112333153A
Method and system for protecting password by using secure keyboard
CN112507403A