Directional password guessing method and system based on large language model

By rewriting and training the large language model glm-4-9b, and combining it with email identifiers for password guessing, the problem of insufficient generalization in existing technologies is solved, and efficient and accurate password guessing is achieved.

CN119783086BActive Publication Date: 2025-12-05HAINAN UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411848219.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-12-05
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

Existing password guessing methods based on personal information tags lack effective generalization in real-world scenarios and require human experience to set, resulting in low password guessing efficiency.

Method used

The glm-4-9b model is used to generate highly targeted password guessing by rewriting personal information and old passwords into alpaca format and using email addresses as identifiers for data association and matching.

Benefits of technology

It improves the accuracy and efficiency of password guessing, breaks through the limitations of relying on experience to set personal information tags and external dictionary databases, and can quickly recover password hash files to reveal potential security issues with user passwords.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783086B_ABST
    Figure CN119783086B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of electric data processing, and particularly relates to a directional password guessing method and system based on a large language model, which comprises the following steps: obtaining personal information and / or an old password of a user; rewriting the personal information and / or the old password according to a set format; inputting the rewritten personal information and / or the old password into a trained glm-4-9b model to output a guessed password. The present application applies a large language model to a directional password guessing scenario, and generates a highly targeted password in an end-to-end manner by using personal information and an old password, without relying on an experienced setting of personal information labels, introducing an additional dictionary library and designing a complex probability calculation as in the past probability model, so as to help quickly recover a password hash file, reveal potential security problems of a user password, and help provide a reference for a password security policy of a network service party.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electronic data processing technology, and in particular to a method and system for targeted password guessing based on a large language model. Background Technology

[0002] To protect user privacy, users typically need to set passwords. Password guessing refers to guessing a user's password through technical means. Password guessing has positive aspects, such as detecting the strength of a user's password and prompting the user to set a more secure password. Therefore, password guessing has always been a subject of scholarly research.

[0003] For example, Chinese invention with application number 202210073083.1 discloses a targeted online password guessing method based on pointer generation network. Although it can generate targeted guessing passwords using personal information, its use of personal information is still based on personal information tags set by human experience, and it lacks effective generalization in real-world scenarios. Summary of the Invention

[0004] The purpose of this invention is to provide a targeted password guessing method and system based on a large language model, so as to improve the limitations of password guessing based on personal information tags in the existing technology.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] In a first aspect, the present invention provides a targeted password guessing method based on a large language model, comprising the following steps:

[0007] Obtaining the user's personal information and / or old passwords;

[0008] Rewrite the personal information and / or old passwords according to the set format;

[0009] Input the rewritten personal information and / or old password into the trained glm-4-9b model, and output the guessed password.

[0010] In a more optimized solution, the setting format is alpaca format.

[0011] In the above scheme, rewriting the original dataset using the ALpaca format not only makes the rewritten original dataset more conducive to the learning of the glm-4-9b model and improves its recognition ability, but also the ALpaca format is widely used and easy to implement.

[0012] In one possible implementation, the glm-4-9b model is obtained through the following steps:

[0013] Obtain publicly leaked datasets of personal information and passwords containing email addresses from the internet, and clean them to remove malformed data entries;

[0014] Using email addresses as identifiers, we match the personal information datasets and password datasets of the same user, and then associate and match the matched personal information datasets and password datasets to construct the original training dataset.

[0015] The original training dataset was rewritten using the alpaca format to obtain the training dataset.

[0016] The glm-4-9b model was trained using the training dataset.

[0017] In the above scheme, personal information including email addresses and passwords is collected first. Since email addresses are easier to obtain, they are used as identifiers to associate and match the personal information and password data of the same user, thus aiding the learning of the glm-4-9b model. Rewriting the dataset in ALPA format further helps the glm-4-9b model recognize passwords, improving the accuracy of the model's password guessing results. Therefore, the glm-4-9b model trained using the above method has strong recognition capabilities, is well-suited for password guessing, and achieves high accuracy.

[0018] In one possible implementation, the removal of malformed data entries includes: removing entries with malformed email addresses and passwords; removing entries containing more than the number of printable ASCII characters; and removing duplicate entries.

[0019] In the above scheme, by removing the three types of data entries, not only can erroneous data be reduced, but duplicate data can also be avoided, reducing data redundancy and helping large language models learn correctly.

[0020] The process of using email addresses as identifiers to match the same user's personal information dataset and password dataset, and then associating the matched personal information dataset and password dataset, includes:

[0021] First, based on personal information, matching is performed through email addresses to complete the data set of personal information as much as possible. The data elements include: name, date of birth, phone number, username, ID card number, and email address.

[0022] Next, based on the password dataset, matching is performed by email address to match as many different passwords of the same user in the password dataset as possible;

[0023] Finally, based on the matched personal information dataset and password dataset, the personal information and historical passwords of the same user are associated and matched using the email matching method to obtain the original training dataset. A complete original training dataset contains: {Personal Information: (Name, Birthday, Phone Number, Username, ID Card Number, Email Address), Historical Passwords: (Old Password 1, Old Password 2, Old Password 3, ...)}.

[0024] The rewriting of the original training dataset using the ALPA format includes: the Instruction field guides the LLM to understand the targeted password guessing task through natural language descriptions; the input field is set to the user's personal identifiable information and an old password, and for Chinese users' names, it is represented in Chinese Pinyin, with a space separating the surname and given name; the output field randomly selects an old password from the historical password data in the original training dataset as the target password.

[0025] Secondly, embodiments of the present invention provide a targeted password guessing system based on a large language model, comprising:

[0026] The data collection module is used to obtain users' personal information and / or old passwords;

[0027] The data rewriting module is used to rewrite the personal information and / or old passwords according to a set format;

[0028] The model training module is used to train the glm-4-9b model using the training dataset;

[0029] The password guessing module is used to input the rewritten personal information and / or the old password into the trained glm-4-9b model and output the guessed password.

[0030] Thirdly, the present invention provides a computer program product, including computer-readable instructions, characterized in that the computer-readable instructions, when executed by a processor, implement the steps in the targeted password guessing method based on a large language model of the present invention.

[0031] Fourthly, the present invention provides a computer-readable storage medium including computer-readable instructions, characterized in that the computer-readable instructions, when executed by a processor, implement the steps in the targeted password guessing method based on a large language model of the present invention.

[0032] Fifthly, the present invention provides an electronic device, comprising: a memory storing program instructions; and a processor connected to the memory, executing the program instructions in the memory to implement the steps in the targeted password guessing method based on a large language model of the present invention.

[0033] Compared with the prior art, the present invention has the following technical advantages:

[0034] By applying large language models to targeted password guessing scenarios, highly targeted passwords can be generated end-to-end using personal information and old passwords, without relying on experience-based personal information tags, introducing additional dictionaries, and designing complex probability calculations as in previous probabilistic models. This can help quickly recover password hash files, reveal potential security issues with user passwords, and provide a reference for password security strategies of network service providers.

[0035] Targeted password guessing can generally be divided into two types: targeted guessing based on personal information and targeted guessing based on old passwords. The former requires a manually set personal information structure, while the latter requires editing and transformation. This invention directly obtains the target password from personal information and old passwords, without the need to set personal information tags or edit and transform them. It is highly targeted, adaptable, and efficient.

[0036] By fine-tuning a small-scale large language model and applying it to downstream tasks of targeted password guessing, the model leverages its prior knowledge, excellent natural language understanding and generation capabilities to generate highly targeted guesses. This overcomes the limitations of previous targeted password guessing models that relied on experience to set fixed types of personal information tags and external dictionaries to generate targeted guesses, resulting in insufficient generalization. It also solves the problem that previous targeted password guessing methods designed separately for guessing based on personal information and old passwords, making it difficult to simultaneously consider both personal information and old passwords when generating guesses.

[0037] Other advantages of this invention are described in the embodiments section. Attached Figure Description

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

[0039] Figure 1 The flowchart illustrates a targeted password guessing method based on a large language model, as exemplified in an embodiment of the present invention.

[0040] Figure 2 This is a flowchart illustrating the training and inference process of the glm-4-9b model in an embodiment of the present invention.

[0041] Figure 3 This is a block diagram of the targeted password guessing system based on a large language model in an embodiment of the present invention.

[0042] Figure 4This is a block diagram of the components of an electronic device. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0044] Please see Figure 1 This embodiment provides a targeted password guessing method based on a large language model, including the following steps:

[0045] S10: Obtain a publicly disclosed dataset of personal information (including email addresses and passwords) on the internet (not actively disclosed by users, but leaked online; also understood as publicly available online) as the raw dataset. Clean the raw dataset by removing incorrectly formatted data entries. Data cleaning mainly includes: 1) removing entries with incorrectly formatted email addresses and passwords; 2) removing entries containing more than the printable ASCII characters; and 3) removing duplicate entries.

[0046] Because publicly leaked datasets on the real network are incomplete, some datasets have missing personal information, and some only have one password. Since these publicly leaked datasets usually contain email addresses, this paper uses email addresses as user identifiers and uses email addresses to gather the information of the same user scattered in different leaked datasets in order to complete personal information and match multiple passwords of the same user. Therefore, when collecting raw data, the collected personal information and password data need to include email information.

[0047] S20: Using email addresses as identifiers, match the personal information dataset and password dataset of the same user, and then associate the matched personal information dataset and password dataset to construct the original training dataset.

[0048] In practice, this step begins by matching email addresses to complete the personal information dataset as much as possible. This involves six key elements: name, date of birth, phone number, username, ID number, and email address. For example, user u's personal information is scattered across two datasets, A and B. Dataset A contains email address u, name u, and date of birth u, while dataset B contains email address u, phone number u, and username u. By matching email addresses u from both datasets, u's personal information can be completed, resulting in email address u, name u, date of birth u, phone number u, and username u.

[0049] Next, based on the password dataset, matching is performed by email address to match as many different passwords of the same user in the password dataset as possible.

[0050] Finally, based on the matched personal information dataset and password dataset, the personal information and historical passwords of the same user are associated and matched using the email matching method to obtain the final original training dataset.

[0051] A complete set of original training data contains: {Personal information: (name, birthday, phone number, username, ID number, email address), historical passwords: (old password 1, old password 2, old password 3, ...)}.

[0052] If the entire data processing flow is divided into multiple stages, then the stages of steps S10 and S20 mentioned above can be collectively referred to as the data preprocessing stage, the subsequent steps S30 and S40 can be collectively referred to as the model fine-tuning stage, and step S50 can be referred to as the generation stage.

[0053] S30, based on the original training dataset, is rewritten using the alpaca format to obtain the training dataset.

[0054] Specifically, the ALPA format includes three fields: Instruction, input, and output. The Instruction field guides the LLM (Large Language Model) to understand the targeted password guessing task through a natural language description. The input field sets the user's PII (Personally Identifiable Information) and an old password. For Chinese users, the name is represented using Pinyin, separated by a space. The output field is the label for supervised learning, randomly selecting an old password from the historical password data in the original training dataset as the target password. In the end, each training data set is in the shape of: Instruction: "Using someone's personally identifiable information and old passwords, guess the most likely new password for this person." Input: Name is "zhang san", birthday is 19xx0x0x, phone number is13012345678, id number is443068219xx0x0xxxxx, email is scl_abccdef@163.com,username is abcdef,oldpasswords are scl123456,scl_abcdefo.output:sclabcdef.

[0055] In this step, the original training dataset is fine-tuned using the ALPA format to construct a training dataset, which enables the LLM to have stronger recognition capabilities in password recognition application scenarios when trained based on the training dataset.

[0056] S40 uses the training dataset to train the glm-4-9b model. Since the training process is also a process of fine-tuning the structure and parameters of the glm-4-9b model, training the glm-4-9b model can also be called fine-tuning the glm-4-9b model.

[0057] A pre-trained glm-4-9b model was used as the baseline model for fine-tuning, with autoregressive blank filling as the training objective. Throughout the fine-tuning process, the glm-4-9b model learned how to adjust the user's PII and old password to obtain the user's new password.

[0058] Specifically, given the input text X = [x1,...,x] n Sample multiple text fragments {s1,..,s m}, each fragment s i Corresponding to a series of consecutive marks in X Each fragment is replaced by a single [MASK] tag, forming the corrupted text X. corrupt The model autoregressively predicts missing markers in these segments, meaning that when predicting missing markers in segments, the model can access both corrupted text and previously predicted segments. To fully capture the interdependencies between different segments, the segments are ordered randomly, similar to a sorting language model. Formally, let Z... m Let s be the set of all possible permutations [1,2,...,m] of an index sequence of length m. Z<i for GLM defines the pre-training objective as follows:

[0059]

[0060] Generate the marker in each blank in order from left to right, that is, generate fragment s. i The probability is decomposed into:

[0061]

[0062] GLM training involves randomly removing consecutive words from a text, and then training the model to reconstruct these words one by one in a specific order. This method combines the advantages of both autoencoder and autoregressive pre-training approaches, demonstrating superior performance in natural language understanding and text generation tasks, and exhibiting excellent generalization ability across various downstream tasks.

[0063] See also Figure 2 The specific training steps are as follows:

[0064] 1) Loading the Training Dataset and Pre-trained Model: The first step in the training process is to load the training dataset and pre-trained model containing the necessary information for the target task. The training dataset includes the user's personal information (PII) and historical passwords, which can be denoted as... Where P i I represents the password of the i-th user. i Representing personal information associated with the password, to ensure data diversity and representativeness, each instance (P) in the training dataset... i ,I i All of them have been screened and cleaned. Next, load the glm-4-9b model, denoted as M. pretrainedThis model is pre-trained on a large-scale corpus, possesses powerful generative capabilities, and has learned a wealth of linguistic rules. By loading the model's pre-trained parameters θ... pretrained This provides a foundation for subsequent fine-tuning.

[0065] 2) Before training, the input data needs to be preprocessed, specifically by using the glm-4-9b tokenizer to convert the text data (including passwords and personal information) into a vector representation. Assume the input text is a sequence of words X = [x1, x2, ..., x...]. n The tokenizer transforms it into a fixed-dimensional vector sequence V = [v1, v2, ..., v]. n ], where each v i It is a high-dimensional embedding vector. In this process, the tokenizer assigns a unique identifier to each word or character and maps it to the embedding space. In this way, text data can be understood by the model and processed in subsequent training.

[0066] 3) To accelerate the training process and reduce memory overhead, the LoRA method is used to fine-tune the model. Specifically, LoRA reduces the amount of parameter updates by introducing low-rank matrix factorization into part of the model's weight matrix. For each layer weight matrix W of glm-4-9b, LoRA introduces low-rank matrices A and B (where... Replace r << d, where r and d are the ranks of the low-rank matrices A and B respectively, and express it as:

[0067] W′=W+ΔW

[0068] Here, ΔW represents the adaptive update introduced through LoRA during fine-tuning. This low-rank update method significantly reduces the number of model parameters and memory consumption while maintaining good model performance.

[0069] 4) Train the model and update the parameters

[0070] During the training phase, the model's goal is to minimize the loss function. To optimize the parameters. Assume that in each training step, the input is the vectorized data V, and the output is the password predicted by the model. The model updates its parameters by calculating the difference between the predicted password and the actual password. The loss function can be expressed as:

[0071]

[0072] Where, f(M) θ (V i P represents the model's prediction result under parameter θ.i This is the actual password, where Loss is the cross-entropy loss and N is the number of samples. The gradient is calculated using the backpropagation algorithm based on the loss value, and the AdamW optimizer is used to determine the magnitude of the parameter updates. Because the LoRA method is used, parameter updates only occur on the low-rank matrices A and B, while other weight matrices W remain unchanged, thus reducing computational and memory overhead.

[0073] 5) Merge fine-tuned parameters with pre-trained parameters

[0074] After training is complete, the LoRA parameters ΔW = AB obtained through fine-tuning will be merged with the pre-trained parameters W of the glm-4-9b model to obtain the final model weights W. final :

[0075] W final =W+ΔW

[0076] The merging operation ensures that the knowledge gained during the fine-tuning process is effectively integrated into the model, enabling the model to fully demonstrate its capabilities in the password guessing task while retaining some of its original language understanding and generation capabilities.

[0077] 6) Finally, save the trained glm-4-9b model M. final The model includes the combined weights W. final This includes other necessary model parameters. The saving process persists the model's state for later use or deployment. This step ensures that the model can be reused for inference tasks or further training.

[0078] During training, the hyperparameters were set as follows: 1 epoch, batch size of 8, gradient accumulation of 32, torch dtype of torch.bfloat16, AdamW optimizer, and learning rate of 5e-4. LoRA parameters were: lora_r of 8, lora_alpha of 32, and lora_dropout of 0.1. These parameter settings improve the model's accuracy in password guessing.

[0079] S50: Collect the personal information and / or old passwords of the target user (the target user is the user whose password is to be guessed), rewrite the collected data in alpaca format, and then input the rewritten data into the trained glm-4-9b model to output the guessed password.

[0080] Specifically, load the finely tuned glm-4-9b model. The model's input cannot be empty; input the orientation information in ALPA format. If the target user's personal information is known, input the target user's personal information. The personal information can be the complete set of six elements or the default. If the user's old password is known, input the user's old password. Multiple old passwords can be input. If both the personal information and the old password are known, use all of them as input.

[0081] In other words, the above methods can guess a user's new password based on personal information and / or historical passwords. They are not limited to personal information but can also be based on historical passwords, thus making them suitable for more application scenarios.

[0082] See also Figure 2 Considering the low fault tolerance of natural language tasks such as password guessing, this step employs a beam search method to generate multiple targeted candidate passwords, namely P(pw geuss |PII,pw old The top q guesses are selected. Specifically, the q paths with the highest probabilities generated by the model (i.e., the bundle width, representing the guess budget q in the password guessing task) are selected, and these paths are iterated until an end marker is encountered, indicating that a guess has been generated. The total number of iterations does not exceed the search depth. Finally, q candidate passwords are obtained, sorted in descending order of probability.

[0083] To accelerate password generation, traditional Attention computation is replaced with Paged Attention. Paged Attention borrows the idea of ​​managing virtual memory through pages in operating systems: the KVCache (used to store the results of previous calculations to reduce redundant calculations and improve the computational efficiency of Attention) is divided into fixed-size blocks. These blocks do not need to be stored in contiguous memory; instead, they are managed by a unified memory allocator. Requests allocate memory on demand, without needing to pre-reserve memory of the size max_seq_len. After a request is completed, its blocks are released, and the system only needs to allocate smaller blocks. Paged Attention can share cache blocks. In beam search scenarios, multiple results need to be generated for the same prompt. These sub-requests can share the same batch of prompt cache. Paged Attention can increase the throughput of beam search by more than 10 times, thereby improving the speed of password generation.

[0084] The above method fine-tunes a small-scale large language model and applies it to downstream tasks of targeted password guessing. By leveraging the prior knowledge, excellent natural language understanding and generation capabilities of the large language model, it generates highly targeted guesses. This overcomes the limitations of previous targeted password guessing models that relied on experience to set fixed types of personal information tags and external dictionary databases to assist in generating targeted guesses, resulting in insufficient generalization. It also solves the problem that previous targeted password guessing methods designed guessing methods based on personal information and old passwords separately, making it difficult to simultaneously consider personal information and old passwords in generating guesses.

[0085] Please see Figure 3 This embodiment also provides a targeted password guessing system based on a large language model, including:

[0086] The data collection module is used to obtain users' personal information and / or old passwords;

[0087] The data rewriting module is used to rewrite the personal information and / or old passwords according to a set format;

[0088] The model training module is used to train the glm-4-9b model using the training dataset;

[0089] The password guessing module is used to input the rewritten personal information and / or the old password into the trained glm-4-9b model and output the guessed password.

[0090] For more detailed processing operations of each of the above modules, please refer to the relevant descriptions in the above methods, which will not be repeated here.

[0091] As shown in Figure 4, this embodiment also provides an electronic device, which may include a processor 41 and a memory 42, wherein the memory 42 is coupled to the processor 41. It is worth noting that this figure is exemplary, and other types of structures can be used to supplement or replace this structure to achieve data extraction, report generation, communication, or other functions.

[0092] like Figure 4 As shown, the electronic device may also include an input unit 43, a display unit 44, and a power supply 45. It is worth noting that the electronic device is not necessarily required to include these components. Figure 4 All components shown in the image. Furthermore, electronic devices may also include... Figure 4 For components not shown, please refer to existing technologies.

[0093] Processor 41, sometimes also called controller or operation control, may include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of various components of the electronic device.

[0094] The memory 42 may be one or more of the following: a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It can store configuration information of the processor 41, instructions executed by the processor 41, and other information. The processor 41 can execute programs stored in the memory 42 to perform information storage or processing. In one embodiment, the memory 42 further includes a buffer memory, or buffer, to store intermediate information.

[0095] This invention also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed in an electronic device, the program product causes the electronic device to perform the operation steps included in the method of this invention.

[0096] This invention also provides a storage medium storing computer-readable instructions that cause an electronic device to perform the operation steps included in the method of this invention.

[0097] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0098] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part 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 the present invention. 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.

[0099] The embodiments described above are merely specific implementations of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications, substitutions, and improvements within the technical scope disclosed in the present invention, and these modifications, substitutions, and improvements should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A targeted password guessing method based on a large language model, characterized in that, Includes the following steps: Obtaining a user's personal information and / or old passwords, wherein the personal information includes all or part of name, date of birth, phone number, username, ID card number, and email address, and the old passwords are one or more; Rewrite the personal information and / or old passwords in ALpaca format; Input the rewritten personal information and / or old password into the trained glm-4-9b model, and output the guessed password. The glm-4-9b model is obtained through the following steps: Obtain publicly leaked datasets of personal information and passwords containing email addresses from the internet, and clean them to remove malformed data entries; Using email addresses as identifiers, we match the personal information datasets and password datasets of the same user, and then associate and match the matched personal information datasets and password datasets to construct the original training dataset. The original training dataset was rewritten using the alpaca format to obtain the training dataset. The process of rewriting the original training dataset using the ALPA format includes: the Instruction field guides the LLM to understand the targeted password guessing task through natural language descriptions; the input field is set to the user's personal identifiable information and an old password, and for Chinese users' names, it is represented in Chinese Pinyin, with a space separating the surname and given name; the output field randomly selects an old password from the historical password data in the original training dataset as the target password. The glm-4-9b model is trained using the aforementioned training dataset; the specific training steps are as follows: 1) Loading the training dataset and pre-trained model: The first step in the training process is to load the training dataset and pre-trained model containing the information required for the target task. The training dataset includes the user's personal information and historical passwords, denoted as... ,in This represents the password for the i-th user. This represents the personal information associated with the password; next, load the glm-4-9b model, denoted as... ; 2) Before training, the input data needs to be preprocessed, that is, the text data is converted into a vector representation using the glm-4-9b tokenizer; assuming the input text is a sequence of multiple words. The tokenizer converts it into a fixed-dimensional vector sequence. Each of them It is a high-dimensional embedding vector; 3) Fine-tuning the model using the LoRA method: For each layer weight matrix of glm-4-9b LoRA introduces a low-rank matrix and Replace it, that is, represent it as: , in r and d are low-rank matrices. and rank, This indicates the adaptive updates introduced via LoRA during the fine-tuning process; 4) Train the model and update the parameters: Assume that in each training step, the input is vectorized data. The output is the password predicted by the model. The model updates its parameters by calculating the difference between the predicted password and the actual password. The loss function is expressed as: , in, Indicates the model in parameters The following prediction results It is the real password, Loss is the cross-entropy loss, and N is the number of samples; the gradient is calculated based on the loss value using the backpropagation algorithm, and the AdamW optimizer is used to determine the magnitude of the parameter update; 5) Merge fine-tuned parameters with pre-trained parameters: After training, the LoRA parameters obtained through fine-tuning are... It will be related to the pre-training parameters of the glm-4-9b model The weights are then merged to obtain the final model weights. : , 6) Finally, save the trained glm-4-9b model. The model includes the combined weights. Other model parameters; During training, the training hyperparameters were set as follows: 1 epoch in total, batch_size of 8, gradient_accumulation of 32, torch_dtype of torch.bfloat16, AdamW optimizer used, and learning rate of 5e-4; LoRA parameters: lora_r of 8, lora_alpha of 32, and lora_dropout of 0.

1.

2. The targeted password guessing method based on a large language model according to claim 1, characterized in that, The removal of malformed data entries includes: removing entries with incorrect email addresses and passwords; removing entries containing more than the number of printable ASCII characters; and removing duplicate entries.

3. The targeted password guessing method based on a large language model according to claim 1, characterized in that, The process of using email addresses as identifiers to match the same user's personal information dataset and password dataset, and then associating the matched personal information dataset and password dataset, includes: First, based on personal information, matching is performed through email addresses to complete the essential information of the personal information dataset. The essential information includes: name, date of birth, phone number, username, ID card number, and email address. Next, based on the password dataset, matching is performed by email address to find multiple different passwords for the same user in the password dataset; Finally, based on the matched personal information dataset and password dataset, the personal information and historical passwords of the same user are associated and matched using the email matching method to obtain the original training dataset. A complete original training dataset contains: {Personal Information: (Name, Birthday, Phone Number, Username, ID Card Number, Email Address), Historical Passwords: (Old Password 1, Old Password 2, Old Password 3, …)}.

4. A targeted password guessing system based on a large language model, characterized in that, include: The data collection module is used to obtain the user's personal information and / or old passwords; the personal information includes all or part of the following: name, date of birth, phone number, username, ID card number, and email address; the old passwords are one or more. The data rewriting module is used to rewrite the personal information and / or old passwords in alpaca format; The model training module is used to train the glm-4-9b model using the training dataset; The password guessing module is used to input the rewritten personal information and / or the old password into the trained glm-4-9b model and output the guessed password. The training dataset is obtained by rewriting the original training dataset using the alpaca format; The original training dataset was rewritten using the ALPACA format, including: the Instruction field, which guides the LLM to understand the targeted password guessing task through natural language descriptions; the input field, which sets the user's personal identifiable information and an old password, using Chinese pinyin for the name of Chinese users, with a space separating the surname and given name; and the output field, which randomly selects an old password from the historical password data in the original training dataset as the target password. The glm-4-9b model is trained using the aforementioned training dataset; the specific training steps are as follows: 1) Loading the training dataset and pre-trained model: The first step in the training process is to load the training dataset and pre-trained model containing the information required for the target task. The training dataset includes the user's personal information and historical passwords, denoted as... ,in This represents the password for the i-th user. This represents the personal information associated with the password; next, load the glm-4-9b model, denoted as... ; 2) Before training, the input data needs to be preprocessed, that is, the text data is converted into a vector representation using the glm-4-9b tokenizer; assuming the input text is a sequence of multiple words. The tokenizer converts it into a fixed-dimensional vector sequence. Each of them It is a high-dimensional embedding vector; 3) Fine-tuning the model using the LoRA method: For each layer weight matrix of glm-4-9b LoRA introduces a low-rank matrix and Replace it, that is, represent it as: , in r and d are low-rank matrices. and rank, This indicates the adaptive updates introduced via LoRA during the fine-tuning process; 4) Train the model and update the parameters: Assume that in each training step, the input is vectorized data. The output is the password predicted by the model. The model updates its parameters by calculating the difference between the predicted password and the actual password. The loss function is expressed as: , in, Indicates the model in parameters The following prediction results It is the real password, Loss is the cross-entropy loss, and N is the number of samples; the gradient is calculated based on the loss value using the backpropagation algorithm, and the AdamW optimizer is used to determine the magnitude of the parameter update; 5) Merge fine-tuned parameters with pre-trained parameters: After training, the LoRA parameters obtained through fine-tuning are... It will be related to the pre-training parameters of the glm-4-9b model The weights are then merged to obtain the final model weights. : , 6) Finally, save the trained glm-4-9b model. The model includes the combined weights. Other model parameters; During training, the training hyperparameters were set as follows: 1 epoch in total, batch_size of 8, gradient_accumulation of 32, torch_dtype of torch.bfloat16, AdamW optimizer used, and learning rate of 5e-4; LoRA parameters: lora_r of 8, lora_alpha of 32, and lora_dropout of 0.

1.

5. A computer program product comprising computer-readable instructions, characterized in that, When executed by a processor, the computer-readable instructions implement the steps of the targeted password guessing method based on a large language model as described in any one of claims 1-3.

6. A computer-readable storage medium comprising computer-readable instructions, characterized in that, When executed by a processor, the computer-readable instructions implement the steps of the targeted password guessing method based on a large language model as described in any one of claims 1-3.

7. An electronic device, characterized in that, include: Memory, which stores program instructions; The processor, connected to the memory, executes program instructions in the memory to implement the steps of the targeted password guessing method based on a large language model as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Directional online password guessing method based on pointer generation network

    CN116522319A

  • Password guessing set generation system and method

    CN111241534A

  • Score generation method and device, electronic equipment and storage medium

    CN117563217A