Password security intelligent detection method based on denoising diffusion probability model
Patent Information
- Application Number
- CN202310938637.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-27
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-07-27
AI Technical Summary
但是,目前的基于深度学习的口令字分析方法一般均是基于循环神经网络(RNN)、生成对抗网络(GAN)、自动编码器(VAE)等深度学习技术,检测能力仍有待提高
Smart Images

Figure CN117195195B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, and in particular to a password security intelligent detection method based on a denoising diffusion probability model. Background Technology
[0002] As a security mechanism to protect user privacy, password authentication has long been the most popular authentication method due to its simplicity, ease of use, and efficiency. Meanwhile, attackers and researchers are attempting to incorporate various emerging technologies into password guessing models, continuously advancing password analysis techniques.
[0003] There are three main types of common password guessing models: dictionary-based password guessing models, probability and statistics-based password guessing models, and deep learning-based password guessing models.
[0004] Dictionary-based password guessing models typically transform the original passwords in the dictionary using predefined rules to generate a new extended set as the password guessing set. The size of the guessing set is determined by the size of the original dictionary and the number of rules. Its advantages are simplicity and speed, but the generation of rules requires a certain amount of personal experience.
[0005] Markov models and probabilistic context-free grammar (PCFG) models are two classic examples of password guessing models based on probabilistic statistics. Markov models utilize the statistical regularities of a dictionary, calculating the probability of the next character appearing based on the previous character or context, and outputting the probabilities in order of magnitude into a guess set, aiming to guess as many passwords as possible with the smallest possible guess set. PCFG models first preprocess the password structure, classifying the characters that make up the password into three categories: numeric segments (D), alphabetic segments (L), and special character segments (S). Consecutive segments are merged and counted; for example, the password "abc@123456" is denoted as L3S (one-dimensional 6). The probabilities of all structures and each type of character segment are statistically analyzed, retaining high-probability structures. Then, each character segment is filled with high-probability characters, and the padded password is output as the guess set. Both of these guessing models require making assumptions about the password structure.
[0006] In recent years, deep learning technology has flourished, giving rise to deep learning-based password analysis techniques. Unlike rule-based or probability-based password guessing models, deep learning-based methods make no assumptions about password structure. The password dictionary generated by deep neural networks is not limited to a specific subset of the password space. Instead, neural networks can autonomously encode a wide range of password information, exceeding the capabilities of traditional password guessing models. However, current deep learning-based password analysis methods are generally based on deep learning techniques such as recurrent neural networks (RNNs), generative adversarial networks (GANs), and autoencoders (VAEs), and their detection capabilities still need improvement. Summary of the Invention
[0007] To improve password security detection and identify passwords with low security levels, this invention provides a password security intelligent detection method based on a denoising diffusion probability model.
[0008] This invention provides a password security intelligent detection method based on a denoising diffusion probability model, comprising:
[0009] Step 1: Randomly divide the target password set into a password training set and a password test set according to a certain ratio;
[0010] Step 2: Construct a denoising diffusion probability model and train the denoising diffusion probability model using a password training set;
[0011] Step 3: Based on user needs, generate a password dictionary using a trained denoising diffusion probability model;
[0012] Step 4: Remove duplicates from the generated password dictionary;
[0013] Step 5: Calculate the collision rate between the deduplicated password dictionary and the password test set;
[0014] Step 6: If the collision rate is greater than the set threshold, the target password set is considered to have a security risk; otherwise, the target password set is considered to meet the security requirements.
[0015] Furthermore, in step 2, the training process of the denoising diffusion probability model specifically includes:
[0016] Step 2.1: Select one password from the password training set;
[0017] Step 2.2: Encode the current password using a character-level tokenizer to convert it into a first one-dimensional password vector;
[0018] Step 2.3: During the diffusion process, Gaussian noise is added to the first one-dimensional password vector multiple times, so that it is gradually transformed into a first one-dimensional Gaussian noise vector;
[0019] Step 2.4: Use a Transformer neural network to learn the noise distribution of the diffusion process;
[0020] Step 2.5: Generate a second one-dimensional Gaussian noise vector using a random function. During the denoising process, the noise distribution learned by the Transformer neural network is used to gradually denoise the second one-dimensional Gaussian noise vector. Finally, the second one-dimensional Gaussian noise vector is converted into a second one-dimensional password vector. Then, the second one-dimensional password vector is restored to the password by character-level tokenizer decoding.
[0021] Step 2.6: Repeat steps 2.1 to 2.5 until the Transformer neural network meets the requirements.
[0022] Furthermore, step 3 specifically includes:
[0023] Step 3.1: Based on user requirements, use a random function to generate third-dimensional Gaussian noise vectors of different lengths;
[0024] Step 3.2: Input each third-dimensional Gaussian noise vector into the trained Transformer neural network, convert each third-dimensional Gaussian noise vector into a corresponding third-dimensional password vector, and then use a character-level tokenizer to decode each third-dimensional password vector back into the corresponding password.
[0025] Step 3.3: Repeat steps 3.1 to 3.2 until the number of generated passwords meets the set threshold, thus obtaining the password dictionary.
[0026] Furthermore, the character-level tokenizer encoding adopts single-character encoding, and the characters to be encoded include the special character 'unk' and 95 visible characters.
[0027] Furthermore, the number of denoising steps ranges from 5 to 50.
[0028] The beneficial effects of this invention are:
[0029] (1) Considering the similarity between the password space and the text space, character-level tokenizer encoding is used in the input stage, and a special character 'unk' is encoded, so that the diffusion model constructed in this invention can handle variable-length inputs and obtain variable outputs without manual truncation.
[0030] (2) The diffusion model constructed in this invention can generate a high-quality password dictionary even with a very small number of denoising steps. Preferably, the number of denoising steps is set to 5 to 50, which can improve the sampling speed.
[0031] (3) Compared with the existing method PassGAN, the diffusion model constructed in this invention has a more stable training process, a significantly improved collision rate, and is better able to identify password sets with lower security levels, thus having a better detection effect. Attached Figure Description
[0032] Figure 1 This is a flowchart illustrating the password security intelligent detection method based on a denoising diffusion probability model provided in an embodiment of the present invention.
[0033] Figure 2This is a schematic diagram illustrating the training process of a denoising diffusion probability model for generating a password dictionary, provided in an embodiment of the present invention.
[0034] Figure 3 The collision rate of the 12306 dataset when the batch size is 1024, as provided in this embodiment of the invention;
[0035] Figure 4 The collision rate of the 12306 dataset when the batch size is 256, as provided in this embodiment of the invention;
[0036] Figure 5 The collision rate of the 12306 dataset provided in this embodiment of the invention at different training rounds;
[0037] Figure 6 This invention provides a method to illustrate the variation of collision rate with the number of denoising steps in the CSDN dataset provided in this embodiment.
[0038] Figure 7 The collision rate of the RockYou dataset provided in this embodiment of the invention varies with the number of denoising steps. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0040] like Figure 1 As shown in the figure, this embodiment of the invention provides a password security intelligent detection method based on a denoising diffusion probability model, including the following steps:
[0041] S101: Randomly divide the target password set into a password training set and a password test set according to a certain ratio;
[0042] S102: Construct a denoising diffusion probability model and train the denoising diffusion probability model using a password training set;
[0043] Specifically, such as Figure 2 As shown, the training process of the denoising diffusion probability model specifically includes:
[0044] S1021: Extract a password from the password training set;
[0045] S1022: Encode the current password using a character-level tokenizer to encode it into a first one-dimensional password vector;
[0046] Specifically, word-level tokenizer encoding treats text as a sequence of words, typically segmenting the text using spaces or punctuation marks. It encodes each word or words exceeding a certain frequency, preserving semantic connections between words to some extent, but can easily lead to an excessively large encoding range. Character-level tokenizer encoding treats text as a sequence of characters, encoding single characters and consecutive multi-character sequences. Single-character encoding has weaker semantic connections, while multi-character encoding is a compromise between single-character and word-level encoding. Considering the similarity between the password space and the text space, and the fact that the semantic connections between characters in a password are weaker than those between words in a corpus, character-level tokenizer encoding is used for the input password.
[0047] To simplify operation, this embodiment only encodes a single character, namely, one special character 'unk' and 95 visible characters, with an encoding range of 0 to 95. The special character 'unk' is encoded as 0, and the remaining visible characters are encoded as 1 to 95 in ascending order of ASCII values. The introduction of the special character 'unk' allows for handling inputs of variable length and provides password outputs of variable length without manual truncation.
[0048] S1023: During the diffusion process, Gaussian noise is added to the first one-dimensional password vector multiple times, so that it is gradually transformed into a first one-dimensional Gaussian noise vector.
[0049] S1024: Use a Transformer neural network to learn the noise distribution of the diffusion process;
[0050] S1025: Use a random function to generate a second one-dimensional Gaussian noise vector. In the denoising process, use the noise distribution learned by the Transformer neural network to gradually denoise the second one-dimensional Gaussian noise vector. Finally, convert the second one-dimensional Gaussian noise vector into a second one-dimensional password vector. Then, use a character-level Tokenizer to decode the second one-dimensional password vector back into a password.
[0051] S1026: Repeat steps S1021 to S1025 until the Transformer neural network meets the requirements, learns a near-real noise distribution, and the denoising process can obtain a password dictionary with a distribution similar to the training set.
[0052] S103: Generate a password dictionary using a trained denoising diffusion probability model based on user needs;
[0053] Specifically, the process of generating a password dictionary includes:
[0054] S1031: Based on user requirements, use a random function to generate third-dimensional Gaussian noise vectors of different lengths;
[0055] Specifically, by introducing random factors, users can generate passwords of any length within the required range according to their own needs. This makes the generated dictionary closer to the password distribution of the training set, which improves the password collision rate to a certain extent.
[0056] S1032: Input each third-dimensional Gaussian noise vector into the trained Transformer neural network, convert each third-dimensional Gaussian noise vector into a corresponding third-dimensional password vector, and then use a character-level Tokenizer to decode each third-dimensional password vector back into the corresponding password.
[0057] S1033: Repeat steps S1031 to S1032 until the number of generated passwords meets the set threshold, thus obtaining the password dictionary.
[0058] S104: Remove duplicates from the generated password dictionary;
[0059] S105: Calculate the collision rate between the deduplicated password dictionary and the password test set;
[0060] S106: If the collision rate is greater than the set threshold, the target password set is considered to have security risks; otherwise, the target password set is considered to meet security requirements.
[0061] Example 2
[0062] To verify the effectiveness of the detection method provided in this embodiment of the invention, the following experiments are also provided in this embodiment of the invention.
[0063] (I) Experimental Environment: A DELL Precision 5820 workstation with 128GB of RAM, 10 CPU cores, an NVIDIA GeForce RTX 3090 graphics card, and a dual-boot system of Windows 10 and Ubuntu 22.04. PassGAN-related experiments were conducted on Windows 10, using the rnnPassGAN code as the base code. Diffusion model-related experiments were conducted on Ubuntu 22.04, using the minimal-text-diffusion code as the base code.
[0064] (II) Password Set Selection: We selected three password sets—12306, CSDN, and RockYou—for our experiment. First, we counted the total number of passwords in each set. Then, we removed passwords containing invisible characters or longer than 15 characters, dedicating this set to total set 1. We then counted the number of unique passwords and the repetition rate within total set 1. Next, we randomly divided the passwords in total set 1 into training and test sets at a ratio of 80% and 20%, respectively, and counted the number of unique passwords within each set. The statistical results are as follows:
[0065] Table 1. Total number of passwords, total number of unique passwords, and duplication rate for 12306, CSDN, and RockYou.
[0066]
[0067] The length range distribution of the three password sets is shown in the table below:
[0068] Table 2. Statistics on the distribution of password length ranges for 12306, CSDN, and RockYou
[0069]
[0070] As can be seen, the 12306 password set is smaller in size and has a lower repetition rate, while the RockYou password set is larger in size and has a higher repetition rate. The length distribution of the three password sets is relatively concentrated.
[0071] (III) Experimental Hyperparameters: The hyperparameters of the diffusion model mainly include the number of training rounds, batch size, number of diffusion steps, number of denoising steps, training password length, generated password length, and learning rate. Initially, these parameters are set to the default parameters of the original diffusion model. Further optimization will be carried out on these parameters in subsequent work, and the number of diffusion steps and learning rate will be fixed at 2000 and 0.0001, respectively.
[0072] Using the denoising diffusion probability model provided in this invention, a deduplication dictionary of 100,000 to 100 million characters is generated. The collision rate between the dictionary and the test set is calculated and compared with the collision rate of PassGAN with a dictionary of the same size. When calculating the collision rate, all passwords in the dictionary are unique, and neither the training nor the test set is deduplicated.
[0073] (IV) Experimental Results
[0074] (1) Experiments related to the denoising diffusion probability model of the present invention
[0075] Experiments were conducted on the 12306 password set under different training rounds, batch sizes, and denoising steps. Due to the slow sampling speed of the diffusion model, the main generation size was 10... 5 and 10 6 The dictionaries are compared.
[0076] Figure 3 and Figure 4 These two dotted-line plots illustrate the change in collision rate of the 12306 dataset with the number of denoising steps. Both experiments involved 200,000 training epochs, and each generated 10... 5 and 10 6 The sample passwords were tested, but their batch sizes were 1024 and 256 respectively. It can be seen that the dictionary collision rate is positively correlated with the batch size and the size of the generated dictionary. As the number of denoising steps increases, the collision rate gradually rises, stabilizing around 20 to 25 steps. This indicates that the diffusion model only requires a small number of denoising steps to generate a good dictionary. It is recommended to set the number of denoising steps to 5–50, which can improve the sampling speed by tens of times.
[0077] Figure 5 This demonstrates the variation of the collision rate of the 12306 dataset with the number of training epochs. In this experiment, the batch size was 1024, the denoising steps were 20, and 10 datasets were generated. 5 and 10 6 The test involved several passwords. It can be seen that the password collision rate gradually increases with the number of training rounds. Through other experiments, we found that the collision rate did not reach its peak after 200,000 training rounds. Increasing the number of training rounds can yield an even higher collision rate.
[0078] For the CSDN and RockYou password sets, experiments were conducted to generate dictionaries of different sizes under different training rounds, batch sizes, and denoising steps. Here, only representative experiments are introduced. Figure 6 and Figure 7 They respectively showed the generation of 10 5 and 10 6 When training 200,000 passwords with a batch size of 1024, the impact of the number of denoising steps on the collision rate of CSDN and RockYou datasets was analyzed. It can be seen that the collision rate of CSDN and RockYou is generally higher than that of 12306. We believe this is because their repetition rate is higher than that of 12306. The collision rate of the CSDN and RockYou datasets gradually stabilizes at around 40 steps, which is greater than the number of denoising steps required for 12306. Further analysis suggests this is due to insufficient training and the large dataset size.
[0079] The experimental results show that increasing the number of training rounds and batch size can improve the collision rate. As the number of denoising steps increases, the collision rate first gradually rises to a maximum value and then tends to stabilize.
[0080] Furthermore, the repetition rate is positively correlated with the number of training epochs and denoising steps. A higher repetition rate results in a longer time required to generate a unique password dictionary of the same size. Training time is proportional to the number of training epochs and the batch size. Without considering the dictionary repetition rate, sampling time is proportional to the number of denoising steps and the size of the generated dictionary. Taking the 12306 dataset as an example, with a batch size of 1024, training for 200,000 epochs takes approximately 31 hours, and with 20 denoising steps, generating 10 unique password dictionaries... 7 A unique password takes approximately 11 hours.
[0081] (2) Collision rate comparison with PassGAN
[0082] We tested the collision rate of PassGAN under the same conditions on three password sets: 12306, CSDN, and RockYou. For the RockYou training set, PassGAN reached its optimal performance after 199,000 training epochs, similar to the diffusion model of this invention. Therefore, we trained on each of the three datasets for 200,000 epochs for comparison. For the diffusion model of this invention, we sacrificed some collision rate to generate 10 passwords faster. 8 For the dictionary of scale, our model parameters were set to 200,000 training rounds, batch size and denoising steps to 1024 and 10 respectively. The experimental results are shown in Table 3.
[0083] Table 3 compares the collision rates of PassGAN and the diffusion model of this invention on 12306, CSDN, and RockYou password sets.
[0084]
[0085] Table 3 clearly shows that the dictionary collision rate generated by the model of this invention has a significant advantage over PassGAN. (In generating 10...) 8 When dealing with multiple passwords, the collision rate of the model in this invention is 3.17%, 6.33%, and 13.22% higher than that of PassGAN on the 12306, CSDN, and RockYou datasets, respectively.
[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A password security intelligent detection method based on a denoised diffusion probability model, characterized in that, include: Step 1: Randomly divide the target password set into a password training set and a password test set according to a certain ratio; Step 2: Construct a denoising diffusion probability model and train it using a password training set; the training process of the denoising diffusion probability model specifically includes: Step 2.1: Select one password from the password training set; Step 2.2: Encode the current password using a character-level tokenizer to convert it into a first one-dimensional password vector; Step 2.3: During the diffusion process, Gaussian noise is added to the first one-dimensional password vector multiple times, so that it is gradually transformed into a first one-dimensional Gaussian noise vector; Step 2.4: Use a Transformer neural network to learn the noise distribution of the diffusion process; Step 2.5: Generate a second one-dimensional Gaussian noise vector using a random function. During the denoising process, the noise distribution learned by the Transformer neural network is used to gradually denoise the second one-dimensional Gaussian noise vector. Finally, the second one-dimensional Gaussian noise vector is converted into a second one-dimensional password vector. Then, the second one-dimensional password vector is restored to the password by character-level tokenizer decoding. Step 2.6: Repeat steps 2.1 to 2.5 until the Transformer neural network meets the requirements; Step 3: Generate a password dictionary using a trained denoising diffusion probability model according to user requirements; specifically including: Step 3.1: Generate third-dimensional Gaussian noise vectors of different lengths using a random function according to user requirements; Step 3.2: Input each third-dimensional Gaussian noise vector into the trained Transformer neural network, convert each third-dimensional Gaussian noise vector into a corresponding third-dimensional password vector, and then use a character-level tokenizer to decode each third-dimensional password vector back into the corresponding password. Step 3.3: Repeat steps 3.1 to 3.2 until the number of generated passwords meets the set threshold, thus obtaining the password dictionary; Step 4: Remove duplicates from the generated password dictionary; Step 5: Calculate the collision rate between the deduplicated password dictionary and the password test set; Step 6: If the collision rate is greater than the set threshold, the target password set is considered to have a security risk; otherwise, the target password set is considered to meet the security requirements.
2. The password security intelligent detection method based on a denoised diffusion probability model according to claim 1, characterized in that, The character-level tokenizer encoding uses single-character encoding, and the characters to be encoded include the special character 'unk' and 95 visible characters.
3. The password security intelligent detection method based on a denoising diffusion probability model according to claim 1, characterized in that, The number of noise reduction steps ranges from 5 to 50.