A password management method and program product
By obfuscating and discontinuously storing user-inputted passwords, combined with blacklists, whitelists, and security flag switches, the problem of password leakage in existing technologies is solved, achieving higher security and protection.
Patent Information
- Application Number
- CN202511179327.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-08-22
AI Technical Summary
Existing technologies have significant security weaknesses in their password protection mechanisms against low-level attacks. Malicious programs can obtain plaintext password characters through hooks and other mechanisms, making it difficult for existing protection methods to effectively defend against them.
The user-input password characters are obfuscated by an obfuscator to generate obfuscated character values, which are then stored in a non-contiguous storage area. Combined with blacklists, whitelists, and security flag switches, this ensures that the password can be recovered when a legitimate request is made, while preventing unauthorized requests from obtaining the plaintext.
It improves the security of password management, effectively prevents password leakage during low-level attacks, and enhances the security of password input.
Smart Images

Figure CN120688093B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cryptographic protection, and more specifically, to a cryptographic management method and program product. Background Technology
[0002] In existing technology, when users log in to a business system by entering a password, they typically protect the password input with asterisks "*****" on the login screen. However, the system temporarily stores the plaintext password characters entered by the user in a recognizable form in the client's temporary workspace.
[0003] When a malicious program attacks a password field, it can use mechanisms such as password field handles or keyboard hooks to obtain plaintext password characters cached by the system, thereby leading to the leakage of plaintext password characters.
[0004] To combat such malicious reading, existing technologies typically employ "security control technology," "system hook protection," and "multi-factor authentication" to transmit plaintext passwords. However, these methods are less effective against low-level attacks such as "rootkits," which often involve injecting malicious code into the target process's memory and executing it. Rootkits typically bypass traditional security measures (such as file scanning and basic API monitoring), making them more adaptable and stealthy against password theft attacks. This results in significant security vulnerabilities in existing protection mechanisms. Summary of the Invention
[0005] The purpose of this application is to provide a password management method and program product to improve the security of password protection.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0007] In a first aspect, embodiments of this application provide a method for managing passwords, including:
[0008] Receives password input characters obtained from the keyboard component; the password input characters are used for the login program.
[0009] Each password input character is obfuscated using an obfuscator to obtain the corresponding character obfuscation value, and the corresponding password input character is then deleted.
[0010] Each character obfuscation value is stored in its corresponding storage area, and the association between different storage areas is recorded.
[0011] When a legitimate password read request is received, the obfuscation value of each character is obtained according to the aforementioned association.
[0012] The obfuscator performs deobfuscation on each character obfuscation value to obtain the corresponding password input character.
[0013] All the password input characters are used to form a temporary password, which is then displayed on the keyboard component.
[0014] Optionally, the step of recording the association between different storage areas includes:
[0015] The character obfuscation value and its storage index are recorded in the linked list; the storage index is used to point to the previous or next storage area.
[0016] Optionally, the step of deobfuscating each character obfuscation value using the obfuscator includes:
[0017] 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.
[0018] Optionally, the step of obfuscating each password input character using an obfuscator to obtain the corresponding character obfuscation value includes:
[0019] The obfuscator queries the obfuscation table for the character obfuscation value corresponding to the password input character.
[0020] The step of deobfuscating each character obfuscation value using the obfuscator to obtain the corresponding password input character includes:
[0021] The obfuscator queries the obfuscation conversion table for the password input character corresponding to the character obfuscation value.
[0022] Optionally, the method further includes:
[0023] When a password read request is received, the execution context information in the program's stack is obtained;
[0024] Parse the execution context information to obtain at least one functional module of the program;
[0025] The functional modules are verified in the blacklist and whitelist;
[0026] If the functional module belongs to the legitimate modules of the blacklist and whitelist, then the password reading request is the legitimate password reading request;
[0027] If the functional module belongs to the illegal modules in the blacklist or whitelist, then the password reading request is the illegal password reading request.
[0028] Optionally, the method further includes:
[0029] If the functional module belongs to the legitimate modules of the blacklist and whitelist, then the security mark switch is configured to be on, so as to execute the step of obtaining the obfuscation value of each character according to the association relationship;
[0030] If the functional module is an illegal module in the blacklist or whitelist, then the security flag switch is configured to be off to output an empty value.
[0031] Secondly, embodiments of this application provide a password management device, comprising:
[0032] The transceiver module is used to receive password input characters obtained from the keyboard component; the password input characters are used for the login program.
[0033] The processing module is used to obfuscate each password input character using an obfuscator to obtain the 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 a legitimate password reading request exists, obtain each character obfuscation value according to the association relationship; and deobfuscate each character obfuscation value using the obfuscator to obtain the corresponding password input character.
[0034] The display module is used to display a temporary password composed of all the password input characters in the keyboard component.
[0035] Thirdly, embodiments of this application provide an electronic device, including:
[0036] Memory, used to store one or more programs;
[0037] processor;
[0038] When the one or more programs are executed by the processor, the method as described in any one of the first aspects above is implemented.
[0039] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of the first aspects above.
[0040] Fifthly, embodiments of this application provide a program product that, when executed by a processor, implements the method as described in any one of the first aspects above.
[0041] Compared to existing technologies, the password management method and program product provided in this application obfuscate the plaintext password input characters entered by the user to obtain corresponding character obfuscation values, and then deletes the corresponding password input characters. This prevents external programs from directly and maliciously obtaining the plaintext password. Furthermore, when a legitimate password read request exists, each character obfuscation value is obtained according to the association relationship of the stored character obfuscation values, and then a temporary password for the plaintext is provided through deobfuscation processing, effectively improving the security of password management and its protection against low-level attacks.
[0042] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0043] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 A flowchart illustrating a password management method provided in an embodiment of the present invention;
[0045] Figure 2 This is a schematic diagram of plaintext storage of cryptography in existing technologies;
[0046] Figure 3 A flowchart illustrating another password management method provided in an embodiment of the present invention;
[0047] Figure 4 A schematic diagram illustrating a character obfuscation value and storage index provided in an embodiment of the present invention;
[0048] Figure 5 This is a schematic diagram illustrating the storage of character obfuscation values according to an embodiment of the present invention;
[0049] Figure 6 A flowchart illustrating another password management method provided in an embodiment of the present invention;
[0050] Figure 7 A flowchart illustrating another password management method provided in an embodiment of the present invention;
[0051] Figure 8 A flowchart illustrating another password management method provided in an embodiment of the present invention;
[0052] Figure 9 This is a schematic diagram of a stack.
[0053] Figure 10 This is a schematic diagram of another type of stack;
[0054] Figure 11 A schematic diagram illustrating a temporary password output provided in an embodiment of the present invention;
[0055] Figure 12 An interactive schematic diagram illustrating a password management method provided in an embodiment of the present invention;
[0056] Figure 13 This is an interactive schematic diagram of blacklist / whitelist verification provided in an embodiment of the present invention;
[0057] Figure 14 A schematic diagram illustrating a layered protection system provided in an embodiment of the present invention;
[0058] Figure 15 A schematic diagram of a password management device provided in an embodiment of the present invention;
[0059] Figure 16 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0061] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0062] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0063] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0064] In existing technologies, when a user logs into a business system by entering a password, the system temporarily stores the plaintext password characters in memory. At this time, if a malicious program finds the password field handle and sends a specified message to the password field, the password field can return the cached plaintext password. Alternatively, if the user hooks the keyboard, the program can also capture the plaintext password characters entered by the user. These situations can pose significant security risks, all resulting in the problem of passwords being maliciously read during and after the user's password input process, leading to password leaks.
[0065] Currently, there are several common solutions to prevent passwords from being maliciously read:
[0066] 1) Security control technology: Build an encrypted input channel (such as online banking control) through ActiveX or browser plugins. Encrypt keyboard input at the driver layer to defend against regular keylogging, but there are problems such as poor cross-platform compatibility and high update and maintenance costs.
[0067] 2) System hook protection: By intercepting or disabling functions such as SetWindowsHookEx through API Hook, keyboard hook installation can be prevented, but it cannot defend against kernel-level driver attacks.
[0068] 3) Multi-factor authentication: Combining SMS verification codes and biometrics (fingerprint / face) for secondary verification improves security but increases the complexity of user operations.
[0069] Existing technologies often focus on protecting against single attack surfaces and lack a systematic design. Some solutions rely excessively on system APIs (such as encrypted controls), which have significant shortcomings in combating low-level attacks such as rootkits. Furthermore, most of them do not implement runtime dynamic detection mechanisms, making it difficult to deal with new types of injection attacks.
[0070] To address the technical problems of the prior art, this application provides a password management mechanism. The core idea is to implement memory-based obfuscation protection for password input characters. The system dynamically segments, obfuscates, encrypts, and stores the password input characters entered by the user, and immediately destroys all plaintext traces after input is completed.
[0071] Alternatively, the following provides a possible implementation of a password management method, specifically... Figure 1 A flowchart illustrating a password management method provided in an embodiment of the present invention is shown below. Figure 1 The method includes:
[0072] Step 100: Receive the password input characters obtained by the keyboard component.
[0073] The password input characters are used to log in to the program.
[0074] Step 101: Obfuscate each password input character using an obfuscator to obtain the corresponding character obfuscation value, and then delete the corresponding password input character.
[0075] It should be noted that, Figure 2 This is a schematic diagram of plaintext storage of cryptography in existing technology. See [link / reference]. Figure 2 In a standard implementation, when a user enters their password, for example, by pressing the key six times to input "abc456" (six characters), the application caches "abc456" as a continuous string. For example, in hexadecimal, the password input characters "abc456" are 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 consecutive, and the address 0056e3d8 clearly shows the starting position". Therefore, a malicious program can obtain the password by obtaining the storage address and plaintext.
[0076] Step 102: Store each character obfuscation value in the corresponding storage area and record the association between different storage areas.
[0077] Step 103: When a legitimate password reading request is received, obtain the obfuscation value for each character according to the association relationship.
[0078] Step 104: Deobfuscate each character's obfuscation value using an obfuscator to obtain the corresponding password input character.
[0079] Step 105: Enter all the password characters to form a temporary password and display it in the keyboard component.
[0080] The password management method provided in this invention obfuscates the plaintext password input characters entered by the user to obtain corresponding character obfuscation values, and then deletes the corresponding password input characters. This prevents external programs from maliciously obtaining the plaintext password. Furthermore, when a legitimate password read request exists, each character obfuscation value is obtained according to the association relationship of the stored character obfuscation values, and then a temporary password for the plaintext is provided through deobfuscation processing, effectively improving the security of password management and its protection against low-level attacks. Optionally, the storage method for character obfuscation values can be implemented using a linked list. A possible implementation method is provided below. Specifically, in... Figure 1 On this basis, Figure 3 A flowchart illustrating another password management method provided in this embodiment of the invention is shown below. Figure 3 Step 102 includes:
[0081] Step 102-1: Store each character obfuscation value in the corresponding storage area, and record the character obfuscation value and its storage index in the linked list.
[0082] The storage index is used to point to the previous or next storage area.
[0083] Optionally, there are multiple ways to perform obfuscation in the obfuscator. For example, the obfuscation process can be defined as a "function F()", which can be called by the obfuscator to perform obfuscation. Taking the user-input password characters "abc456" as an example, in order to avoid the appearance of continuous "abc456" ASCII character information in memory as in the prior art, this application provides a data structure definition as follows:
[0084] struct KEY_DATA
[0085] {
[0086] char * Val; / / Value
[0087] void * pre_key_data; / / Previous key data
[0088] void * next_key_data; / / Next key data
[0089] };
[0090] Here, "Val" indicates that the stored character obfuscation value is processed by the obfuscator, "pre_key_data" points to the previous storage area, and "next_key_data" points to the next storage area.
[0091] When a user enters their password, each character is stored in a separate memory area. After being obfuscated by the function F(), the result of F(x) is assigned to Val for storage. Specifically, Figure 4 A schematic diagram of a character obfuscation value and storage index provided in an embodiment of the present invention is shown below. Figure 4 After the characters "abc456" are split into characters, their linked list storage effect is as follows: Figure 4 As shown, the password input characters "abc456" are broken down and stored in corresponding storage areas at the individual character level. These storage areas can be non-contiguous. The address of the next storage area of F(a) points to the address of the storage area of F(b), and the address of the previous storage area of F(b) points to the address of the storage area of F(a), and so on. Figure 4 The pointer preceding the starting F(a) is null, and the pointer following the ending F(6) is null.
[0092] In conventional technologies, password input character storage is typically implemented using APIs provided by the operating system, such as VirtualAlloc in Windows. However, using APIs for storage can lead to contiguous storage areas for different password input characters because the storage area specified by the API is ignored by the system. In this application, to avoid this problem of contiguous storage areas and to ensure the versatility of the technical solution, the system API is not used to create and specify the storage area. Instead, a "one-time allocation, random use" method is adopted. First, based on the size of the input password characters, a storage area of a reasonable size is allocated in one go. Passwords typically have length limitations, such as 16 characters, thus allowing for a 1MB storage area to be allocated.
[0093] During memory allocation, within a contiguous 1MB memory area, addresses are allocated at intervals according to the maximum length of the password input characters, resulting in 16 non-contiguous address spaces—the storage areas for the character obfuscation values. Then, when storing the character obfuscation value, an unused address (storage area) is randomly selected from these 16 interval address spaces. This ensures that the storage areas for different character obfuscation values are not contiguous.
[0094] Optionally, Figure 5 This is a schematic diagram of character obfuscation value storage provided in an embodiment of the present invention. Taking the user-input password "abc456" as an example, see below. Figure 5The red solid circles (1, 2, 3, 4, 5, 6) represent serial numbers. Red boxes indicate 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" after obfuscation has an obfuscation value of "0xda". The beginning of the line containing serial number "1", "0x0057d8cc", represents the memory address of the corresponding storage area. Therefore, this line means: the obfuscated value of the password input character "a" is located at memory address 0x0057d8cd (the second character in the current line, with the address incremented by 1), and the value at this address is 0xda.
[0095] Similarly, the number "2" is located at the 4th character of the current line, which means: the obfuscated value of the password input character "b" after obfuscation is stored in memory at 0x00580618, and the obfuscation value is 0x18.
[0096] As can be seen, through the storage mechanism of this application, the obfuscation values of each character are stored in separate, non-contiguous segments in different storage areas.
[0097] Optionally, based on this linked list and storage index, the password input characters, i.e., the plaintext of the password, can be recovered during deobfuscation. Specifically, in Figure 1 On this basis, Figure 6 A flowchart illustrating another password management method provided in this embodiment of the invention is shown below. Figure 6 Step 104 includes:
[0098] 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.
[0099] There are several possible implementations for "obfuscation" and "deobfuscation," for example, using obfuscation transformation tables. Specifically, in... Figure 1 On this basis, Figure 7 A flowchart illustrating another password management method provided in this embodiment of the invention is shown below. Figure 7 Step 101 includes:
[0100] Step 101-1: Use the obfuscator to look up the character obfuscation value corresponding to the password input character in the obfuscation conversion table, and delete the corresponding password input character.
[0101] Similarly, for step 104, it includes:
[0102] Step 104-2: Use the obfuscator to look up the password input character corresponding to the character obfuscation value in the obfuscation conversion table.
[0103] Optionally, the obfuscation conversion table can be as shown in Table 1 below, establishing a correspondence between password input characters and character obfuscation values.
[0104]
[0105] Table 1
[0106] Optionally, since malicious password acquisition can still occur during program execution, this application also provides a protection mechanism during program runtime. Its core logic lies in: real-time monitoring of the program's stack during execution, ensuring that each processing module complies with security settings by tracing the preceding and following file stacks (e.g., detecting any abnormal intermediate steps). Specifically, Figure 8 A flowchart illustrating another password management method provided in this embodiment of the invention is shown below. Figure 8 The method also includes:
[0107] Step 106: When a password read request is received, obtain the execution context information in the program's stack.
[0108] Optionally, this execution context information can be obtained through a secure password control.
[0109] Step 107: Parse the execution context information to obtain at least one functional module of the program.
[0110] Step 108: Verify the functional modules in the blacklist and whitelist.
[0111] If the functional module is a legitimate module in the blacklist or whitelist, proceed to step 109. If the functional module is an illegal module in the blacklist or whitelist, proceed to step 110.
[0112] Step 109: Confirm that the password read request is a valid password read request.
[0113] Step 110: Confirm that the password read request is an invalid password read request.
[0114] Specifically, the program's stack and stack frame are memory management mechanisms during function calls. The stack is a memory storage area during program execution, following the Last-In-First-Out (LIFO) rule, 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 for that function, called a stack frame, to store the function's:
[0115] Parameters, return address, local variables, saved registers, and other context information (such as the base pointer) are all part of the call stack. Furthermore, for active stack frames, their frame structure arranged in the order of calls can be understood as a "call stack." Optionally, Figure 9 See the diagram for a stack. 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 topmost stack frame is ntdll!NtDuplicateToken+0xc, indicating that this is a function at the system call level. Then, RtlImpersonateSelfEx, ImpersonateSelf, functions from the CRYPT32 and Wintrust modules are called sequentially, and finally, the relevant functions of S**ouWb (a certain Wubi input method) are called.
[0116] As can be seen, the stack maintains the program's execution context information, ensuring that each function call and return occurs correctly. Whenever a function call occurs, the current execution context information (including register state, local variables, etc.) is saved on the stack so that it can be restored when the function returns. Each time a function is called, the program creates a new stack frame, which contains the following information:
[0117] Function parameters: The arguments passed to the function. Local variables: Variables defined inside the function. Return address: The address the program needs to return to after the function finishes execution. Optionally, when a password reading request exists (e.g., 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 blacklist / whitelist checks on the parsed modules. Optionally, Figure 10 For a diagram of another type of stack, see [link to diagram]. Figure 10 The PicFace module can be parsed, and the blacklist and whitelist can be verified using the above example.
[0118] Malicious programs may inject code and intercept user input using hook techniques. These hooks may modify normal function call paths and insert malicious code. Therefore, by examining the execution context information in the stack trace, it is possible to detect abnormal call paths, such as those from unexpected functional modules or addresses. This reveals the call stack information. If the PicFace module is hit by the blacklist verification logic, the illegal password read request can be identified as an "illegal password read request."
[0119] Optionally, for blacklists and whitelists, one possible implementation is provided below, such as providing a parameter switch - blacklist / whitelist mode, where a value of 0 is blacklist mode and 1 is whitelist mode, with 0 being blacklist mode by default.
[0120] The blacklist and whitelist include: module name, module hash value (using SHA-256), verification level (0 - low, indicating only the module name is verified, 1 - high, indicating that both the module name and hash value are verified), and type: 0 - blacklist, 1 - whitelist, etc. Examples of blacklists and whitelists are shown in Table 2 below.
[0121]
[0122] Table 2
[0123] Step 108 above can be verified using "Parameter Switch - Blacklist / Whitelist Mode". Specifically:
[0124] Blacklist mode judgment logic:
[0125] First, based on the functional module names appearing in the stack trace, check if a corresponding record exists in the blacklist or whitelist. If it exists, perform verification according to the corresponding record's verification level. If the verification level is 0-low, it means only the functional module name is verified, indicating a blacklist hit. If the verification level is 1-high, it means both the functional module name and hash value are verified. In this case, calculate the functional module's hash value. If the calculated hash value matches the hash value of the corresponding functional module record in the blacklist, it is considered a hit; otherwise, it is considered a miss. Only if at least one functional module in the stack trace is hit, meaning the call is considered unsafe, and only if none are hit, is the call considered safe.
[0126] Whitelist mode judgment logic:
[0127] First, based on the functional module names appearing in the stack trace, check if a corresponding record exists in the whitelist or blacklist. If it does, verify the record according to its verification level. If the verification level is 0-low, it means only the functional module name is verified, indicating a whitelist match. If the verification level is 1-high, it means both the functional module name and hash value are verified. The hash value of the functional module is calculated. If the calculated hash value matches the hash value of the corresponding functional module record in the whitelist, it's considered a match; otherwise, it's a miss. Only when all functional modules appearing in the stack trace are matched in the whitelist (a full match) is the call considered safe; otherwise, it's considered unsafe.
[0128] Optionally, the blacklist and whitelist can be the same table, but the names can differ depending on the parameter switch - blacklist / whitelist mode scheme. Optionally, two independent tables can also be indicated by the "parameter switch", for example, parameter switch (type): 0 corresponds to the blacklist table; parameter switch (type): 1 corresponds to the whitelist table.
[0129] Optionally, for the secure password field that provides a "keyboard component," it can be built based on a standard password component. This ensures that "legitimate password read requests" can obtain a temporary password, while "illegitimate password read requests" cannot. The secure password field can also include a security flag switch, which indicates whether a temporary password can be obtained based on the state of the security flag switch, whether the functional module is a legitimate or illegitimate module.
[0130] Therefore, the following provides a mechanism for the use of a safety tag switch:
[0131] If the functional module is a legitimate module in the blacklist or whitelist, then configure the security label switch to be on to execute steps 103 to 105 above.
[0132] If a functional module is an illegal module in the blacklist or whitelist, configure the security flag switch to be off to output an empty value.
[0133] Specifically, in order to implement the "security flag switch" function, in addition to adding the "security flag switch" to the security password box, you can also add a method to get the password (GetPassword()) and a method to open the security flag switch (OpenSafeFlag()).
[0134] Alternatively, the "safety flag switch" can be considered a private property and cannot be directly manipulated. It needs to be manipulated through the "OpenSafeFlag()" method.
[0135] Optionally, Figure 11 This is a schematic diagram of a temporary password output provided in an embodiment of the present invention. See also... Figure 11The user inputs password characters via the keyboard component, for example: first input: 'a'; second input: 'b'; third input: 'c'; fourth input: '4'; fifth input: '5'; sixth input: '6'. The obfuscator then obfuscates each input character, obtaining an obfuscated value, which is stored in non-contiguous memory areas. When the program needs to read the user's input, it first turns on the security flag switch and then calls the "GetPassword()" method. 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, performing deobfuscation on each input character, for example, by calling the "deobfuscation function UF()". It then concatenates each deobfuscated character into a temporary password variable and turns off the security flag switch. This ensures that only one temporary password is output each time the security flag switch is turned on, further improving security.
[0136] Optionally, the following provides a possible interactive implementation of a password management method. Specifically, Figure 12 This is an interactive schematic diagram of a password management method provided in an embodiment of the present invention. (See attached diagram.) Figure 12 The interaction process includes:
[0137] Step 200: The user enters password characters on the keyboard component.
[0138] Step 201: The obfuscator obfuscates each password input character to obtain the obfuscation value for each character.
[0139] Step 202: Delete the character obfuscation value corresponding to each character obfuscation value.
[0140] Step 203: Store the obfuscation value of each character in the corresponding storage area.
[0141] It should be noted that the execution order of steps 202 and 203 is not limited; they can be executed sequentially or in parallel.
[0142] Step 204: Display a hidden indication of the password input characters, “****”, in the security password box.
[0143] Step 205: The internal program sends a password read request.
[0144] Alternatively, for example, if the password input characters are hidden, the user clicking the interactive button that displays "password input characters" in the secure password box can be interpreted as a "password read request" issued by the internal program.
[0145] Step 206: The external program sends a password read request.
[0146] Step 207: The secure password field is verified based on blacklists and whitelists.
[0147] Specifically, as shown in the previous example, this verification ultimately determines whether the password read request is valid or invalid. If invalid, proceed to step 208. If valid, proceed to step 209.
[0148] Step 208: Output an empty value to the external program.
[0149] Step 209: Output a temporary password to the internal program.
[0150] Optionally, this application utilizes blacklists / whitelists and security flag switches to filter password reading requests. Below is a possible interactive implementation method for blacklist / whitelist verification. Specifically... Figure 13 This is an interactive schematic diagram of blacklist / whitelist verification provided in an embodiment of the present invention. See [link / reference]. Figure 13 The interaction process includes:
[0151] Step 300: The internal program sends a password read request.
[0152] Step 301: The external program sends a password read request.
[0153] Optionally, to verify the source of password read requests, a security flag switch can be used to filter internal and external password read requests. One possible mechanism is provided below:
[0154] Step 302: The internal program sends a request to read the security tag switch.
[0155] Specifically, for situations where password reading is required, it can be configured that a security flag switch request must be read simultaneously with the password reading request, so that the corresponding temporary password can only be obtained when the "security flag switch" is "on".
[0156] Step 303: The external program sends a request to read the security tag switch.
[0157] Typically, external programs, unaware of the mechanism that "a security flag switch request must be read simultaneously with a password read request," will not send the security flag switch read request in step 303. This allows the secure password field to determine whether the password read request originates from an internal or external program by checking whether a "security flag switch read request" has been sent.
[0158] Step 304: Verify internal and external requests in the secure password field.
[0159] Specifically, referring to the above, for cases where both a "password read request" and a "security tag switch read request" exist, the requester can be identified as "pending" to prevent external programs from impersonating and sending the "security tag switch read request". For requesters that only send a "password read request", it can be clearly identified as an external program, so step 307 is executed directly, and an empty value is output.
[0160] Step 305: Verify the blacklist and whitelist in the security password box.
[0161] Specifically, if it is valid, the safety tag switch is configured to "on"; if it is invalid, the safety tag switch is configured to "off" and step 307 is executed.
[0162] When the security flag switch is configured to "on", step 306, based on the previous example, outputs a temporary password in the security password box and configures the security flag switch to "off" to prevent the temporary password from being leaked.
[0163] Step 307: Based on the previous example, output an empty value in the security password box.
[0164] Based on the above, it can be seen that this application provides layered protection for the password method, from user input, password storage, message filtering for password retrieval, to blacklist / whitelist verification. Specifically, Figure 14 A schematic diagram of a layered protection system provided in an embodiment of the present invention is shown below. Figure 14 The first layer of protection involves providing dynamically changing virtual key combinations on the keyboard component, which automatically reassemble the key positions each time it is used, making it difficult for attackers to reproduce the real password even if they see the input actions.
[0165] Furthermore, the second layer of protection involves obfuscating the password input characters and storing the obfuscated values in corresponding, non-contiguous storage areas. All plaintext traces are then immediately destroyed after input is complete.
[0166] The third layer of protection: A message filtering "firewall" is established through a security flag switch. It precisely blocks all illegal password reading requests attempting to steal input field content. For example, the common WM_GETTEXT message is used to retrieve control text. Such messages are handled specially; a valid temporary password is only returned when the security flag switch is enabled.
[0167] The fourth layer of protection: Introducing runtime monitoring: Real-time detection of the program's stack during operation, and ensuring that the functional modules of each processing step are legitimate by tracking the execution context information of the program in real time (such as detecting whether there are abnormal transit links).
[0168] Therefore, the basic protections currently used by mainstream systems (displaying asterisks, simple encryption) are like adding a regular lock to a password, while professional hacking tools already possess a "master key" capable of breaching these basic protections to obtain sensitive information. Thus, a more advanced multi-layered protection system is needed to ensure that the entire process from password input to verification is protected at a "safety box" level. The solutions provided in the examples above in this application construct a multi-layered, multi-dimensional password input protection system from four aspects: software virtual input, memory protection, window message filtering, and runtime monitoring, effectively solving the security flaws of traditional password input boxes.
[0169] To perform the steps of the above examples and achieve the corresponding technical effects, this application also provides a possible implementation of a password management device, specifically... Figure 15 A schematic diagram of a password management device provided in an embodiment of the present invention is shown below. Figure 15 The device 40 includes: a transceiver module 400, a processing module 401, and a display module 402.
[0170] The transceiver module 400 is used to receive password input characters obtained from the keyboard component.
[0171] The processing module 401 is used to obfuscate each password input character using an obfuscator to obtain the corresponding character obfuscation value and delete the corresponding password input character; store each character obfuscation value in the corresponding storage area and record the association relationship between different storage areas; when there is a legitimate password reading request, obtain each character obfuscation value according to the association relationship; and deobfuscate each character obfuscation value using the obfuscator to obtain the corresponding password input character.
[0172] Display module 402 is used to display a temporary password composed of all the password input characters in the keyboard component.
[0173] Optionally, the processing module 401 is specifically used to record the character obfuscation value and the storage index of the character obfuscation value in the linked list.
[0174] Optionally, the processing module 401 is specifically used 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.
[0175] Optionally, the processing module 401 is specifically used to query the character obfuscation value corresponding to the password input character in the obfuscation conversion table through the obfuscation unit; and to query the password input character corresponding to the character obfuscation value in the obfuscation conversion table through the obfuscation unit.
[0176] Optionally, the processing module 401 is specifically used to, when a password reading request is received, obtain the execution context information in the program's stack; parse the execution context information to obtain at least one functional module of the program; verify the functional module in a blacklist or whitelist; if the functional module belongs to a legitimate module in the blacklist or whitelist, then the password reading request is a legitimate password reading request; if the functional module belongs to an illegal module in the blacklist or whitelist, then the password reading request is an illegal password reading request.
[0177] Optionally, the processing module 401 is specifically configured to, if the functional module belongs to the legitimate modules in the blacklist or whitelist, configure the security mark switch to the open state to perform the step of obtaining the obfuscation value of each character according to the association relationship; if the functional module belongs to the illegal modules in the blacklist or whitelist, configure the security mark switch to the closed state to output an empty value.
[0178] This invention also provides an electronic device that can execute all the steps of the examples described above to achieve the corresponding technical effects. Specifically, Figure 16 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. See also: Figure 16 The electronic device 50 includes: a memory 501 and a processor 500;
[0179] Memory 501 is used to store one or more programs;
[0180] Processor 500;
[0181] When one or more programs are executed by a processor, the electronic device 50 can achieve the steps and corresponding technical effects when it performs the steps shown in the above method examples.
[0182] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0183] In addition, the functional modules in the various embodiments of this 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.
[0184] If a function is implemented as a software 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 this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a program product. This program product is stored in a computer-readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0185] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. 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.
[0186] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within this application. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A method for managing passwords, characterized in that, include: Receive password input characters obtained from the keyboard component; The password input characters are used to log in to the program; Each password input character is obfuscated using an obfuscator to obtain the corresponding character obfuscation value, and the corresponding password input character is then deleted. Each character obfuscation value is stored in its corresponding storage area, and the association between different storage areas is recorded. When a password read request is received, internal and external request verification is performed to confirm whether a request to read the security tag switch has been received. The password read request is either a password read request sent by an internal program or a password read request sent by an external program. If the request to read the security tag switch is received, the requester of the password reading request is pending. If the request to read the security flag switch is not received, then the requester of the password reading request is the external program, and an empty value is output. When the requester is pending, obtain the execution context information from the program's stack; Parse the execution context information to obtain at least one functional module of the program; The functional modules are verified in the blacklist and whitelist; If the functional module belongs to the illegal modules in the blacklist and whitelist, then the password reading request is an illegal password reading request, and the security flag switch is configured to be in the off state to output an empty value; If the functional module belongs to the legitimate modules of the blacklist and whitelist, then the password reading request is a legitimate password reading request, and the security mark switch is configured to be on. According to the association, the obfuscation value of each character is obtained respectively. The obfuscator deobfuscates each character obfuscation value to obtain the corresponding password input character and closes the enabled security flag switch. All the password input characters are used to form a temporary password, which is then displayed in the secure password box.
2. The method according to claim 1, characterized in that, The step of recording the association between different storage areas includes: The character obfuscation value and its storage index are recorded in the linked list; the storage index is used to point to the previous or next storage area.
3. The method according to claim 2, characterized in that, The step of deobfuscating each character obfuscation value using the obfuscator includes: 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.
4. The method according to claim 1, characterized in that, The step of obfuscating each password input character using an obfuscator to obtain the corresponding character obfuscation value includes: The obfuscator queries the obfuscation table for the character obfuscation value corresponding to the password input character. The step of deobfuscating each character obfuscation value using the obfuscator to obtain the corresponding password input character includes: The obfuscator queries the obfuscation conversion table for the password input character corresponding to the character obfuscation value.
5. A password management device, characterized in that, include: The transceiver module is used to receive password input characters obtained from the keyboard component; The password input characters are used to log in to the program; The processing module is used to obfuscate each password input character using an obfuscator, obtain the 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 between different storage areas; when a password read request is received, perform internal and external request verification to confirm whether a request to read the security flag switch has been received; The password read request may be sent by an internal program or by an external program; if the request to read the security flag switch is received, the requester of the password read request is pending. If the request to read the security flag switch is not received, the requester of the password reading request is the external program, and an empty value is output; when the requester is pending, the execution context information in the program's stack is obtained; the execution context information is parsed to obtain at least one functional module of the program; The functional module is verified in the blacklist and whitelist; if the functional module belongs to the illegal module in the blacklist and whitelist, the password reading request is an illegal password reading request, and the security flag switch is configured to be in the off state to output an empty value; If the functional module belongs to the legitimate modules of the blacklist and whitelist, then the password reading request is a legitimate password reading request. In this case, the security mark switch is configured to be in the open state. According to the association relationship, each character obfuscation value is obtained. Each character obfuscation value is deobfuscated by the obfuscator to obtain the corresponding password input character, and the open security mark switch is turned off. The display module is used to display a temporary password composed of all the password input characters in the secure password box.
6. An electronic device, characterized in that, include: Memory, used to store one or more programs; processor; When the one or more programs are executed by the processor, the method as described in any one of claims 1-4 is implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method as described in any one of claims 1-4.
8. A program product, characterized in that, When the program product is executed by the processor, it implements the method as described in any one of claims 1-4.
Citation Information
Patent Citations
Method and system for protecting password by using secure keyboard
CN112507403A
Method and device for preventing unauthorized use of credit cards
US6095416A