## 3 Password Generation Selection Model
### Password Generation Selection Model  
The ordered Markov enumerator (OMEN) was chosen as the password generation module to implement the algorithm. To better understand the generation process of the candidate password set, the relevant theoretical knowledge is supplied. OMEN generates a combined password according to the probability of occurrence of multiple N-gram character sequences. The higher the probability, the higher the output of the combined password. The specific method is to use Equation (1) to convert all N-gram sequence probabilities \(p_{i}\) into discrete integers \(level_{i}\), a fixed interval  
\[level_{i}=round(\log(c_{1}\cdot p_{i}+c_{2})) \tag{1}\]  
where \(c_{1}\) and \(c_{2}\) are selected constants and round is the rounding function. The concept of storing N-gram sequence heaps with the same level value is introduced, and the N-gram sequences are stacked according to the \(level\) value [9]. Using select N-gram sequences from different heaps to form password \(X\) makes the sum of the level values of the combined password equal to \(H(X)\) and the length of the combined password equal to \(\mathsf{I}\). Adjusting \(H(X)\) and \(\mathsf{I}\) can achieve the purpose of controlling the output of the generated combined password on the order of the probability of the combined password. The OMEN model generated password set \(D_{\text{OMEN}}\) can be expressed as  
\[D_{\text{OMEN}}=\left\{X:\|X\|\in\mathbb{Z}^{[0,L]},H(X)\in\prod[level_{0},level _{\text{all}}]\right\} \tag{2}\]  
where \(\|X\|\in\mathbb{Z}^{[0,L]}\) is the combined password length and \(H(X)\) is the sum of the level value of the combined password. Assuming that the maximum value of the generated password set length \(l\) is \(\mathsf{L}\), the sum of all \(level\) values is \(level_{\text{all}}\), and the minimum \(level\) is \(level_{0}\). The process of the PassGAN neural network discriminator for the candidate password set password \(\mathsf{X}\) generated by OMEN to calculate the score \(\mathsf{S}\) can be described as  
\[S=f_{\text{GAN-D}}(X) \tag{3}\]  
where \(f_{\text{GAN-D}}\) is the PassGAN discriminator neural network. Combining Equations (2) and (3), the password set \(D_{\text{OMECDN}}\) generated by the OMECDN model is expressed as  
\[D_{\text{OMECDN}}=\left\{X:X\in D_{\text{OMEN}},f_{\text{GAN-D}}(X)\geq\gamma\right\} \tag{4}\]  
where the range of \(X\) is referenced to Equation (2), the constant \(\gamma\) is determined experimentally (more details about \(\gamma\) are described in Algorithm 1), and the number of generated passwords for the target is prepared. ``` Count = 0  WHILE Count < targetCount:  FOR each Password \(X\) IN \(D_{\text{OMEN}}\):  IF \(f_{\text{GAN-D}}(X)\geq\gamma\):  Output \(X\)  Count = Count+1  ELSE:  CONTINUE  END IF  END FOR  END WHILEThe trained ordered Markov password enumerator is used to generate candidate password sets. The generation process is to traverse each heap according to the level value and find substring sequences from these heaps to combine passwords to generate combined passwords. The calculation of the password score is shown in Equation (3), and the process of selecting a password based on the score is shown in Figure 2.

The candidate password set X is used as the input of the PassGAN model discriminator \(f_{\text{GAN-D}}\) to obtain the score S. The score S and the threshold constant \(\gamma\) are judged, and the passwords greater than or equal to the threshold constant \(\gamma\) are selected to form the final password set. ## 4 Experiment Design

This section contains three parts to evaluate the principles, data, and preparatory experiments. Password generation experiments are performed on the OMEN model and PassGAN model, and some of the features they exhibit are analyzed to better understand the comparison objects of the experiments in the evaluation experiments in the next section.