Codeofchina.com is in charge of this English translation. In case of any doubt about the English translation, the Chinese original shall be considered authoritative.
This standard is developed in accordance with the rules given in GB/T 1.1-2009.
Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. The issuing body of this document shall not be held responsible for identifying any or all such patent rights.
This standard was proposed by and is under the jurisdiction of the Cryptography Standardization Technical Committee.
Introduction
Random numbers play an extremely important role in cryptographic application. For example, the keys in cryptographic algorithms shall be random numbers, and random numbers are also required in intermediate processes of many cryptographic protocols.
A random number generator refers to a dedicated integrated device that generates a random number or a random number generation part in a device.
When a random number generator is used to generate a random number, the quality of the random number plays a key role in ensuring the security of the entire system. For the purpose of this standard, the cryptographic modules are classified into Categories A, B, C, D and E for the random number test. The random number test for each category includes four different application phases, i.e., sample test, delivery test, power on test and running test, and random number test requirements are put forward for all application phases of each category.
Random number test requirements for cryptographic modules
1 Scope
This standard specifies test indexes and requirements for the randomness of generating a random number using a random number generator through hardware in application of cryptographic modules.
This standard is applicable to the test of the random number generator, and can also provide guidance for the development of the random number generator.
2 Normative references
The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.
GB/T 32915 Information security technology - Randomness test methods for binary sequence
3 Terms, definitions and symbols
3.1 Terms and definitions
For the purposes of this document, the terms and definitions established in GB/T 32915 and the following apply.
3.1.1
sample test
randomness test for the cryptographic modules that the manufacturer's sample is submitted to a third-party testing organization for test
3.1.2
delivery test
random number function and quality test for the cryptographic modules, which is performed by the manufacturer before their delivery
3.1.3
power on test
random number function test for the cryptographic modules that is automatically performed at power-on
3.1.4
running test
random number function test for the cryptographic modules that is automatically performed during their operation, which is classified into cyclical test and single test
3.1.5
cyclical test
random number function test for the cryptographic modules that is automatically performed at a certain time interval during their operation
3.1.6
single test
random number function test for the cryptographic modules that is automatically performed before use of the random number each time during their operation
3.2 Symbols
For the purposes of this document, the following symbols apply.
α—significance level
m—block length of poker test
4 Description of random number test
4.1 Classification of cryptographic modules
For the purpose of this standard, the cryptographic modules are classified into Categories A, B, C, D and E for the random number test, with respective main features and typical forms.
For Category A cryptographic modules, they cannot be used independently as functional products; their typical forms include random number generator chip, etc.
For Category B cryptographic modules, they are powered on when used, and they have limited processing capacity in the random number test and have strict requirements for power on response speed; their typical forms include IC card, etc.
For Category C cryptographic modules, they are powered on when used, and they have limited processing capacity in the random number test and have no strict requirements for power on response speed; their typical forms include USBKey, etc.
For Category D cryptographic modules, they are powered on for a long term, and they have limited processing capacity in the random number test and have no strict requirements for power on response speed; their typical forms include POS machine, etc.
For Category E cryptographic modules, they are powered on for a long term, and they have relatively strong processing capacity in the random number test, and have no requirements for power on response speed; their typical forms include server, etc.
In addition, this standard put forwards random number test requirements for each category.
4.2 Division of application stages
For the purpose of this standard, four different application stages are divided for the random number test, i.e., sample test, delivery test, power on test, and running test.
For the above four application stages, this standard specifies corresponding random number test methods.
4.3 Data format
To-be-tested data shall be tested in the form of binary sequence.
4.4 Test items
For the purpose of this standard, the randomness test items involve 15 items specified in GB/T 32915, i.e., monobit frequency test, frequency test within a block, poker test, serial test, runs test, runs distribution test, test for the longest run of ones in a block, binary derivative test, autocorrelation test, binary matrix rank test, cumulative test, approximate entropy test, linear complexity test, universal test, and discrete fourier transform test.
Foreword i
Introduction ii
1 Scope
2 Normative references
3 Terms, definitions and symbols
3.1 Terms and definitions
3.2 Symbols
4 Description of random number test
4.1 Classification of cryptographic modules
4.2 Division of application stages
4.3 Data format
4.4 Test items
4.5 Significance level
4.6 Setting of parameters
5 Random number test for Category A cryptographic modules
5.1 Sample test
5.2 Delivery test
5.3 Power on test
5.4 Running test
6 Random number test for Category B cryptographic modules
6.1 Sample test
6.2 Delivery test
6.3 Power on test
6.4 Running test
7 Random number test for Category C cryptographic modules
7.1 Sample test
7.2 Delivery test
7.3 Power on test
7.4 Running test
8 Random number test for Category D cryptographic modules
8.1 Sample test
8.2 Delivery test
8.3 Power on test
8.4 Running test
9 Random number test for Category E cryptographic modules
9.1 Sample test
9.2 Delivery test
9.3 Power on test
9.4 Running test
ICS 35.040
L 80
備案號:62997—2018
GM
中華人民共和國密碼行業(yè)標準
GM/T 0062—2018
密碼產品隨機數檢測要求
Random number test requirements for cryptographic modules
2018-05-02發(fā)布 2018-05-02實施
國家密碼管理局 發(fā)布
前言
本標準按照GB/T 1.1—2009給出的規(guī)則起草。
請注意本文件的某些內容可能涉及專利。本文件的發(fā)布機構不承擔識別這些專利的責任。
本標準由密碼行業(yè)標準化技術委員會提出并歸口。
引言
隨機數在密碼應用中發(fā)揮著極其重要的作用,例如密碼算法里的密鑰要求是隨機數,另外許多密碼協(xié)議的中間過程也需要隨機數。
隨機數發(fā)生器是指產生隨機數的專用集成器件或者器件中的隨機數生成部件。
使用隨機數發(fā)生器產生隨機數時,隨機數的好壞對于保障整個系統(tǒng)的安全性舉足輕重。本標準將隨機數檢測劃分為A類、B類、C類、D類和E類五個不同產品形態(tài),對每個產品形態(tài)的隨機數檢測劃分為送樣檢測、出廠檢測、上電檢測、使用檢測四個不同應用階段,并對每種產品形態(tài)的各應用階段提出了隨機數檢測要求。
密碼產品隨機數檢測要求
1 范圍
本標準規(guī)定了密碼產品應用中,硬件實現隨機數發(fā)生器產生隨機數的隨機性檢測指標和檢測要求。
本標準適用于隨機數發(fā)生器的檢測,亦可指導隨機數發(fā)生器的研制。
2 規(guī)范性引用文件
下列文件對于本文件的應用是必不可少的。凡是注日期的引用文件,僅注日期的版本適用于本文件。凡是不注日期的引用文件,其最新版本(包括所有的修改單)適用于本文件。
GB/T 32915 信息安全技術 二元序列隨機性檢測方法
3 術語、定義和符號
3.1 術語和定義
GB/T 32915界定的以及下列術語和定義適用于本文件。
3.1.1
送樣檢測 sample test
廠商產品樣本交由第三方檢測機構進行的產品隨機性檢測。
3.1.2
出廠檢測 delivery test
由廠家在產品出廠前進行的產品隨機數功能和質量檢測。
3.1.3
上電檢測 power on test
產品加電時自動進行的隨機數功能檢測。
3.1.4
使用檢測 running test
產品工作過程中自動進行的隨機數功能檢測,使用檢測分為周期檢測和單次檢測。
3.1.5
周期檢測 cyclical test
產品工作過程中按照一定的時間間隔自動進行的隨機數功能檢測。
3.1.6
單次檢測 single test
產品工作過程中隨機數每次使用前自動進行的隨機數功能檢測。
3.2 符號
下列符號適用于本文件。
α 顯著性水平
m 撲克檢測的分組長度
4 隨機數檢測說明
4.1 產品形態(tài)劃分
本標準將隨機數檢測劃分為A類、B類、C類、D類和E類五個不同產品形態(tài)類別。
A類產品的主要特征為不能獨立作為功能產品使用;典型產品形態(tài)為隨機數發(fā)生器芯片等。
B類產品的主要特征為用時上電,隨機數檢測處理能力有限,對上電響應速度有嚴格要求;典型產品形態(tài)為IC卡等。
C類產品的主要特征為用時上電,隨機數檢測處理能力有限,對上電響應速度沒有嚴格要求;典型產品形態(tài)為USBKey等。
D類產品的主要特征為長期加電,隨機數檢測處理能力有限,對上電響應速度沒有嚴格要求;典型產品形態(tài)為POS機等。
E類產品的主要特征為長期加電,具有較強的隨機數檢測處理能力,對上電響應速度沒有要求;典型產品形態(tài)為服務器等。
本標準對每種產品形態(tài)提出了隨機數檢測要求。
4.2 應用階段劃分
本標準將隨機數檢測劃分為送樣檢測、出廠檢測、上電檢測、使用檢測四個不同應用階段。
對上述四個應用階段,本標準規(guī)范了相應的隨機數檢測方法。
4.3 數據格式
待檢的數據以二元序列的形式接受檢測。
4.4 檢測項目
本標準采用的隨機性檢測項目涉及GB/T 32915規(guī)定的15項,分別為單比特頻數檢測、塊內頻數檢測、撲克檢測、重疊子序列檢測、游程總數檢測、游程分布檢測、塊內最大游程檢測、二元推導檢測、自相關檢測、矩陣秩檢測、累加和檢測、近似熵檢測、線性復雜度檢測、通用統(tǒng)計檢測、離散傅立葉檢測。
4.5 顯著性水平
本標準采用的顯著性水平為α=0.01。
4.6 參數設置
本標準針對不同產品形態(tài)的不同應用階段,接受檢測的二元序列的長度不同。
5 A類產品隨機數檢測
5.1 送樣檢測
依據GB/T 32915進行隨機數檢測。
5.2 出廠檢測
隨機數出廠檢測包括以下要求:
a) 檢測量:采集1 000×106比特隨機數,分成1 000組,每組106比特。
b) 檢測項目:依據GB/T 32915中規(guī)定的檢測項進行檢測。
c) 檢測判斷標準:單項檢測如果20組或者20組以上不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。
5.3 上電檢測
本標準不做要求。
5.4 使用檢測
5.4.1 周期檢測
本標準不做要求。
5.4.2 單次檢測
本標準不做要求。
6 B類產品隨機數檢測
6.1 送樣檢測
依據GB/T 32915進行隨機數檢測。
6.2 出廠檢測
隨機數出廠檢測包括以下要求:
a) 檢測量:樣本長度不應低于128比特。
b) 檢測項目:單比特頻數檢測或者撲克檢測。撲克檢測參數m=2。
c) 檢測判斷標準:被測序列如果不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。
6.3 上電檢測
本標準不做要求。
6.4 使用檢測
6.4.1 周期檢測
本標準不做要求。
6.4.2 單次檢測
隨機數使用單次檢測包括以下要求:
a) 檢測量:根據實際應用時每次所采隨機數大小確定,但長度不應低于128比特,且已通過檢測的未用序列可繼續(xù)用。
b) 檢測項目:撲克檢測,參數m=2。
c) 檢測判斷標準:被測序列如果不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。
7 C類產品隨機數檢測
7.1 送樣檢測
依據GB/T 32915進行隨機數檢測。
7.2 出廠檢測
隨機數出廠檢測包括以下要求:
a) 檢測量:樣本長度不應低于256比特。
b)檢測項目:單比特頻數檢測或者撲克檢測。撲克檢測參數m=2。
c) 檢測判斷標準:被測序列如果不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。
7.3 上電檢測
隨機數上電檢測包括以下要求:
a) 檢測量:樣本長度不應低于256比特。
b) 檢測項目:撲克檢測,參數m=2。
c) 檢測判斷標準:被測序列如果不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。
7.4 使用檢測
7.4.1 周期檢測
本標準不做要求。
7.4.2 單次檢測
隨機數使用單次檢測包括以下要求:
a) 檢測量:根據實際應用時每次所采隨機數大小確定,但長度不應低于256比特,且已通過檢測的未用序列繼續(xù)使用。
b) 檢測項目:撲克檢測,參數m=2。
c) 檢測判斷標準:被測序列如果不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。
8 D類產品隨機數檢測
8.1 送樣檢測
依據GB/T 32915進行隨機數檢測。
8.2 出廠檢測
隨機數出廠檢測包括以下要求:
a) 檢測量:樣本長度不應低于256比特。
b) 檢測項目:單比特頻數檢測或者撲克檢測。撲克檢測參數m=2。
c) 檢測判斷標準:被測序列如果不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。
8.3 上電檢測
隨機數上電檢測包括以下要求:
a) 檢測量:采集20×104比特隨機數,分成20組,每組104比特。
b) 檢測項目:撲克檢測,參數m=2。
c) 檢測判斷標準:被測序列如果2組或者2組以上不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。
8.4 使用檢測
8.4.1 周期檢測
隨機數使用周期檢測包括以下要求:
a) 檢測量:采集5×104比特隨機數,分成5組,每組104比特。
b) 檢測項目:撲克檢測,參數m=2。
c) 檢測判斷標準:被測序列如果1組或者1組以上不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。
d) 檢測周期:可配置,建議檢測間隔最長不超過24 h。
8.4.2 單次檢測
隨機數使用單次檢測包括以下要求:
a) 檢測量:根據實際應用時每次所采隨機數大小確定,但長度不應低于256比特,且已通過檢測的未用序列可繼續(xù)用。
b) 檢測項目:撲克檢測,參數m=2。
c) 檢測判斷標準:被測序列如果不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。
9 E類產品隨機數檢測
9.1 送樣檢測
依據GB/T 32915進行隨機數檢測。
9.2 出廠檢測
隨機數出廠檢測包括以下要求:
a) 檢測量:采集50×106比特隨機數,分成50組,每組106比特。
b) 檢測項目:依據GB/T 32915中規(guī)定的檢測項進行檢測。
c) 檢測判斷標準:單項檢測如果3組或者3組以上不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。
9.3 上電檢測
隨機數上電檢測包括以下要求:
a) 檢測量:采集20×106比特隨機數,分成20組,每組106比特。
b) 檢測項目:依據GB/T 32915中規(guī)定的檢測項進行檢測。
c) 檢測判斷標準:單項檢測如果2組或者2組以上不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。
9.4 使用檢測
9.4.1 周期檢測
隨機數使用周期檢測包括以下要求:
a) 檢測量:采集4×105比特隨機數,分成20組,每組2×104比特。
b) 檢測項目:對采集隨機數按照GB/T 32915中除離散傅立葉檢測、線性復雜度檢測、通用統(tǒng)計檢測外的12項項目檢測。
c) 檢測判斷標準:單項檢測如果2組或者2組以上不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。
d) 檢測周期:可配置,檢測間隔最長不超過12 h。
9.4.2 單次檢測
隨機數使用單次檢測包括以下要求:
a) 檢測量:根據實際應用時每次所采隨機數大小確定,但長度不應低于256比特,且已通過檢測的未用序列可繼續(xù)用。
b) 檢測項目:撲克檢測,參數m=2。
c) 檢測判斷標準:被測序列如果不通過檢測標準,則告警檢測不合格。允許重復1次隨機數采集與檢測,如果重復檢測仍不合格,則判定為產品的隨機數發(fā)生器失效。