# An Intrusion Resistant SCADA Framework Based on Quantum and Post-Quantum Scheme
## 6 Results
### Results Obtained in the Signature Generation Phase
#### 6.3.2 Comparative Analysis of SPHINCS-QRNG and SPHINCS-Chacha12 Based on Randomness  
To test the randomness of the quantum random number generator (QRNG), we used all 15 tests of the NIST statistical test suite and, the QRNG passed all of them in every simulation. Thus, we conclude that QRNG is truly random. Table 7 displays the \(p\)-values of random number generated by QRNG used in SPHINCS-256. As the \(p\)-values \(\geq\) 0.01, the NIST tool concludes the sequence to be random with a confidence of 99%. Figures 17 and 18 display the results of Random Excursions Test and Random Excursions Variant Test, respectively for _SPHINCS-QRNG_. The Random Excursions test executes sub-tests on each of the following states; \(-4\), \(-3\), \(-2\), \(-1\), \(+1\), \(+2\), \(+3\) and \(+4\), to check the frequency of visits to a cumulative sums state within a cycle of a random walk matches with that one would expect for random sequence [55]. For a certain state, if the \(p\)-value \(\geq\) 0.01, the sequence is random. For example, in Figure 17, the \(p\)-value of QRN 1 with state \(+1\) is approximately 0.8492. Thus, the sequence at state \(+1\) is random. Figure 16: Execution Time for SPHINCS-Chacha12 vs. SPHINCS-QRNG \begin{table}
\begin{tabular}{l c c c c c} \hline \hline \(p\)**-Values of QRNG Used in SPHINCS-256** & **QRN 1** & **QRN 2** & **QRN 3** & **QRN 4** & **QRN 5** \\ \hline Frequency Test (Monobit) & 0.852444761 & 0.011735483 & 0.149302374 & 0.406538784 & 0.649828827 \\ \hline Frequency Test within a Block & 0.161769992 & 0.733286939 & 0.575099934 & 0.665007898 & 0.518616736 \\ \hline Run Test & 0.217961992 & 0.827155028 & 0.32712429 & 0.732869216 & 0.924945411 \\ \hline Longest Run of Ones in a Block & 0.513396784 & 0.969974739 & 0.637115311 & 0.248794857 & 0.913444629 \\ \hline Binary Matrix Rank Test & 0.262333935 & 0.822162028 & 0.862431288 & 0.111413103 & 0.071873969 \\ \hline Discrete Fourier Transform (Spectral) Test & 0.142033423 & 0.011616891 & 0.157596656 & 0.776045999 & 0.613759295 \\ \hline Non-Overlapping Template Matching Test & 0.63600041 & 0.504047187 & 0.415637608 & 0.169519974 & 0.262129471 \\ \hline Overlapping Template Matching Test & 0.200756533 & 0.505736739 & 0.353171054 & 0.591057811 & 0.508073676 \\ \hline Maurer’s Universal Statistical test & 0.124605474 & 0.243079644 & 0.01674513 & 0.73273627 & 0.889955415 \\ \hline Linear Complexity Test & 0.8575379 & 0.547314553 & 0.126281648 & 0.190952376 & 0.371943788 \\ \hline Serial test 1 & 0.667804599 & 0.9238906 & 0.773287042 & 0.949470145 & 0.285436568 \\ \hline Serial test 2 & 0.691057349 & 0.953760341 & 0.7814567 & 0.920487151 & 0.576467535 \\ \hline Approximate Entropy Test & 0.569869981 & 0.89057965 & 0.092335008 & 0.350697922 & 0.18177552 \\ \hline Cumulative Sums (Forward) Test & 0.800359989 & 0.013619809 & 0.215229911 & 0.508140027 & 0.69796035 \\ \hline Cumulative Sums (Reverse) Test & 0.943118012 & 0.018863213 & 0.268772338 & 0.771928763 & 0.764505358 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: \(p\)-values of appropriate NIST Statistical Tests for Random and PRNG applied on Quantum Random Number Generator(QRNG) used in SPHINCS-256. Figure 17: Results of Random Excursions Test on Quantum Random Number Generator(QRNG) used in SPHINCS-256. The Random Excursions Variant test verifies whether the number of visits to a particular state in a cumulative sum random walk deviates from the expected number of visits in the random walk. It considers 18 states consisting of \(\{-9,-8,\ldots,+8,+9\}\) and, if the \(p\)-value of a particular state is greater than or equal to 0.01, that means the sequence is random. However, when we ran all 15 tests on a random number generated by _SPHINCS-Chacha12_, it does not pass 100% of the NIST statistical tests. The pseudo-random number, PRN 5, generated by Chacha-12, failed the Maurer's Universal Statistical test. Also, PRN 1 and PRN 5 does not pass the Random Excursions Test and Random Excursions Variant Test with all states.