Springer Nature is making SARS-CoV-2 and COVID-19 research free. View research | View latest news | Sign up for updates

A new discrete Fourier transform randomness test


The randomness of random number generators (RNGs) is important for the reliability of cryptographic systems since the outputs of RNGs are usually utilized to construct cryptographic parameters. Statistical tests are employed to evaluate the randomness of the RNG outputs. The discrete Fourier transform (DFT) test is an important test item of the most popular statistical test suite NIST SP800-22. In the standard NIST DFT test and related improved studies, there exist accuracy and efficiency issues. First, the bit sequences generated by known good RNGs have a high probability to be rejected when the sequences are long or the sequence number is large, due to the deviation between the actual distribution of the test statistic values and the assumed normal distribution. Second, the long test time and high memory consumptions of the complex DFT test algorithm also affect its practicability. To solve these problems, we propose a new DFT test method for long sequences (106 or more bits). Different from the previous DFT test methods focusing on making the distribution of the test statistic values closer to the normal distribution, we reconstruct the statistic to follow the chi-square distribution. Our experiment result shows that our method has higher reliability in the two-level test, and could effectively reduce the test time and the memory consumptions. When applying our method on randomness test, the test efficiency has been increased to about 4 times for 106-bit sequences and 7 times for 107-bit sequences. In conclusion, our method has lower probability of making errors, and is more suitable for practical application scenarios.

This is a preview of subscription content, log in to check access.


  1. 1

    Sowmya S, Sathyanarayana S V. Symmetric key image encryption scheme with key sequences derived from random sequence of cyclic elliptic curve points over GF(p). In: Proceedings of International Conference on Contemporary Computing and Informatics, 2015. 1345–1350

  2. 2

    Sulak F, Doğanaksoy A, Ege B, et al. Evaluation of randomness test results for short sequences. In: Proceedings of the 6th International Conference on Sequences and Their Applications, 2010

  3. 3

    Hellekalek P, Wegenkittl S. Empirical evidence concerning AES. ACM Trans Model Comput Simul, 2003, 13: 322–333

  4. 4

    Yin R M, Wang J, Yuan J, et al. Weak key analysis for chaotic cipher based on randomness properties. Sci China Inf Sci, 2012, 55: 1162–1171

  5. 5

    Rukhin A, Soto J, Nechvatal J, et al. SP 800–22 Rev. 1a. A statistical test suite for random and pseudorandom number generators for cryptographic applications. Appl Phys Lett, 2010, 22: 1645–179

  6. 6

    Pareschi F, Rovatti R, Setti G. On statistical tests for randomness included in the NIST SP800-22 test suite and based on the binomial distribution. IEEE Trans Inform Forensic Secur, 2012, 7: 491–505

  7. 7

    Pareschi F, Rovatti R, Setti G. Second-level NIST randomness tests for improving test reliability. In: Proceedings of IEEE International Symposium on Circuits and Systems, 2007. 1437–1440

  8. 8

    Hamano K, Kaneko T. Correction of overlapping template matching test included in NIST randomness test suite. IEICE Trans Fund Electron Commun Comput Sci, 2007, 90: 1788–1792

  9. 9

    Hamano K. Correction of “test for the longest run of ones in a block” included in NIST randomness test suite. IEICE Tech Rep, 2007, 107: 17–21

  10. 10

    Chen M H, Fan L M, Gao S, et al. Corrected runs distribution test for pseudorandom number generators. Electron Lett, 2016, 52: 281–283

  11. 11

    Chen M H, Chen H, Fan L M, et al. Templates selection in non-overlapping template matching test. Electron Lett, 2016, 52: 1533–1535

  12. 12

    Sýs M, Říha Z, Matyáš V. Algorithm 970: optimizing the NIST statistical test suite and the berlekamp-massey algorithm. ACM Trans Math Softw, 2017, 43: 27

  13. 13

    Huang J L, Lai X J. Measuring random tests by conditional entropy and optimal execution order. In: Proceedings of International Conference on Trusted Systems, 2010. 148–159

  14. 14

    Fan L M, Chen H, Gao S. A general method to evaluate the correlation of randomness tests. In: Proceedings of International Workshop on Information Security Applications, 2013. 52–62

  15. 15

    Sulak F, Uğuz M, Koçak O, et al. On the independence of statistical randomness tests included in the NIST test suite. Turk J Electric Eng Comput Sci, 2017, 25: 3673–3683

  16. 16

    Pareschi F, Rovatti R, Setti G. Second-level testing revisited and applications to NIST SP800-22. In: Proceedings of the 18th European Conference on Circuit Theory and Design, 2007. 627–630

  17. 17

    Zhu S Y, Ma Y, Lin J Q, et al. More powerful and reliable second-level statistical randomness tests for NIST SP 800–22. In: Proceedings of International Conference on the Theory and Application of Cryptology and Information Security, 2016

  18. 18

    Hamano K, Satoh F, Ishikawa M. Randomness Test Using Discrete Fourier Transform. Technical Report 6841, 2003

  19. 19

    Hamano K. The distribution of the spectrum for the discrete Fourier transform test included in SP800-22. IEICE Trans Fund Electron Commun Comput Sci, 2005, 88: 67–73

  20. 20

    Kim S J, Umeno K, Hasegawa A. Corrections of the NIST statistical test suite for randomness. 2004.

  21. 21

    Daemen J, Rijmen V. The Design of Rijndael: AES–the Advanced Encryption Standard. Berlin: Springer, 2002

  22. 22

    U.S. Department of Commerce. Secure Hash Standard - SHS: Federal Information Processing Standards Publication 180–4. Charlestone: CreateSpace Independent Publishing Platform, 2012

Download references


This work was supported by National Key R&D Program of China (Grant No. 2018YFB- 0904900), National Cryptography Development Fund (Grant Nos. MMJJ20170214, MMJJ20170211).

Author information

Correspondence to Limin Fan.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Chen, M., Chen, H., Fan, L. et al. A new discrete Fourier transform randomness test. Sci. China Inf. Sci. 62, 32107 (2019).

Download citation


  • statistical randomness test
  • discrete Fourier transform test
  • NIST SP800-22
  • two-level test
  • chi-square distribution