Password detection method and device, equipment, storage medium and program product

Through the dual detection mechanism of preset extraction rules and detection models, combined with the recognition technology of teacher model and student model, the problem of low accuracy of weak password detection in the existing technology is solved, and high sensitivity weak password recognition and adaptability are achieved Learning significantly improves detection accuracy.

CN119172109AActive Publication Date: 2024-12-20CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411178453.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-20
Estimated Expiration
2044-08-26

AI Technical Summary

Technical Problem

In the prior art, weak password detection methods have the risk of missed and false alarms, resulting in low detection accuracy, especially due to the huge amount of data caused by dictionary scanning, making it difficult to effectively identify weak passwords.

Method used

Regular character extraction rules are used to perform regularization character extraction, combined with preset detection algorithm and detection model for dual detection, teacher model and student model for password type recognition, and adapt to changing weak passwords through adaptive learning to reduce false positives and Possibility of underreport.

Benefits of technology

The accuracy of weak password detection is significantly improved, and through dual detection and adaptive learning mechanisms, false alarms and missed reports are reduced, and the recognition accuracy is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172109A_ABST
    Figure CN119172109A_ABST
Patent Text Reader

Abstract

The invention discloses a password detection method and device, equipment, a storage medium and a program product. The method comprises the steps of obtaining a to-be-detected password; performing regularization character extraction on the to-be-detected password by using a preset extraction rule to obtain a first character set of the to-be-detected password; performing character detection on the first character set by using a first preset detection algorithm to obtain a first detection result; and under the condition that the first detection result is determined not to be the weak password, inputting the to-be-detected password into a preset detection model, and performing password type identification on the to-be-detected password by using the preset detection model to obtain a second detection result. According to the embodiment of the invention, the detection accuracy of the weak password can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to network security technology, and more particularly to a password detection method, device, equipment, storage medium and program product. Background Art

[0002] A weak password is a password with low security that is easy to guess or crack. When using a weak password to log in to a software system, it can usually be easily cracked by attackers using brute force cracking tools or dictionary attacks.

[0003] At present, in order to reduce the occurrence of weak passwords, a weak password detection method is usually configured in the software system to prompt the user that the password set is a weak password. In the related technology, dictionary scanning is a commonly used weak password detection method. Dictionary scanning usually traverses the existing password dictionary and uses it as an attempt password to log in to the software system. If the login is successful, it means that the password is a weak password.

[0004] In the above-mentioned related technologies, the password dictionary is traversed and searched, resulting in a huge amount of scanned data, which has the risk of missed reports or false reports and reduces the accuracy of password detection. Summary of the invention

[0005] Embodiments of the present application provide a password detection method, apparatus, device, storage medium, and program product, which can improve the accuracy of weak password detection.

[0006] On the one hand, an embodiment of the present application provides a password detection method, the method comprising:

[0007] Get the password to be tested;

[0008] Performing regularized character extraction on the password to be detected using a preset extraction rule to obtain a first character set of the password to be detected;

[0009] Performing character detection on the first character set using a first preset detection algorithm to obtain a first detection result;

[0010] When the first detection result determines that the password is not a weak password, the password to be detected is input into a preset detection model, and the password type of the password to be detected is identified using the preset detection model to obtain a second detection result.

[0011] Optionally, performing character detection on the first character set using a first preset detection algorithm to obtain a first detection result includes:

[0012] Using a first preset detection algorithm to traverse a preset character library to obtain a second character set, wherein the preset character library is used to store characters of a preset weak password;

[0013] Compare the first character set with the second character set to determine the character similarity;

[0014] When the character similarity is less than or equal to the preset similarity, the first detection result is determined to be not a weak password.

[0015] Optionally, the preset detection model includes a teacher model and a student model. Before the student model of the preset detection model is used to identify the password type to be detected to obtain the identification result, the method further includes:

[0016] Fine-tune the preset basic detection model to obtain a first detection model;

[0017] Acquire a first training sample set, wherein the first training sample set includes preset passwords and their corresponding preset password types, and preset password tasks and their corresponding preset task types;

[0018] Building a teacher model based on the first basic detection model, taking the preset password and the preset password task as input, and the preset task type and the preset password type as output, respectively, training the first basic detection model to obtain a trained teacher model;

[0019] A student model is constructed based on the first basic detection model, the prediction results of the teacher model are taken as input, the preset password type and the preset task type are taken as output, the student model is trained, and a trained student model is obtained.

[0020] Optionally, fine-tuning the preset basic detection model to obtain the first basic detection model includes:

[0021] Using the first preset fine-tuning application to fine-tune the preset basic model to obtain a second basic detection model;

[0022] The second basic detection model is fine-tuned using a second preset fine-tuning method to obtain a first basic detection model.

[0023] Optionally, the teacher model is constructed based on the first basic detection model, the preset password and the preset password task are respectively used as input, and the preset task type and the preset password type are used as output, and the first basic detection model is trained to obtain a trained teacher model, including:

[0024] Inputting the preset password and the preset password task into the teacher model to obtain a predicted password type and a predicted task type;

[0025] Determine a first loss function value according to the predicted password type and the preset password type;

[0026] Determine a second loss function value according to the prediction task type and the preset task type;

[0027] Calculate a total loss function value based on the first loss function value and the second loss function value;

[0028] When the total loss function value does not meet the preset convergence conditions, the model parameters of the teacher model are adjusted until the total loss function value meets the preset convergence conditions to obtain a trained teacher model.

[0029] Optionally, after the student model of the preset detection model is used to identify the password type of the password to be detected to obtain a second detection result, the method further includes:

[0030] If the first detection result is determined to be a weak password or the second detection result is determined to be a weak password, generating an interception instruction, wherein the interception instruction is used to prohibit the user from logging in;

[0031] Generate alarm repair information based on the interception instruction.

[0032] Optionally, after the password type is identified by using the preset detection model to obtain a second detection result, the method further includes:

[0033] The preset detection model is iteratively trained based on the password to be detected and the second detection result to obtain a new preset detection model.

[0034] On the other hand, an embodiment of the present application provides a password detection device, the device comprising:

[0035] Acquisition module, obtains the password to be detected;

[0036] An extraction module, used for performing regularized character extraction on the password to be detected using a preset extraction rule to obtain a first character set of the password to be detected;

[0037] A first detection module, configured to perform character detection on the first character set using a first preset detection algorithm to obtain a first detection result;

[0038] The second detection module is used to input the password to be detected into a preset detection model when the first detection result determines that it is not a weak password, and use the preset detection model to identify the password type of the password to be detected to obtain a second detection result.

[0039] In another aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor and a memory storing computer program instructions;

[0040] When the processor executes the computer program instructions, the password detection method as described in the first aspect is implemented.

[0041] On the other hand, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the password detection method as described in the first aspect is implemented.

[0042] On the other hand, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the password detection method as described in the first aspect.

[0043] The password detection method, apparatus, device and computer storage medium of the embodiments of the present application can, when a user logs in using the password to be detected, first perform a first password detection on the password to be detected by comparing it with a preset password library to determine whether the password to be detected is a weak password. When the password to be detected is not a weak password, a preset detection model is used to perform a second recognition on the password to be detected. When the preset detection model is used for password recognition and analysis, high-sensitivity recognition of weak passwords can be achieved by analyzing the password to be detected, and adaptive learning of the preset detection model can adapt to constantly changing weak passwords, thereby reducing the possibility of false positives and missed positives and greatly improving the recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0045] Figure 1 It is a flowchart of a password detection method provided by an embodiment of the present application;

[0046] Figure 2 It is a flowchart of a password detection method for detecting a password to be detected for the first time provided by an embodiment of the present application;

[0047] Figure 3 It is a flowchart of a method for training a preset detection model provided by an embodiment of the present application;

[0048] Figure 4 is a structural schematic diagram of a password detection device provided by another embodiment of the present application;

[0049] Figure 5 It is a structural schematic diagram of an electronic device provided in yet another embodiment of the present application. DETAILED DESCRIPTION

[0050] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0051] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0052] In order to solve the problems in the prior art, embodiments of the present application provide a password detection method, apparatus, device, storage medium and program product.

[0053] When a user logs in with the password to be detected, the first password detection is performed by comparing it with the preset password library to determine whether the password to be detected is a weak password. If the password to be detected is not a weak password, the preset detection model is used to perform a second recognition on the password to be detected. When using the preset detection model for password recognition and analysis, it is possible to achieve high-sensitivity recognition of weak passwords through analysis of the password to be detected, and through adaptive learning of the preset detection model, it can adapt to constantly changing weak passwords, reduce the possibility of false alarms and missed alarms, and greatly improve the recognition accuracy.

[0054] The following first introduces the password detection method provided in the embodiment of the present application.

[0055] Figure 1 FIG. 1 is a flow chart of a password detection method provided by an embodiment of the present application. Figure 1 As shown, the password detection method may include the following steps S101-S104:

[0056] S101, obtaining a password to be detected.

[0057] In one embodiment, in order to obtain the password to be tested set by the user when registering or logging in, a process (Agent) program is deployed on the server and then linked with the driver background to implement a security baseline check of the middleware and database in the server, and at the same time obtain the password to be tested when the user registers.

[0058] In this embodiment, automatic maintenance of the server asset list can be achieved by deploying a process program, saving the time cost of security personnel, quickly performing security checks on the server, and obtaining the password to be tested in a safe and secure manner, so that the obtained password to be tested eliminates other risks, such as being intercepted and modified when the user enters the password to be tested.

[0059] It is understandable that the obtained password to be detected may be a password entered when a user registers a system account, or may be a password to be detected entered when logging into the middleware, which is not limited here.

[0060] S102: performing regularized character extraction on the password to be detected using a preset extraction rule to obtain a first character set of the password to be detected.

[0061] In this embodiment, after obtaining the password to be detected, in order to conveniently determine whether the password to be detected is a weak password, it is necessary to extract characters from the password to be detected using a preset extraction rule, so as to facilitate detection of the password to be detected using the first character set.

[0062] In a specific embodiment, the preset extraction rule can be a regular expression extraction rule, that is, the regularized characters of the password to be detected are extracted in a regular expression manner, the password to be detected is positioned as a form composed of ordinary characters and special characters, and the first character set corresponding to the password to be detected is formed by setting a qualifier and a locator.

[0063] S103: Perform character detection on the first character set using a first preset detection algorithm to obtain a first detection result.

[0064] Reference Figure 2 In a specific embodiment, S103 may specifically include the following steps:

[0065] S1031, using a first preset detection algorithm to traverse a preset character library to obtain a second character set;

[0066] S1032, performing character comparison between the first character set and the second character set to determine character similarity;

[0067] S1033: When the character similarity is less than or equal to a preset similarity, determine the first detection result as not being a weak password.

[0068] In this embodiment, when the password to be detected is first detected, the first preset detection algorithm is first used to traverse the preset character library to obtain the second character set. The preset character library is used to store the characters of the preset weak password. The preset character library is constructed based on historical weak passwords, such as "111, 222, 000, 123". The characters corresponding to these weak passwords are then extracted and stored in the preset character library to facilitate the detection of the password to be detected according to the first preset detection algorithm.

[0069] Since weak passwords include not only simple repeated numbers but also combinations of simple numbers and letters, and each weak password corresponds to a first character set with multiple characters, the number of characters in the same position between the first character set and the second character set is found, the character similarity is calculated, and then the character similarity is compared with the preset similarity. If the character similarity is less than or equal to the preset similarity, it indicates that the password to be detected is not a weak password; if the character similarity is greater than the preset similarity, the password to be detected is a weak password.

[0070] As an example, the preset similarity may be 80% or 85%, which is not limited here.

[0071] It is worth noting that the first preset detection algorithm may be an aspect oriented programming (AOP) detection algorithm.

[0072] S104, when the first detection result determines that the password is not a weak password, the password to be detected is input into a preset detection model, and the password type of the password to be detected is identified using the preset detection model to obtain a second detection result.

[0073] In this embodiment, when the password to be detected is subjected to the first round of detection through the AOP detection algorithm, in order to ensure the accuracy of the detection result, the password to be detected is input into the preset detection model, and the password to be detected is detected again using the preset detection model, thereby reducing the possibility of missed detection or false detection due to the use of the AOP detection algorithm. At the same time, since attackers use weak passwords to continuously damage the system, the high-sensitivity recognition of weak passwords by the preset detection model can adapt to the ever-changing attack patterns. In addition, when logging in to the middleware with a weak password, the preset detection model can also identify and adapt to the data patterns and behavior patterns held in the middleware environment.

[0074] When a user logs in with the password to be detected, the first password detection is performed by comparing it with the preset password library to determine whether the password to be detected is a weak password. If the password to be detected is not a weak password, the preset detection model is used to perform a second recognition on the password to be detected. When using the preset detection model for password recognition and analysis, it is possible to achieve high-sensitivity recognition of weak passwords through analysis of the password to be detected, and through adaptive learning of the preset detection model, it can adapt to constantly changing weak passwords, reduce the possibility of false alarms and missed alarms, and greatly improve the recognition accuracy.

[0075] Reference Figure 3 In order to make the preset detection model aware of the context and realize the recognition of weak passwords and password tasks, after S104, the following steps may also be included:

[0076] S1041, fine-tuning the preset basic detection model to obtain a first detection model;

[0077] S1042, obtaining a first training sample set, the first training sample set including preset passwords and their corresponding preset password types, and preset password tasks and their corresponding preset task types;

[0078] S1043, constructing a teacher model based on the first basic detection model, taking the preset password and the preset password task as input, and the preset task type and the preset password type as output, respectively, training the first basic detection model to obtain a trained teacher model;

[0079] S1044, constructing a student model based on the first basic detection model, taking the prediction result of the teacher model as input, and the preset command type and the preset task type as output, training the student model to obtain a trained student model.

[0080] In this embodiment, when using a weak password to log in to the system, the middleware is required to verify the password. At this time, the middleware records the user's behavior, such as login, access and modification, and then uses the preset detection model to detect whether the user's behavior is abnormal, that is, whether the password task is abnormal, including the number of user login failures, access frequency and access path.

[0081] As an example, the preset basic detection model adopts the chatGLM model. In order to enable the preset detection model to better identify passwords and detect weak passwords through the preset detection model, it can not only ensure the security of the middleware from the perspective of password recognition, but also maintain the security of user information and ensure the security of user information. In this embodiment, multi-task learning and knowledge distillation methods are used to construct a preset detection model, which can not only ensure the accuracy of password recognition, but also complete the recognition of password tasks while recognizing passwords, thereby ensuring the security of user information.

[0082] Specifically, building a teacher model can be able to handle complex tasks, and it can also use knowledge distillation technology to build a student model through distillation temperature, optimize the model structure, and convert the complex model into a simpler and more efficient model, thereby improving the efficiency of password detection and password task recognition and reducing resource consumption.

[0083] In this embodiment, a teacher model can be constructed that can simultaneously detect passwords and recognize passwords. After performing knowledge distillation on the password detection and password task recognition respectively, a student model for the password detection and a student model for the password task recognition are obtained, thereby completing the second recognition of the password detection and the detection of the password task recognition.

[0084] In one embodiment, in order for the preset detection model to be able to quickly identify passwords in the middleware security field, it is necessary to pre-train the preset basic model so that the preset basic model can clarify the detection task and realize context awareness; after completing the pre-training, in order to make the preset detection model more accurate in recognition, fine-tuning training is required to ensure recognition accuracy, so the preset basic detection model is fine-tuned to obtain the first detection model, which can specifically include:

[0085] Using the first preset fine-tuning application to fine-tune the preset basic model to obtain a second basic detection model;

[0086] The second basic detection model is fine-tuned using a second preset fine-tuning method to obtain a first basic detection model.

[0087] In this embodiment, as an example, the first preset fine-tuning application may be a P-Tuning application, or a P-Turning V2 application, and the second preset fine-tuning application may be a LoRA application.

[0088] It is worth noting that the first preset fine-tuning application is first used to perform model fine-tuning on the preset basic model to obtain the first basic detection model, that is, the P-Tuning application is used to introduce additional fine-tuning parameters without changing the ChatGLM large model, and then the first preset fine-tuning model is fine-tuned by the fine-tuning parameters to obtain the first basic model. It can be understood that the P-Tuning application is a black box adjustment, so when adjusting the fine-tuning parameters, it is only necessary to meet the fine-tuning purpose, and the fine-tuning purpose can be faster identification and detection.

[0089] In another embodiment, the second basic detection model is fine-tuned for a second time using a second preset fine-tuning application to obtain a first basic detection model. It can be understood that the LoRA application can fine-tune each layer of the second basic detection model, that is, add a low-rank update matrix to each layer, thereby adjusting the weight of the second basic detection model, so that the obtained first basic detection model can more accurately identify weak passwords and password tasks.

[0090] In one embodiment, S1043 may specifically include the following steps:

[0091] Input the preset password and the preset password task into the teacher model to obtain the predicted password type and the predicted task type;

[0092] Determine a first loss function value according to the predicted password type and the preset password type;

[0093] Determine a second loss function value according to the predicted task type and the preset task type;

[0094] Calculate a total loss function value based on the first loss function value and the second loss function value;

[0095] When the total loss function value does not meet the preset convergence conditions, the model parameters of the teacher model are adjusted until the total loss function value meets the preset convergence conditions to obtain a trained teacher model.

[0096] In this embodiment, when the first basic detection model is trained based on multi-task learning and knowledge distillation algorithm, the first basic detection model is first trained to be able to perform multi-task detection, that is, the trained teacher model can handle password detection and password task recognition at the same time.

[0097] As an example, the multi-task loss function of training during multi-task learning can be expressed as: L=∑i=1nαiLi, where Li is the loss function of the i-th task and αi is the task weight.

[0098] By continuously adjusting the loss function, the performance of the preset detection model on multiple security tasks can be improved.

[0099] In another optional embodiment, when training the teacher model, since the teacher model is required to process multiple detection tasks at the same time, the corresponding total loss function value needs to be determined by the first loss function value and the second loss function value. It is worth noting that the first loss function value can be determined according to the predicted password type and the preset password type, and the second loss function value can be determined according to the predicted task type and the preset task type. Both the first loss function value and the second loss function value are calculated using the cross entropy loss function.

[0100] After the teacher model is trained by the above training method, the knowledge distillation algorithm is used to obtain the distillation temperature T. As an example, the distillation temperature T may include password detection and password task recognition. The student model is trained by the distillation temperature T, and the preset password and preset password task of the teacher model are used as input, and the preset task typing and preset password type are used as output. The student model is trained to obtain a trained student model.

[0101] In this embodiment, the teacher model and the student model are obtained by the above training method, and the optimization target of the preset detection model can be obtained, which is expressed as:

[0102] LKD=(1-α)LCE(y,S(x))+αT(x)logS(x)

[0103] Among them, LKD is the optimization objective, LCE is the cross entropy loss, T and S are the teacher network and student network respectively, and α is the task weight.

[0104] In this embodiment, in the field of middleware security, by combining multi-task learning and knowledge distillation algorithms, efficient training and lightweight deployment of preset detection models in password detection and password task recognition can be achieved, thereby enabling rapid and accurate identification of weak passwords and improving the accuracy of password detection.

[0105] In another optional embodiment, since the password detection is divided into two detections, when the first detection result determines that the password is a weak password or the second detection result determines that the password is a weak password, an interception instruction is generated, and the interception instruction is used to prohibit the user from logging in;

[0106] Generate warning information based on interception instructions.

[0107] In this embodiment, no matter whether the user uses the password to be detected to log in or register, once it is identified as a weak password, an interception instruction will be generated to prevent the user from logging in or registering with the password to be detected, thereby protecting user information and improving the security of the system.

[0108] In another optional embodiment, in order to make the detection of the preset detection model more accurate, after S104, the following steps may be further included:

[0109] The preset detection model is iteratively trained based on the password to be detected and the second detection result to obtain a new preset detection model.

[0110] In this embodiment, in order to improve the accuracy of the preset detection algorithm, each time a password to be detected is identified, the password to be detected will be used as a training sample to train the preset detection password, and the preset detection model will be continuously iterated, ensuring that the preset detection model is continuously updated as the threat evolves, ensuring long-term effectiveness.

[0111] Reference Figure 4 The embodiment of the present application further provides a password detection device 400, which may include:

[0112] Acquisition module 401, acquiring the password to be detected;

[0113] An extraction module 402 is used to perform regularized character extraction on the password to be detected using a preset extraction rule to obtain a first character set of the password to be detected;

[0114] A first detection module 403, configured to perform character detection on a first character set using a first preset detection algorithm to obtain a first detection result;

[0115] The second detection module 404 is used to input the password to be detected into a preset detection model when the first detection result determines that it is not a weak password, and use the preset detection model to identify the password type to obtain a second detection result.

[0116] As an optional implementation, the first detection module 403 may further include:

[0117] A traversal unit, used to traverse a preset character library using a first preset detection algorithm to obtain a second character set, wherein the preset character library is used to store characters of a preset weak password;

[0118] A comparison unit, for comparing characters of the first character set with the second character set to determine character similarity;

[0119] The determination unit is used to determine the first detection result as not being a weak password when the character similarity is less than or equal to a preset similarity.

[0120] As an optional implementation, the second detection module 404 may further include:

[0121] A fine-tuning unit, used to fine-tune the preset basic detection model to obtain a first detection model;

[0122] An acquisition unit, configured to acquire a first training sample set, wherein the first training sample set includes a preset password and a corresponding preset password type, and a preset password task and a corresponding preset task type;

[0123] A first construction unit is used to construct a teacher model based on the first basic detection model, respectively taking the preset password and the preset password task as input, and the preset task type and the preset password type as output, to train the first basic detection model to obtain a trained teacher model;

[0124] The second construction unit is used to build a student model based on the first basic detection model, take the prediction result of the teacher model as input, and the preset password type and the preset task type as output, train the student model, and obtain a trained student model.

[0125] As an optional implementation, the fine-tuning unit may be specifically used for:

[0126] Using the first preset fine-tuning application to fine-tune the preset basic model to obtain a second basic detection model;

[0127] The second basic detection model is fine-tuned using a second preset fine-tuning method to obtain a first basic detection model.

[0128] As an optional implementation, the first building unit can also be used for:

[0129] Input the preset password and the preset password task into the teacher model to obtain the predicted password type and the predicted task type;

[0130] Determine a first loss function value according to the predicted password type and the preset password type;

[0131] Determine a second loss function value according to the predicted task type and the preset task type;

[0132] Calculate a total loss function value based on the first loss function value and the second loss function value;

[0133] When the total loss function value does not meet the preset convergence conditions, the model parameters of the teacher model are adjusted until the total loss function value meets the preset convergence conditions to obtain a trained teacher model.

[0134] As an optional implementation, the second detection module 404 may also be used to:

[0135] If the first detection result determines that the password is a weak password or the second detection result determines that the password is a weak password, an interception instruction is generated, and the interception instruction is used to prohibit the user from logging in;

[0136] Generate alarm repair information based on interception instructions.

[0137] As an optional implementation, the second detection module 404 may also be used to:

[0138] The preset detection model is iteratively trained based on the password to be detected and the second detection result to obtain a new preset detection model.

[0139] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0140] The electronic device may include a processor 501 and a memory 502 storing computer program instructions.

[0141] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0142] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In one example, the memory 602 may include a removable or non-removable (or fixed) medium, or the memory 602 is a non-volatile solid-state memory. The memory 502 may be inside or outside the integrated gateway disaster recovery device.

[0143] In one example, the memory 502 may be a read-only memory (ROM). In one example, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.

[0144] The memory 502 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the video query method according to the first aspect of the present disclosure.

[0145] The processor 501 reads and executes the computer program instructions stored in the memory 502 to implement Figure 1 A password detection method in the illustrated embodiment.

[0146] In one example, the electronic device may further include a communication interface 503 and a bus 504. Figure 5As shown, the processor 501, the memory 502, and the communication interface 503 are connected via a bus 504 and communicate with each other.

[0147] The communication interface 503 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0148] Bus 504 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (Accelerated Graphics Port, AGP) or other graphics bus, enhanced industry standard architecture (Extended Industry Standard Architecture, EISA) bus, front side bus (Front Side Bus, FSB), hypertransmission (Hyper Transport, HT) interconnection, industry standard architecture (IndustryStandard Architecture, ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 504 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0149] The electronic device can execute the password detection method in the embodiment of the present application, thereby realizing the combination Figure 1-Figure 4 The invention describes a password detection method and device.

[0150] In addition, in combination with the password detection method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the password detection methods in the above embodiment is implemented.

[0151] In an optional embodiment, in combination with the password detection method in the above embodiment, the embodiment of the present application can provide a computer program product for implementation, and the instructions in the computer program product are executed by a processor of an electronic device, so that the electronic device can implement any one of the password detection methods in the above embodiment.

[0152] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0153] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0154] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0155] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0156] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A password detection method, It is characterized in that include: Get the password to be tested; Performing regularized character extraction on the password to be detected using a preset extraction rule to obtain a first character set of the password to be detected; Performing character detection on the first character set using a first preset detection algorithm to obtain a first detection result; When the first detection result determines that the password is not a weak password, the password to be detected is input into a preset detection model, and the password type of the password to be detected is identified using the preset detection model to obtain a second detection result.

2. The method according to claim 1, It is characterized in that The using a first preset detection algorithm to perform character detection on the first character set to obtain a first detection result includes: Using a first preset detection algorithm to traverse a preset character library to obtain a second character set, wherein the preset character library is used to store characters of a preset weak password; Compare the first character set with the second character set to determine the character similarity; When the character similarity is less than or equal to the preset similarity, the first detection result is determined to be not a weak password.

3. The method according to claim 1, It is characterized in that The preset detection model includes a teacher model and a student model. Before the student model of the preset detection model is used to identify the password type of the password to be detected to obtain the identification result, the method further includes: Fine-tune the preset basic detection model to obtain a first detection model; Acquire a first training sample set, wherein the first training sample set includes preset passwords and their corresponding preset password types, and preset password tasks and their corresponding preset task types; Building a teacher model based on the first basic detection model, taking the preset password and the preset password task as input, and the preset task type and the preset password type as output, respectively, training the first basic detection model to obtain a trained teacher model; A student model is constructed based on the first basic detection model, the prediction results of the teacher model are taken as input, the preset password type and the preset task type are taken as output, the student model is trained, and a trained student model is obtained.

4. The method according to claim 3, It is characterized in that Fine-tuning the preset basic detection model to obtain the first basic detection model includes: Using the first preset fine-tuning application to fine-tune the preset basic model to obtain a second basic detection model; The second basic detection model is fine-tuned using a second preset fine-tuning method to obtain a first basic detection model.

5. The method according to claim 3, It is characterized in that The method of constructing a teacher model based on the first basic detection model, taking the preset password and the preset password task as input, and the preset task type and the preset password type as output, training the first basic detection model to obtain a trained teacher model, includes: Inputting the preset password and the preset password task into the teacher model to obtain a predicted password type and a predicted task type; Determine a first loss function value according to the predicted password type and the preset password type; Determine a second loss function value according to the prediction task type and the preset task type; Calculate a total loss function value based on the first loss function value and the second loss function value; When the total loss function value does not meet the preset convergence conditions, the model parameters of the teacher model are adjusted until the total loss function value meets the preset convergence conditions to obtain a trained teacher model.

6. The method according to claim 1, It is characterized in that After the student model of the preset detection model is used to identify the password type of the password to be detected and a second detection result is obtained, the method further includes: If the first detection result is determined to be a weak password or the second detection result is determined to be a weak password, generating an interception instruction, wherein the interception instruction is used to prohibit the user from logging in; Generate alarm repair information based on the interception instruction.

7. The method according to any one of claims 1 to 6, It is characterized in that After the password type is identified by using the preset detection model to obtain a second detection result, the method further includes: The preset detection model is iteratively trained based on the password to be detected and the second detection result to obtain a new preset detection model.

8. A password detection device, It is characterized in that The device comprises: Acquisition module, obtains the password to be detected; An extraction module, used for performing regularized character extraction on the password to be detected using a preset extraction rule to obtain a first character set of the password to be detected; A first detection module, configured to perform character detection on the first character set using a first preset detection algorithm to obtain a first detection result; The second detection module is used to input the password to be detected into a preset detection model when the first detection result determines that it is not a weak password, and use the preset detection model to identify the password type of the password to be detected to obtain a second detection result.

9. An electronic device, It is characterized in that The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the password detection method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the password detection method according to any one of claims 1 to 7 is implemented.

11. A computer program product, It is characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the password detection method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Weak-password scanning method and device

    CN107577936A

  • Weak password detection method and device and intelligent equipment

    CN110929253A

  • Weak password detection method and device

    CN111385272A

  • BERT model fine adjustment method and device based on convolutional neural network

    CN112529153A

  • Weak password detection method, system and equipment for host service

    CN115017493A