# Optimized Implementation of Argon2 Utilizing the Graphics Processing Unit
## 5 Conclusions  
In this study, we proposed a new implementation technique for Argon2 that leverages GPU for both the 'init' and 'fill memory blocks' stages, aiming to efficiently handle multiple passwords. This implementation significantly reduces the amount of data transferred from CPU to GPU, consequently decreasing the overall delay in data transfer. By shifting the processing of the 'h2' process from CPU to GPU, we further reduced the data transfer cost. The proposed method capitalizes on the GPU's shared memory, which offers faster memory access, optimizing the computation of the 'h2' process. The repeated hashing process needed to generate the required memory block can be executed more efficiently on the GPU. The proposed approach also takes advantage of GPU's parallel processing capabilities for an efficient execution of brute-force attacks. By performing the H function computation on the GPU, initial blocks for multiple inputs can be generated in a single operation, resulting in a more efficient implementation of the 'init' stage in Argon2. Through rigorous evaluation, we found that, as the number of passwords to be processed concurrently increased, the proposed method exhibited enhanced performance. Even though the computation time in the kernel increased, the proposed technique reduced the overall time by decreasing the significant delay factor (i.e., the data transfer time between the CPU and GPU). Overall, the proposed implementation demonstrated a more efficient execution time compared to the existing one, particularly when processing a larger number of passwords and at higher levels of parallelism. A more efficient execution time means more hash operations can be carried out in the same amount of time. This can be expected to reduce the cost of cracking attacks by showing less energy consumption when performing the same hash \begin{table}
\begin{tabular}{c c c c c c} \hline
**PWD Num** & **Writing (ms)** & **Computation (ms)** & **Reading (ms)** & **Total (ms)** & **Time/Num** \\ \hline
4096 & 306.64/156.27 & 26.21/33.56 & 149.90/141.93 & 482.75/331.76 & 0.118/0.081 \\ \hline
2048 & 157.82/87.29 & 13.29/17.83 & 72.71/68.76 & 243.81/173.87 & 0.119/0.085 \\ \hline
1024 & 77.60/44.14 & 6.81/11.12 & 37.96/36.17 & 122.37/91.43 & 0.120/0.089 \\ \hline
512 & 38.20/23.95 & 3.58/7.38 & 18.45/18.42 & 60.22/49.75 & 0.118/0.097 \\ \hline
256 & 20.67/13.35 & 1.99/5.72 & 9.15/9.51 & 31.81/28.58 & 0.124/0.112 \\ \hline
128 & 9.95/8.26 & 1.01/4.69 & 4.74/4.83 & 15.69/17.78 & 0.123/0.139 \\ \hline
64 & 4.77/6.04 & 714.70/4.36 & 2.12/2.33 & 721.59/12.72 & 11.275/0.199 \\ \hline
32 & 3.60/4.83 & 606.70/4.16 & 1.12/1.28 & 611.42/10.27 & 19.107/0.321 \\ \hline \end{tabular}
\end{table} 
Table 10: Comparison of the performance of the implementation with that of the previous implementation at levels of parallelism (p) of 4 for Argon2d versions (Ours/Mosnácek). \begin{table}
\begin{tabular}{c c c c c c} \hline
**PWD Num** & **Writing (ms)** & **Computation (ms)** & **Reading (ms)** & **Total (ms)** & **Time/Num** \\ \hline
4096 & 206.03/160.76 & 26.62/30.38 & 142.46/136.48 & 375.11/327.62 & 0.092/0.080 \\ \hline
2048 & 100.22/83.14 & 13.57/16.04 & 76.18/69.55 & 189.97/168.72 & 0.093/0.082 \\ \hline
1024 & 53.23/42.41 & 7.01/9.39 & 38.72/38.31 & 98.95/90.11 & 0.097/0.088 \\ \hline
512 & 27.11/21.50 & 3.96/5.86 & 18.84/19.85 & 49.91/47.21 & 0.097/0.092 \\ \hline
256 & 13.27/11.82 & 1.86/3.83 & 9.73/9.24 & 24.86/24.89 & 0.097/0.097 \\ \hline
128 & 6.40/6.83 & 1.24/3.18 & 4.97/4.65 & 12.61/14.66 & 0.099/0.115 \\ \hline
64 & 4.14/4.27 & 1.09/2.96 & 3.29/2.51 & 8.51/9.75 & 0.133/0.152 \\ \hline
32 & 1.58/3.17 & 927.20/2.80 & 1.30/1.36 & 930.08/7.32 & 29.065/0.229 \\ \hline \end{tabular}
\end{table} 
Table 9: Comparison of the performance of the implementation with that of the previous implementation at levels of parallelism (p) of 2 for Argon2d versions (Ours/Mosnácek). operation.