Valid

GB/T 32915-2026Cybersecurity technology — Randomness test methods for binary sequences (English PDF)

网络安全技术 二元序列随机性检测方法

Preview PDF

This is a limited preview

Buy now to download the full PDF (42 pages)

Need quotation for your management?

Get a formal quotation for GB/T 32915-2026 in 30 minutes.

Issued by

SAMR; SAC

Level / Type

National · Recommended

Issue date

May 25, 2026

Implementation date

December 1, 2026

Scope

GB/T 32915-2026 is the English-translated version of 网络安全技术 二元序列随机性检测方法.

GB/T 32915-2026 describes the randomness test methods for binary sequences used in cybersecurity, covering the test objectives, test steps, parameter settings and result determination.

It specifies 15 test techniques, among them the monobit frequency test, the frequency test within a block, the poker test, the matrix rank test, the universal statistical test, the linear complexity test, the autocorrelation test and the cumulative sum test, and it defines the symbols for sample length, subsequence length and sample size.

It fixes how a sample group is judged: the sample pass rate, at a significance level of 0.01 and a sample size of 1 000, and the uniformity of the Q_value distribution over ten sub-intervals.

It has no normative references. It replaces GB/T 32915-2016, was issued on 25 May 2026 and applies from 1 December 2026.

Found what you need?

Document preview — GB/T 32915-2026

National Standard of the People's Republic of China

ICS
35.040
Classification
L 80
Replacing
GB/T 32915-2016

Issued by: State Administration for Market Regulation; Standardization Administration of the PRC

Contents

  • Foreword3
  • 1 Scope5
  • 2 Normative References5
  • 3 Terms and Definitions5
  • 4 Symbols6
  • 5 Randomness Test8
  • 6 Randomness Test Determination22
  • Appendix A (Normative) Sample Length and Test Settings25
  • Appendix B (Informative) Randomness Test Principle27
  • Appendix C (Informative) Examples of Randomness Test Results37
  • References42

1 Scope

This document describes the randomness test methods for binary sequence, covering the test objectives, test steps, parameter settings, and result determination.

This document is applicable to randomness tests of binary sequences in the field of cybersecurity.

2 Normative References

This document has no normative references.

3 Terms and Definitions

The following terms and definitions are applicable to this document.

3.1 Binary Sequence

A bit string composed of "0" and "1".

NOTE: It is abbreviated as "sequence".

3.2 Randomness Hypothesis

The hypothesis concerning the randomness of the binary sequence to be tested; the decision to accept or reject this hypothesis can be based on the randomness test results.

NOTE: This document assumes that the binary sequence to be tested is random; this is referred to as the null hypothesis.

3.3 Randomness Test

A function or procedure used for binary sequence tests, the result of which is used to determine whether to accept the null hypothesis.

3.4 Significance Level

The probability of incorrectly rejecting the null hypothesis in a randomness test when the null hypothesis is actually true.

3.5 Sample

A binary sequence used for randomness tests.

NOTE: It is also known as a "sequence to be tested".

3.6 Sample Group

A collection of multiple samples.

3.7 Sample Length

The number of bits per sample.

3.8 Sample Size

The number of samples in the sample group.

3.9 Test Parameter

The parameter that needs to be set for randomness tests.

3.10 Run

A subsequence within a sequence, consisting of consecutive "0" or "1", where both the preceding and succeeding elements differ from the elements of the subsequence itself.

4 Symbols

The following symbols are applicable to this document.

d: Number of bit positions for the logical left shift of the sequence in the autocorrelation test

K: Number of L-bit subsequences of the sequence to be tested in the universal statistical test

L: Length of the subsequence in the universal statistical test

Li: Linear complexity of the subsequence in the linear complexity test

M: Number of rows of the matrix in the matrix rank test

m: Bit length of the subsequence

N: Number of m-bit subsequences in an n-bit sequence to be tested

n: Bit length of the binary sequence to be tested

Q: Number of columns of the matrix in the matrix rank test, or the number of L-bit subsequences of the initial sequence in the universal statistical test

5 Randomness Test

5.1 General

This document specifies 15 test techniques for the randomness tests of binary sequences. Each technique is used to test for a specific characteristic property of a binary sequence, with distinct test steps and result determination methods for each.

The randomness tests of binary sequence samples shall comply with the requirements for sample length and test settings specified in Appendix A.

5.2 Monobit Frequency Test

5.2.1 Test objectives

The monobit frequency test is used to test whether a binary sequence exhibits a satisfactory balance between "0" and "1" - that is, whether the numbers of bits "0" and "1" are approximately equal. Test parameter requirements shall comply with the relevant provisions in Appendix A; the test principle is described in B.1 of Appendix B, and an example of the results is provided in C.1 of Appendix C.

5.2.2 Test steps

The steps for the monobit frequency test are as follows:

Step 1: Calculate, converting the "0" and "1" in the sequence to be tested epsilon into "-1" and "1", respectively.

Step 2: Calculate the cumulative sum to obtain.

Step 3: Calculate the statistical value.

Step 4: Calculate.

Step 5: Calculate.

5.2.3 Result determination

Compare the P_value result calculated in 5.2.2 with the significance level alpha. If P_value>=alpha, the binary sequence sample is considered to have passed the monobit frequency test; otherwise, it […]

6 Randomness Test Determination

6.1

A randomness test technique corresponds to at least one randomness test item; if a specific randomness test technique employs different test parameter settings, utilizes distinct test modes (such as the maximum run test within a block or the cumulative sum test), or involves multiple statistical values (such as the overlapping subsequence test), the corresponding aspects shall be tested as separate randomness test items; furthermore, the sample pass rate and distribution uniformity for each test item within the binary sequence sample group shall be evaluated individually to determine compliance. For instance, the cumulative sum test method comprises two modes: forward cumulative sum and backward cumulative sum. These two modes shall be tested as 2 independent test items; furthermore, the sample pass rates and distribution uniformity for the forward and backward cumulative sums within the binary sequence sample group shall be evaluated individually to determine compliance.

The sample size in the binary sequence sample group specified in this document is 1 000.

6.2 Determination of Sample Pass Rate

For each randomness test item defined in 6.1, count the number of samples within the binary sequence sample group that pass the test. Let s denote the sample size in the sample group. If the number of samples passing a specific test item is greater than or equal to, the binary sequence sample group is considered to have passed the test for that item; otherwise, it is considered to have failed.

The significance level alpha specified in this document for the sample pass rate test is 0.01. Based on the sample size and significance level specified in this document, the number of samples within the binary sequence sample group that pass each test item shall be greater than or equal to 981.

6.3 Determination of Sample Distribution Uniformity

For each randomness test item defined in 6.1, the Q_value values of the samples within the binary sequence sample group shall be uniformly distributed within the interval [0, 1]. Let s denote the sample size, and divide the interval [0, 1] into k equal sub-intervals. Count the actual number (Fi) of samples within the binary sequence sample group whose Q_value falls within each sub-interval, where 1<=i<=k. Using the chi2 distribution, compare Fi with the theoretical value s/k, calculate the statistical value, and calculate. When PT is greater than or equal to alphaT, the binary sequence sample group is considered to have passed the test for that item; otherwise, it is considered to have failed. This document specifies a significance level of alphaT=0.000 1 and a number of sub-intervals of k=10 for the sample distribution uniformity test.

6.4 Comprehensive Determination

The binary sequence sample group passes the randomness test specified in this document if and […]

Appendix B (Informative) Randomness Test Principle

B.1 Monobit Frequency Test

The monobit frequency test is the most fundamental test; it is used to test whether the numbers of "0" and "1" in a binary sequence are approximately equal. Given a binary sequence of length n, let n0 and n1 denote the numbers of "0" and "1" in the sequence, respectively. For a random sequence, when the length is sufficiently large, the statistical value follows a standard normal distribution.

B.2 Frequency Test within a Block

The frequency test within a block is used to test whether the number of "1" in an m-bit subsequence of the sequence to be tested is close to m/2. For a random sequence, the number of "1" in any m-bit subsequence shall be close to m/2.

The frequency test within a block divides the sequence to be tested into N subsequences, each of length m, such that n=Nm. Of course, if n is not divisible by m, there will inevitably be redundant bits; in this case, the redundant bits are discarded. Calculate the proportion of "1" in each subsequence and denote it as. Taking the cumulative sum of the proportions of "1" across all N subsequences as the statistical value, the statistical value follows a chi2 distribution with N degrees of freedom.

B.3 Poker Test

For any positive integer m, there are 2m types of binary sequences of length m. Divide the sequence to be tested into N non-overlapping subsequences of length m, and let represent the number of subsequences of the ith type. The poker test is used to test whether the numbers of subsequences of the 2m types are approximately equal.

The statistical value follows a chi2 distribution with 2m-1 degrees of freedom. […]

......
This preview omits tables, figures, formulas and parts of the technical clauses. The complete document — 42 pages — is available in the English PDF.

Referenced standards

Cited by

Editions of GB/T 32915

EditionTitleRevisionStatus
GB/T 32915-2026Cybersecurity technology — Randomness test methods for binary sequencescurrent editionCurrent
GB/T 32915-2016Cybersecurity technology — Randomness test methods for binary sequencesprevious editionIn force until 1 December 2026

This page sells the current edition, GB/T 32915-2026. Earlier editions are listed for reference only.

How to Download GB/T 32915-2026

  1. 1

    Add to cart

    Click "Download PDF" on this page and choose "Buy this standard". You can add more standards before checkout.

  2. 2

    Checkout

    Enter your email and billing details. Payment is processed securely by Stripe (cards or bank transfer). Prefer bank details? Request a quotation (min. order $300).

  3. 3

    Instant delivery (0–9 sec)

    Delivery is automatic: within seconds of payment you'll receive an email with a secure download link. The link stays valid for 72 hours.

  4. 4

    Invoice included

    A tax invoice is attached to the confirmation email. Need a custom invoice? Contact us.

Related Standards

English PDF
42 pages
Instant delivery (0–9 sec)
Invoice included
View Cart

Secure payment via Stripe

Payments accepted

VisaMastercardAmerican ExpressApple PayGoogle PayStripe

GB/T 32915-2026

$480.00