## 4 Proposed Model: REDPACK
### The Discriminator Training Structure  
Figure 2 shows a process to optimize the parameters of an RNN-based GAN. The RNN-based GAN is built upon a generator (\(G\)) and a discriminator (\(D\)). We employ an RNN as the base model of the GAN because passwords are a type of sequential data. As with a standard GAN [10], \(G\) is trained to generate fake passwords, but these are very similar to real passwords; \(D\) tries to distinguish real passwords from the fake passwords. However, our RNN-based GAN adopts the concept of both relativistic average GAN [13] and IWGAN [11] to achieve a more powerful discriminator. In Figure 2, \(G\) produces fake passwords from a given arbitrary noise distribution \(\mathbb{P}_{z}(z)\), which is depicted by a green path; following Equation (3), \(D\) determines the fake passwords as real if and only if the critic for the fake password is larger than the real one described as blue storage in the figure. Likewise, the real passwords on the blue path are regarded as real in the opposite case; \(D\) gives gradients as a penalty to encourage \(G\) to generate more authentic passwords, which is depicted by a red path. This learning framework forces \(D\) to achieve stronger judgment criteria than the standard GAN. Algorithm 1 summarizes the learning procedure for the above described RNN-based GAN. It mainly originates from IWGAN but uses the loss function of a relativistic average GAN. Most notations follow Equation (3). The primary differences are the loss function in lines 9 and 15. These loss functions depend on the relativistic discriminator, estimating the critic for one type of passwords over the average critic of the opposite type. This direct comparison allows \(G\) to quickly converge to an optimum point and produce high-quality fake passwords. Also, since our RNN-based GAN adopts IWGAN, we add the gradient penalty to the discriminator's loss function. This penalty forces a 2-norm of gradients for \(\hat{x}\) to be less than 1, where \(\hat{x}\) is a random sample on a straight line between the pair of points \((x_{r},x_{f})\). This gives great stability to the training of the GAN. Another important factor is the iteration for optimizing \(G\) from lines 13 to 16. Although most GANs have a loop for optimizing \(D\) on a given \(G\), this is insufficient to maximize the GAN's performance. Figure 1: Overview Diagram of REDPACK. So, we add the loop for training \(G\) to stabilize and enhance our GAN. According to our experiments, described in Section 5, this factor has a critical effect on the cracking performance of REDPACK. In general cases, once the model is optimized, the generator is used as a generative model. Instead, we utilize the discriminator as a genuine password estimator for REDPACK. ```
0: Gradient penalty coefficient \(\lambda\), number of critic iterations per generator \(n_{critic}\), number of generator iterations per discriminator \(n_{gen}\), batch size \(m\), and Adam hyper-parameters \(\alpha\), \(\beta_{1}\), and \(\beta_{2}\). Critic \(C\)'s parameters \(w\) and generator \(G\)'s parameter \(\theta\). Random samples \(\hat{x}\) on straight line between real passwords \(x_{r}\) and fake passwords \(x_{f}\). 1:while\(\theta\) has not converged do
2:for\(t=1,...,n_{critic}\)do
3:for\(i=1,...,m\)do
4: Sample real data \(x_{r}\sim\mathbb{P}_{data}\), latent variable \(z\sim\mathbb{P}_{z}\), and a random number \(\epsilon\sim\mathcal{U}[0,1]\).