A method and device for detecting weak passwords

By constructing a two-dimensional table of keyboard positions and traversing password data to determine weak passwords, the high performance consumption problem in existing technologies is solved, and efficient and low-resource-consumption weak password detection is achieved.

CN116032617BActive Publication Date: 2026-02-24BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211721606.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-02-24
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

In existing technologies, weak password detection methods rely on large-scale dictionaries, resulting in high performance consumption and excessive computational resource usage, making it difficult to efficiently identify weak passwords.

Method used

By constructing a two-dimensional location table based on keyboard positions, the password data is traversed using the position coordinates of the two-dimensional location table to determine whether there is a regular distribution of passwords, identify weak passwords with adjacent keys, reduce the number of dictionaries, and achieve efficient detection.

Benefits of technology

It can quickly identify weak passwords without relying on dictionaries, reduce computing resource consumption, and improve detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116032617B_ABST
    Figure CN116032617B_ABST
Patent Text Reader

Abstract

The weak password detection method and device provided by the embodiments of the present application belong to the technical field of data security. The weak password detection method comprises the following steps: obtaining password data to be detected; constructing a two-dimensional position table according to a keyboard position, wherein each position in the two-dimensional position table corresponds to a keyboard key position; and traversing position coordinates of the two-dimensional position table according to the password data to obtain a password detection result. The weak password detection method can efficiently determine weak passwords and has the technical effect of small resource occupation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data security technology, and more specifically, to a method, apparatus, electronic device, and computer-readable storage medium for detecting weak passwords. Background Technology

[0002] Currently, password brute-force attacks are a common method in cyberattacks. Generally, password brute-force attacks use common usernames and passwords. Common passwords are called weak passwords, such as "password", "123456", etc. In addition, there is another type of weak password that looks more complex, but is actually composed of a series of keystrokes on the keyboard, such as "1qaz2wsx" and "5tgb6yhn".

[0003] In existing technologies, security gateways typically have weak password detection capabilities, promptly identifying weak passwords in the system and prompting users to change them. Current solutions generally use dictionaries, listing as many consecutive key combinations as possible on the keyboard, such as "zxcvbnm,. / ", "asdfghjkl;'", and "123456789". Due to the large number of character lengths and various horizontal and vertical arrangements, the dictionary content is also very large. Furthermore, the sheer number of combinations leads to an excessively large dictionary, and considering the key sequence, if all combinations are listed, the security gateway cannot load such a large dictionary. Even if a large dictionary is loaded, matching is extremely performance-intensive. Summary of the Invention

[0004] The purpose of this application is to provide a method, apparatus, electronic device and computer-readable storage medium for detecting weak passwords, which can achieve the technical effect of efficiently judging weak passwords and consuming little computing resources.

[0005] In a first aspect, embodiments of this application provide a method for detecting weak passwords, including:

[0006] Obtain the password data to be tested;

[0007] A two-dimensional position table is constructed based on the keyboard position, wherein each position in the two-dimensional position table corresponds to a keyboard key;

[0008] The password detection result is obtained by traversing the position coordinates of the two-dimensional location table based on the password data.

[0009] In the above implementation process, the weak password detection method constructs a two-dimensional position table based on keyboard positions. Each position in the two-dimensional position table corresponds to a keyboard key and a two-dimensional position coordinate. Therefore, the position coordinates of the two-dimensional position table can be traversed based on the password data. By checking whether the characters in the password data form the corresponding standard, it can be determined whether the password data contains a weak password. Thus, the weak password detection method can identify weak passwords for adjacent keys without relying on a dictionary, thereby greatly reducing the number of weak password dictionaries and achieving the technical effect of efficient weak password detection with low computational resource consumption.

[0010] Furthermore, the step of constructing a two-dimensional position table based on the keyboard position includes:

[0011] Each keyboard character is assigned a two-dimensional subscript based on its keyboard position. The two-dimensional subscript is denoted as [X,Y], where X = 1 to M, Y = 1 to N, M is the total number of columns on the keyboard, and N is the total number of rows on the keyboard.

[0012] A two-dimensional location table is generated based on the aforementioned two-dimensional lower table, and the two-dimensional location table is denoted as P. [X,Y] .

[0013] Furthermore, the two-dimensional location table P [X,Y] The initial value is 0. The step of traversing the position coordinates of the two-dimensional location table according to the password data to obtain the password detection result includes:

[0014] Based on the password data, sequentially search the two-dimensional location table and assign values, setting P... [X,Y] The position where the character exists is set to 1;

[0015] X is traversed from 1 to M, and P is traversed. [X,Y] Perform the following processing: Iterate through Y from 1 to N, and set P... [X,1] To P [X,N] The number of consecutive 1s is denoted as J. [X] The length of a single consecutive 1 is denoted as A. [X] , determine J [X] If the value is greater than 1, then generate a password detection result indicating that no weak password exists.

[0016] Judge A [1] ~A [M] If there are multiple consecutive non-zero values ​​in the result, then generate a password detection result indicating that there is no weak password.

[0017] Judge A [1] ~A [M] Check if all non-zero numbers are the same. If not, generate a password detection result indicating that there are no weak passwords.

[0018] A [1] To A [M] The total number of passwords is obtained by adding the numbers in the list.

[0019] Determine whether the total number of passwords and the password length of the password data are equal. If not, generate a password detection result indicating that no weak passwords exist.

[0020] In the above implementation process, by traversing Y from 1 to N, it is possible to quickly and efficiently identify whether there is a regular distribution of password data along the Y-axis of the two-dimensional location table, thereby quickly identifying whether there is a weak password.

[0021] Furthermore, if the total number of passwords and the password length of the password data are equal, the method further includes:

[0022] Y is traversed from 1 to N, and P is traversed. [X,Y] Perform the following processing: Iterate through X from 1 to M, and set P... [1,Y] To P [M,Y] The number of consecutive 1s is denoted as K. [Y] The length of a single consecutive 1 is denoted as B. [Y] Determine K [Y] If the value is greater than 1, then generate a password detection result indicating that no weak password exists.

[0023] Judge B [1] ~B [N] If there are multiple consecutive non-zero values ​​in the result, then generate a password detection result indicating that there is no weak password.

[0024] Judge B [1] ~B [N] If all non-zero numbers are the same, generate a password detection result indicating no weak password exists; otherwise, generate a password detection result indicating a weak password exists.

[0025] In the above implementation process, by traversing X from 1 to M, it is possible to quickly and efficiently identify whether there is a regular distribution of password data along the X-axis of the two-dimensional location table, thereby quickly identifying whether there is a weak password.

[0026] Furthermore, the step of obtaining the password data to be detected includes:

[0027] Get login information;

[0028] Obtain the password data to be detected based on the login information.

[0029] Furthermore, after the step of obtaining the password data to be detected, the method further includes:

[0030] The password length is obtained from the password data.

[0031] Secondly, embodiments of this application provide a weak password detection device, comprising:

[0032] The password acquisition module is used to acquire the password data to be detected.

[0033] The construction module is used to construct a two-dimensional position table based on the keyboard position, wherein each position in the two-dimensional position table corresponds to a keyboard key;

[0034] The detection module is used to traverse the position coordinates of the two-dimensional location table according to the password data to obtain the password detection result.

[0035] Furthermore, the building module includes:

[0036] The allocation unit is used to assign a two-dimensional subscript to each keyboard character according to the keyboard position. The two-dimensional subscript is marked as [X,Y], where X = 1 to M, Y = 1 to N, M is the total number of columns on the keyboard, and N is the total number of rows on the keyboard.

[0037] The generation unit is configured to generate a two-dimensional location table based on the two-dimensional sub-table, wherein the two-dimensional location table is denoted as P. [X,Y] .

[0038] Furthermore, the detection module is specifically used for:

[0039] Based on the password data, sequentially search the two-dimensional location table and assign values, setting P... [X,Y] The position where the character exists is set to 1;

[0040] X is traversed from 1 to M, and P is traversed. [X,Y] Perform the following processing: Iterate through Y from 1 to N, and set P... [X,1] To P [X,N] The number of consecutive 1s is denoted as J. [X] The length of a single consecutive 1 is denoted as A. [X] , determine J [X] If the value is greater than 1, then generate a password detection result indicating that no weak password exists.

[0041] Judge A [1] ~A [M] If there are multiple consecutive non-zero values ​​in the result, then generate a password detection result indicating that there is no weak password.

[0042] Judge A [1] ~A [M] Check if all non-zero numbers are the same. If not, generate a password detection result indicating that there are no weak passwords.

[0043] A [1] To A [M]The total number of passwords is obtained by adding the numbers in the list.

[0044] Determine whether the total number of passwords and the password length of the password data are equal. If not, generate a password detection result indicating that no weak passwords exist.

[0045] Furthermore, the detection module is also configured to: if the total number of passwords and the password length of the password data are equal, then:

[0046] Y is traversed from 1 to N, and P is traversed. [X,Y] Perform the following processing: Iterate through X from 1 to M, and set P... [1,Y] To P [M,Y] The number of consecutive 1s is denoted as K. [Y] The length of a single consecutive 1 is denoted as B. [Y] Determine K [Y] If the value is greater than 1, then generate a password detection result indicating that no weak password exists.

[0047] Judge B [1] ~B [N] If there are multiple consecutive non-zero values ​​in the result, then generate a password detection result indicating that there is no weak password.

[0048] Judge B [1] ~B [N] If all non-zero numbers are the same, generate a password detection result indicating no weak password exists; otherwise, generate a password detection result indicating a weak password exists.

[0049] Furthermore, the password acquisition module includes:

[0050] The login retrieval unit is used to retrieve login information;

[0051] The password acquisition unit is used to acquire the password data to be detected based on the login information.

[0052] Furthermore, the weak password detection device also includes:

[0053] The password length module is used to obtain the password length based on the password data.

[0054] Thirdly, an electronic device provided in this application includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method as described in any of the first aspects.

[0055] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described in any of the first aspects.

[0056] Fifthly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to perform the method described in any of the first aspects.

[0057] Other features and advantages disclosed in this application will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the above-described technology disclosed in this application.

[0058] 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

[0059] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application 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.

[0060] Figure 1 A flowchart illustrating a weak password detection method provided in an embodiment of this application;

[0061] Figure 2 A flowchart illustrating another weak password detection method provided in this application embodiment;

[0062] Figure 3 A schematic diagram of a two-dimensional location table provided in an embodiment of this application;

[0063] Figure 4 A schematic diagram of the process for generating password detection results provided in an embodiment of this application;

[0064] Figure 5 A structural block diagram of the weak password detection device provided in the embodiments of this application;

[0065] Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0066] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0067] 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.

[0068] This application provides a method, apparatus, electronic device, and computer-readable storage medium for detecting weak passwords. It can be applied to security gateways to detect login information for various network applications and identify the presence of weak passwords. The method constructs a two-dimensional location table based on keyboard positions. Each position in the table corresponds to a keyboard key and a two-dimensional coordinate. The method then iterates through the coordinates of the two-dimensional location table based on password data, determining whether a weak password exists by checking if the characters in the password data form a corresponding pattern. This method can identify weak passwords for adjacent keys without relying on a dictionary, significantly reducing the number of weak password dictionaries and achieving efficient weak password detection with low computational resource consumption.

[0069] Please see Figure 1 , Figure 1 This is a flowchart illustrating a weak password detection method provided in an embodiment of this application. The weak password detection method includes the following steps:

[0070] S100: Obtain the password data to be tested.

[0071] For example, a security gateway is used to detect login messages from various network applications and obtain the password data to be detected in the login messages.

[0072] S200: Construct a two-dimensional position table based on the keyboard position. Each position in the two-dimensional position table corresponds to a keyboard key.

[0073] For example, a two-dimensional subscript is assigned to each key on each keyboard according to the keyboard position, thus completing the construction of a two-dimensional position table.

[0074] S300: Traverse the position coordinates of the two-dimensional location table based on the password data to obtain the password detection result.

[0075] For example, this weak password detection method constructs a two-dimensional position table based on keyboard positions. Each position in the two-dimensional position table corresponds to a keyboard key, and each position corresponds to a two-dimensional position coordinate. Therefore, the position coordinates of the two-dimensional position table can be traversed based on the password data. By checking whether the characters in the password data form the corresponding standard, it can be determined whether the password data contains a weak password. Thus, this weak password detection method can identify weak passwords for adjacent keys without relying on a dictionary, thereby greatly reducing the number of weak password dictionaries and achieving the technical effect of efficiently identifying weak passwords with low computational resource consumption.

[0076] Please participate Figure 2 , Figure 2 This is a flowchart illustrating another weak password detection method provided in an embodiment of this application.

[0077] For example, S200: The step of constructing a two-dimensional position table based on the keyboard position includes:

[0078] S210: Assign a two-dimensional subscript to each keyboard character according to its keyboard position. The two-dimensional subscript is marked as [X,Y], where X = 1 to M, Y = 1 to N, M is the total number of columns on the keyboard, and N is the total number of rows on the keyboard.

[0079] S220: Generate a two-dimensional location table based on the two-dimensional lower table, denoted as P. [X,Y] .

[0080] For example, each keyboard key is assigned a two-dimensional subscript based on its position. The specific index value of the two-dimensional subscript can be found in the keyboard position diagram. For example, the X-axis coordinate of "1" is 2 and the Y-axis coordinate is 4, which is recorded as [2,4], and the X-axis coordinate of "q" is 2 and the Y-axis coordinate is 3, which is recorded as [2,3].

[0081] The above method generates a "two-dimensional position table," where the key is each character and the value is a two-dimensional index. Alternatively, a one-dimensional array can be used, with the ASCII code of the character as the array index and the array value as a two-dimensional index, such as... Figure 3 As shown, Figure 3 This is a schematic diagram of a two-dimensional location table provided in an embodiment of this application.

[0082] Please see Figure 4 , Figure 4 This is a schematic diagram of the process for generating password detection results provided in an embodiment of this application.

[0083] For example, a two-dimensional location table P [X,Y] The initial value is 0. S300: The steps to traverse the position coordinates of the two-dimensional location table based on the password data and obtain the password detection result include:

[0084] Based on the password data, sequentially search the two-dimensional location table and assign values, setting P... [X,Y] The position where the character exists is set to 1;

[0085] X is traversed from 1 to M, and P is traversed. [X,Y] Perform the following processing: Iterate through Y from 1 to N, and set P... [X,1] To P [X,N] The number of consecutive 1s is denoted as J. [X] The length of a single consecutive 1 is denoted as A. [X] , determine J [X] If the value is greater than 1, then generate a password detection result indicating that no weak password exists.

[0086] Judge A [1] ~A [M] If there are multiple consecutive non-zero values ​​in the result, then generate a password detection result indicating that there is no weak password.

[0087] Judge A [1] ~A [M] Check if all non-zero numbers are the same. If not, generate a password detection result indicating that there are no weak passwords.

[0088] A [1] To A [M] The total number of passwords is obtained by adding the numbers in the list.

[0089] Determine if the total number of passwords and the password length of the password data are equal. If not, generate a password detection result indicating that no weak passwords exist.

[0090] In some implementations, N is assumed to be 4, and P [X,1] To P [X,N] The number of consecutive 1s is denoted as J. [X] The length of a single consecutive 1 is denoted as A. [X] The number of times a number is consecutively 1 is denoted as P. [X,1] To P [X,N] The number of heaps separated by "1" is shown in the following example:

[0091] If P [X,1] ~P [X,4] If the values ​​are "1101" or "1001" in sequence, then the number of consecutive times the value is J. [X] =2, A [X] If no value is assigned, generate a password detection result indicating no weak passwords and exit the process; if P [X,1] ~P [X,4] If the value is "1111", then the number of consecutive times it is 1 is J. [X] =1, the length of a single consecutive 1 is A [X] =4; if P [X,1] ~P[X,4] If the value is "1110", then the number of consecutive times it is 1 is J. [X] =1, the length of a single consecutive 1 is A [X] =3; if P [X,1] ~P [X,4] If the values ​​are "0000" in sequence, then the number of consecutive 1s is J. [X] =0, the length of a single consecutive 1 is A [X] =0.

[0092] For example, if the total number of passwords and the password length of the password data are equal, the method further includes:

[0093] Y is traversed from 1 to N, and P is traversed. [X,Y] Perform the following processing: Iterate through X from 1 to M, and set P... [1,Y] To P [M,Y] The number of consecutive 1s is denoted as K. [Y] The length of a single consecutive 1 is denoted as B. [Y] Determine K [Y] If the value is greater than 1, then generate a password detection result indicating that no weak password exists.

[0094] Judge B [1] ~B [N] If there are multiple consecutive non-zero values ​​in the result, then generate a password detection result indicating that there is no weak password.

[0095] Judge B [1] ~B [N] If all non-zero numbers are the same, generate a password detection result indicating no weak password exists; otherwise, generate a password detection result indicating a weak password exists.

[0096] For example, S100: The step of obtaining the password data to be detected includes:

[0097] S110: Obtain login information;

[0098] S120: Obtain the password data to be tested based on the login information.

[0099] For example, after step S100: obtaining the password data to be detected, the method further includes:

[0100] S130: Obtain the password length based on the password data.

[0101] In some implementations, combined Figures 1 to 4 The weak password detection method provided in this application embodiment has the following specific process steps:

[0102] 1. The security gateway detects login messages from various network applications;

[0103] 2. Decrypt the login message and extract the password used by the user. The password length is denoted as L.

[0104] 3. Generate a two-dimensional array P [X,Y] The member type is numeric, and the initial value is 0;

[0105] 4. Search the "two-dimensional location table" sequentially for each character in the password, and find the location at P. [X,Y] The number of positions where a character exists is set to 1, and the password length L corresponds to the number of positions set to 1. For example, if the password is "asd", the two-dimensional index of "a" in the position table is [2,2], the two-dimensional index of "s" is [3,2], and the two-dimensional index of "d" is [4,2]. Therefore, the final P... [X,Y] In the array, only P [2,2] P [3,2] P [4,2] Three are 1, the rest are 0;

[0106] 5. Traverse X from 1 to 14:

[0107] Y iterates through 1 to 4, and P [X,1] To P [X,4] The number of consecutive 1s is denoted as J. [X] The length of a single consecutive 1 is denoted as A. [X] If there are multiple consecutive values ​​of 1 (J) [x] If the value is greater than 1, then there is no weak password, and the process ends.

[0108] 6. Determine A [X] If there are multiple consecutive non-zero values ​​in the password field, then there is no weak password, and the process ends.

[0109] 7. Determine A [X] If all non-zero numbers are the same, then there is no weak password and the process ends.

[0110] 8. A [X] If the sum of the numbers is not equal to the password length L, then there is no weak password and the process ends.

[0111] 9. Traverse Y from 1 to 4:

[0112] X iterates through 1 to 14, and P [1,Y] To P [14,Y] The number of consecutive 1s is denoted as K. [Y] The length of a single consecutive 1 is denoted as B. [Y] If there are multiple consecutive values ​​of 1 (K) [Y] If the value is greater than 1, then there is no weak password, and the process ends.

[0113] 10. Determine B [Y] If there are multiple consecutive non-zero values ​​in the password field, then there is no weak password, and the process ends.

[0114] 11. Determine B [Y] If all non-zero numbers are the same, then there is no weak password and the process ends.

[0115] 12. Weak password found, process terminated.

[0116] In summary, the weak password detection method provided in this application greatly reduces the number of weak password dictionaries. It can efficiently determine weak passwords by traversing the password data based on a two-dimensional location table, with low computational resource consumption.

[0117] Please see Figure 5 , Figure 5 The structural block diagram of the weak password detection device provided in the embodiments of this application is shown. The weak password detection device includes:

[0118] The password acquisition module 100 is used to acquire the password data to be detected;

[0119] Module 200 is used to construct a two-dimensional position table based on the keyboard position. Each position in the two-dimensional position table corresponds to a keyboard key.

[0120] The detection module 300 is used to traverse the position coordinates of the two-dimensional location table based on the password data to obtain the password detection result.

[0121] For example, the building module 200 includes:

[0122] The allocation unit is used to assign a two-dimensional subscript to each keyboard character according to the keyboard position. The two-dimensional subscript is marked as [X,Y], where X = 1 to M, Y = 1 to N, M is the total number of columns on the keyboard, and N is the total number of rows on the keyboard.

[0123] The generation unit is used to generate a two-dimensional location table based on a two-dimensional sub-table, denoted as P. [X,Y] .

[0124] For example, the detection module 300 is specifically used for:

[0125] Based on the password data, sequentially search the two-dimensional location table and assign values, setting P... [X,Y] The position where the character exists is set to 1;

[0126] X is traversed from 1 to M, and P is traversed. [X,Y] Perform the following processing: Iterate through Y from 1 to N, and set P... [X,1] To P [X,N]The number of consecutive 1s is denoted as J. [X] The length of a single consecutive 1 is denoted as A. [X] , determine J [X] If the value is greater than 1, then generate a password detection result indicating that no weak password exists.

[0127] Judge A [1] ~A [M] If there are multiple consecutive non-zero values ​​in the result, then generate a password detection result indicating that there is no weak password.

[0128] Judge A [1] ~A [M] Check if all non-zero numbers are the same. If not, generate a password detection result indicating that there are no weak passwords.

[0129] A [1] To A [M] The total number of passwords is obtained by adding the numbers in the list.

[0130] Determine if the total number of passwords and the password length of the password data are equal. If not, generate a password detection result indicating that no weak passwords exist.

[0131] For example, the detection module 300 is further configured to: if the total number of passwords and the password length of the password data are equal, then:

[0132] Y is traversed from 1 to N, and P is traversed. [X,Y] Perform the following processing: Iterate through X from 1 to M, and set P... [1,Y] To P [M,Y] The number of consecutive 1s is denoted as K. [Y] The length of a single consecutive 1 is denoted as B. [Y] Determine K [Y] If the value is greater than 1, then generate a password detection result indicating that no weak password exists.

[0133] Judge B [1] ~B [N] If there are multiple consecutive non-zero values ​​in the result, then generate a password detection result indicating that there is no weak password.

[0134] Judge B [1] ~B [N] If all non-zero numbers are the same, generate a password detection result indicating no weak password exists; otherwise, generate a password detection result indicating a weak password exists.

[0135] For example, the password acquisition module 100 includes:

[0136] The login retrieval unit is used to retrieve login information;

[0137] The password acquisition unit is used to obtain the password data to be detected based on the login information.

[0138] For example, the weak password detection device further includes:

[0139] The password length module is used to obtain the password length based on the password data.

[0140] It should be noted that the weak password detection device provided in this application embodiment is similar to... Figures 1 to 4 The method embodiments shown correspond to each other, and will not be described again here to avoid repetition.

[0141] This application also provides an electronic device, please refer to [link to application]. Figure 6 , Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of this application. The electronic device may include a processor 510, a communication interface 520, a memory 530, and at least one communication bus 540. The communication bus 540 is used to enable direct communication between these components. In this embodiment, the communication interface 520 of the electronic device is used for signaling or data communication with other node devices. The processor 510 may be an integrated circuit chip with signal processing capabilities.

[0142] The processor 510 described above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor, or the processor 510 can be any conventional processor.

[0143] The memory 530 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc. The memory 530 stores computer-readable instructions. When these computer-readable instructions are executed by the processor 510, the electronic device can perform the aforementioned operations. Figures 1 to 4 The various steps involved in the method implementation examples.

[0144] Alternatively, the electronic device may also include a storage controller and an input / output unit.

[0145] The memory 530, storage controller, processor 510, peripheral interface, and input / output unit are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses 540. The processor 510 is used to execute executable modules stored in the memory 530, such as software function modules or computer programs included in electronic devices.

[0146] The input / output unit is used to provide users with the ability to create tasks and to set optional start periods or preset execution times for those tasks, thereby enabling user-server interaction. The input / output unit may be, but is not limited to, a mouse and keyboard.

[0147] Understandable. Figure 6 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 6 The more or fewer components shown, or having the same Figure 6 The different configurations shown. Figure 6 The components shown can be implemented using hardware, software, or a combination thereof.

[0148] This application also provides a storage medium storing instructions. When the instructions are run on a computer, the computer program is executed by a processor to implement the method described in the method embodiment. To avoid repetition, the method will not be described again here.

[0149] This application also provides a computer program product that, when run on a computer, causes the computer to perform the method described in the method embodiment.

[0150] In the several 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 containing 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.

[0151] 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.

[0152] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of 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 software product. This computer software product is stored in a 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 described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0153] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of 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 scope of protection of this application. 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.

[0154] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0155] 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.

Claims

1. A method for detecting weak passwords, characterized in that, include: Obtain the password data to be tested; A two-dimensional position table is constructed based on the keyboard positions, where each position in the two-dimensional position table corresponds to a keyboard key. The password detection result is obtained by traversing the position coordinates of the two-dimensional location table based on the password data. The step of constructing a two-dimensional position table based on keyboard positions includes: Each keyboard character is assigned a two-dimensional subscript based on its keyboard position. The two-dimensional subscript is denoted as [X,Y], where X = 1~M, Y = 1~N, M is the total number of columns on the keyboard, and N is the total number of rows on the keyboard. A two-dimensional location table is generated based on the two-dimensional subscripts, and the two-dimensional location table is denoted as P. [X,Y] ; The two-dimensional location table P [X,Y] The initial value is 0. The step of traversing the position coordinates of the two-dimensional location table according to the password data to obtain the password detection result includes: Based on the password data, sequentially search the two-dimensional location table and assign values, setting P... [X,Y] The position where the character exists is set to 1; X is traversed from 1 to M, and P is traversed. [X,Y] Perform the following processing: Iterate through Y from 1 to N, and set P... [X,1] To P [X,N] The number of consecutive 1s is denoted as J. [X] The length of a single consecutive 1 is denoted as A. [X] Determine J [X] If the value is greater than 1, then generate a password detection result indicating that no weak password exists. Judge A [1] ~A [M] If there are multiple consecutive non-zero values ​​in the result, then generate a password detection result indicating that there is no weak password. Judge A [1] ~A [M] Check if all non-zero numbers are the same. If not, generate a password detection result indicating that there are no weak passwords. A [1] To A [M] The total number of passwords is obtained by adding the numbers in the list. Determine whether the total number of passwords and the password length of the password data are equal. If not, generate a password detection result indicating that no weak passwords exist.

2. The method for detecting weak passwords according to claim 1, characterized in that, If the total number of passwords and the password length of the password data are equal, then the method further includes: Y is traversed from 1 to N, and P is traversed. [X,Y] Perform the following processing: Iterate through X from 1 to M, and set P... [1,Y] To P [M,Y] The number of consecutive 1s is denoted as K. [Y] The length of a single consecutive 1 is denoted as B. [Y] Determine K [Y] If the value is greater than 1, then generate a password detection result indicating that no weak password exists. Judge B [1] ~B [N] If there are multiple consecutive non-zero values ​​in the result, then generate a password detection result indicating that there is no weak password. Judge B [1] ~B [N] If all non-zero numbers are the same, generate a password detection result indicating no weak password exists; otherwise, generate a password detection result indicating a weak password exists.

3. The method for detecting weak passwords according to claim 1, characterized in that, The step of obtaining the password data to be detected includes: Get login information; Obtain the password data to be detected based on the login information.

4. The method for detecting weak passwords according to claim 1, characterized in that, After the step of obtaining the password data to be detected, the method further includes: The password length is obtained from the password data.

5. A weak password detection device, characterized in that, include: The password acquisition module is used to acquire the password data to be detected. The construction module is used to construct a two-dimensional position table based on the keyboard position, wherein each position in the two-dimensional position table corresponds to a keyboard key. The detection module is used to traverse the position coordinates of the two-dimensional location table according to the password data to obtain the password detection result; The building module includes: The allocation unit is used to assign a two-dimensional subscript to each keyboard character according to the keyboard position. The two-dimensional subscript is marked as [X,Y], where X = 1~M, Y = 1~N, M is the total number of columns on the keyboard, and N is the total number of rows on the keyboard. The generation unit is configured to generate a two-dimensional location table based on the two-dimensional subscripts, wherein the two-dimensional location table is denoted as P. [X,Y] ; The detection module is specifically used for: Based on the password data, sequentially search the two-dimensional location table and assign values, setting P... [X,Y] The position where the character exists is set to 1; X is traversed from 1 to M, and P is traversed. [X,Y] Perform the following processing: Iterate through Y from 1 to N, and set P... [X,1] To P [X,N] The number of consecutive 1s is denoted as J. [X] The length of a single consecutive 1 is denoted as A. [X] Determine J [X] If the value is greater than 1, then generate a password detection result indicating that no weak password exists. Judge A [1] ~A [M] If there are multiple consecutive non-zero values ​​in the result, then generate a password detection result indicating that there is no weak password. Judge A [1] ~A [M] Check if all non-zero numbers are the same. If not, generate a password detection result indicating that there are no weak passwords. A [1] To A [M] The total number of passwords is obtained by adding the numbers in the list. Determine whether the total number of passwords and the password length of the password data are equal. If not, generate a password detection result indicating that no weak passwords exist.

6. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the weak password detection method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the weak password detection method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Password strength identification method and device, equipment and computer readable storage medium

    CN113609461A

  • Weak password detection method and device, equipment, storage medium and program product

    CN115344852A