CN105162579A - Lightweight stream cipher LSNRR based on non-linear cyclic shift register - Google Patents
Lightweight stream cipher LSNRR based on non-linear cyclic shift register Download PDFInfo
- Publication number
- CN105162579A CN105162579A CN201510348756.XA CN201510348756A CN105162579A CN 105162579 A CN105162579 A CN 105162579A CN 201510348756 A CN201510348756 A CN 201510348756A CN 105162579 A CN105162579 A CN 105162579A
- Authority
- CN
- China
- Prior art keywords
- nrr
- lsnrr
- key
- word
- stream
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Storage Device Security (AREA)
Abstract
移位寄存器是保密通信领域用于产生伪随机序列的密码部件,有线性反馈移位寄存器LFSR和非线性反馈移位寄存器NLFSR等,其最大周期T≤2n。n级非线性循环移位寄存器NRR的反馈模式为:<maths num="0001"></maths>上式中,i≥0,n≥2,字长m取平台的位数;<<<j表示循环左移j位;表示模加;c为1~2m-1之间的奇数;输入的n个字初值a0~an-1都不限,每字都是任意m位数。字长为m比特时,n级NRR的周期大于(2m)n,即安全性高于传统的(N)LFSR;NRR效率也高于常用的(N)LFSR。采用4个NRR设计了一种轻量级流密码LSNRR,其中第1个NRR用于密钥编排,另3个NRR的输出进行模加产生LSNRR的密钥流。LSNRR的效率高于常用普通对称密码,资源受限不受限的环境都适用,主要用于数据加解密。
Shift registers are cryptographic components used to generate pseudo-random sequences in the field of secure communications. There are linear feedback shift registers LFSR and nonlinear feedback shift registers NLFSR, etc., and their maximum period T≤2 n . The feedback mode of n-level nonlinear cyclic shift register NRR is: <maths num="0001"> </maths> In the above formula, i≥0, n≥2, and the word length m is the number of digits of the platform; <<<j means that the cycle is shifted to the left by j bits; Indicates modulo addition; c is an odd number between 1 and 2 m -1; the initial value of the input n words a 0 to a n-1 is not limited, and each word has any m digits. When the word length is m bits, the period of n-level NRR is larger than (2 m ) n , that is, the security is higher than that of traditional (N)LFSR; the efficiency of NRR is also higher than that of commonly used (N)LFSR. A lightweight stream cipher LSNRR is designed using 4 NRRs, in which the first NRR is used for key arrangement, and the outputs of the other 3 NRRs are modulo-added to generate the key stream of LSNRR. The efficiency of LSNRR is higher than that of commonly used symmetric ciphers, and it is suitable for environments with limited or unlimited resources, and is mainly used for data encryption and decryption.
Description
技术领域technical field
基于非线性循环移位寄存器NRR的轻量级流密码LSNRR是保密通信领域的一种对称密码,主要用于网络与信息系统安全中的数据加解密,适合资源不受限的终端与资源受限终端互通。The lightweight stream cipher LSNRR based on the nonlinear cyclic shift register NRR is a symmetric cipher in the field of secure communication. It is mainly used for data encryption and decryption in network and information system security, and is suitable for terminals with unlimited resources and limited resources. Terminal interworking.
背景技术Background technique
密码技术分为对称密码和非对称密码。由于非对称密码的加密速度远小于对称密码,因此网络与信息系统安全中的数据加解密尽量采用对称密码,以提高效率。对称密码分为流密码和分组密码,2种对称密码各有优缺点。设计流密码的一种常用密码部件是移位寄存器,有线性反馈移位寄存器LFSR[1]和非线性反馈移位寄存器NLFSR[2]等,以下合称(N)LFSR。例如,第2代移动通信系统GSM的加密标准A5算法[3,4]、蓝牙加密标准E0算法[4]和流密码国际标准SNOW2算法[3]都采用了LFSR;Hash函数标准SHA1和SHA2的消息扩展算法[3]以及第3代标准SHA3的多个候选算法采用了(N)LFSR或其它发生器。Cryptography is divided into symmetric cryptography and asymmetric cryptography. Since the encryption speed of asymmetric ciphers is much lower than that of symmetric ciphers, symmetric ciphers are used as much as possible for data encryption and decryption in network and information system security to improve efficiency. Symmetric ciphers are divided into stream ciphers and block ciphers, both of which have advantages and disadvantages. A commonly used cryptographic component for designing stream ciphers is a shift register, such as a linear feedback shift register LFSR [1] and a nonlinear feedback shift register NLFSR [2] , etc., hereinafter collectively referred to as (N)LFSR. For example, the encryption standard A5 algorithm [3, 4] of the second generation mobile communication system GSM, the Bluetooth encryption standard E0 algorithm [4] and the stream cipher international standard SNOW2 algorithm [3] all use LFSR; the Hash function standards SHA1 and SHA2 The Message Expansion Algorithm [3] and several candidate algorithms of the 3rd generation standard SHA3 employ (N)LFSR or other generators.
n级(N)LFSR的当前输出比特都是前n比特的逻辑函数,这样的逻辑函数共有个,其中线性的有2n个,非线性的有个。LFSR采用以下反馈模式由前n比特ai~an+i-1线性递推下一比特an+i:The current output bits of the n-level (N) LFSR are logic functions of the first n bits, and such logic functions have a total of , of which there are 2 n linear ones and non-linear ones indivual. LFSR adopts the following feedback mode to linearly recurse the next bit a n+i from the first n bits a i ~a n+i-1 :
an+i=ai^cn-1ai+1^...^c1an+i-1 a n+i =a i ^c n-1 a i+1 ^...^c 1 a n+i-1
其中,常数ck=0或1,1≤k≤n-1,^是异或即模2加法。如果输入的初始n比特a0~an-1全为0,则LFSR输出恒为0,因此,n级LFSR的最大周期为2n-1。当且仅当LFSR的反馈多项式为本原多项式时,LFSR的周期才达到最大。产生一个本原多项式并不容易,需借助数学软件包。SHA1的消息扩展算法采用以下模式由前16个字wt-16~wt-1递推下一个字wt:wt=(wt-3^wt-8^wt-14^wt-16)<<<1其中,<<<1表示循环左移1位,字长m为32b(比特)。这相当于字长m为32b的16级发生器,如果输入的初始16个字w0~w15全为0,则输出恒为0,因此,其最大周期小于等于(232)16-1。n级NLFSR的最大周期为2n。非线性循环移位寄存器NRR是一种新型反馈移位寄存器。当字长为m比特时,n级NRR的周期大于(2m)n。(N)LFSR软件实现慢,解决的办法是并行m个(N)LFSR,相当于字长为m比特,但最大周期还是小于等于2n,除非象SNOW2一样采用模2m的本原多项式,最大周期才小于等于(2m)n。也就是说,对于不同的字长m和不同的级数n,(N)LFSR要寻找不同的反馈模式,周期才能达到最大。不管字长m和级数n为多大,NRR存在统一的反馈模式,无须寻找达到最大周期的反馈模式,可以直接适应各种平台,包括将来128位以上的平台。在32位平台下(2.4GHz双核CPU、2GB内存、WindowsXP、C语言),SNOW2的LFSR速度为630MB/s;SHA1和SHA256的消息扩展算法速度都小于400MB/s;NRR的速度为700MB/s。对于A5和E0算法采用的LFSR,除非同时并行32个LFSR,效率才和NRR相当。对于周期达到最大的(N)LFSR,其输出是绝对均匀的,遍历了所有状态才会重复,不可预测性差。测试表明,NRR产生的输出是伪随机均匀的,又能遍历所有状态,不可预测性好。Wherein, the constant c k =0 or 1, 1≦k≦n-1, ^ is XOR, that is, modulo 2 addition. If the initial n bits a 0 ˜a n-1 input are all 0, the output of the LFSR is always 0. Therefore, the maximum period of the n-stage LFSR is 2 n -1. If and only when the feedback polynomial of the LFSR is a primitive polynomial, the period of the LFSR reaches the maximum. Generating a primitive polynomial is not easy and requires the help of a math package. The message extension algorithm of SHA1 uses the following pattern to recursively deduce the next word w t from the first 16 words w t-16 ~w t-1 : w t = (w t-3 ^w t-8 ^w t-14 ^w t-16 )<<<1 Wherein, <<<1 represents a cyclic left shift by 1 bit, and the word length m is 32b (bits). This is equivalent to a 16-stage generator with a word length m of 32b. If the initial 16 words w 0 ~w 15 input are all 0, the output will always be 0. Therefore, its maximum period is less than or equal to (2 32 ) 16 -1 . The maximum period of an n-stage NLFSR is 2 n . The nonlinear cyclic shift register NRR is a new type of feedback shift register. When the word length is m bits, the period of n-level NRR is greater than (2 m ) n . (N)LFSR software implementation is slow. The solution is to parallel m (N)LFSRs, which is equivalent to a word length of m bits, but the maximum period is still less than or equal to 2 n , unless a primitive polynomial modulo 2 m is used like SNOW2, The maximum period is less than or equal to (2 m ) n . That is to say, for different word lengths m and different stages n, (N)LFSR needs to find different feedback modes so that the period can reach the maximum. Regardless of the word length m and the number of series n, NRR has a unified feedback mode, and there is no need to find a feedback mode that reaches the maximum cycle, and can directly adapt to various platforms, including platforms with more than 128 bits in the future. Under the 32-bit platform (2.4GHz dual-core CPU, 2GB memory, WindowsXP, C language), the LFSR speed of SNOW2 is 630MB/s; the message extension algorithm speed of SHA1 and SHA256 is less than 400MB/s; the speed of NRR is 700MB/s . For the LFSR used by the A5 and E0 algorithms, unless 32 LFSRs are parallelized at the same time, the efficiency is equivalent to NRR. For the (N)LFSR whose period reaches the maximum, its output is absolutely uniform, and it will repeat after traversing all the states, and the unpredictability is poor. The test shows that the output generated by NRR is pseudo-random and uniform, and can traverse all states, with good unpredictability.
本发明采用4个非线性循环移位寄存器NRR,设计了一种轻量级流密码LSNRR。The present invention adopts four nonlinear cyclic shift registers NRR, and designs a light-weight stream cipher LSNRR.
[1](美)SchneierB.应用密码学——协议、算法与C源程序.吴世忠等译.机械工业出版社,2000-1.264~269[1] (USA) SchneierB. Applied Cryptography—Protocols, Algorithms and C Source Programs. Translated by Wu Shizhong, etc. Mechanical Industry Press, 2000-1.264~269
[2](中)王育民,刘建伟.通信网的安全——理论与技术.西安电子科技大学出版社,1999-04.81~82[2] (Middle) Wang Yumin, Liu Jianwei. Communication Network Security——Theory and Technology. Xidian University Press, 1999-04.81~82
[3](中)谷利泽,郑世慧,杨义先.现代密码学教程.北京邮电大学出版社,2009-08.169~175,189~204[3] (Middle) Gu Lize, Zheng Shihui, Yang Yixian. Modern Cryptography Course. Beijing University of Posts and Telecommunications Press, 2009-08.169~175, 189~204
[4](中)徐胜波,马文平,王新梅.无线通信网中的安全技术.人民邮电出版社,2003-07.149~150,183~187[4] (Middle) Xu Shengbo, Ma Wenping, Wang Xinmei. Security Technology in Wireless Communication Networks. People's Posts and Telecommunications Press, 2003-07.149~150, 183~187
发明内容Contents of the invention
【发明目的】【Purpose of the invention】
为了设计安全高效的对称密码,用于网络与信息系统安全中的数据加解密,基于非线性循环移位寄存器NRR的轻量级流密码LSNRR相比其它对称密码而言,扩大了输出序列的周期,增强了多平台适应性,提高了效率。In order to design a safe and efficient symmetric cipher for data encryption and decryption in network and information system security, the lightweight stream cipher LSNRR based on the nonlinear cyclic shift register NRR expands the period of the output sequence compared with other symmetric ciphers , enhanced multi-platform adaptability and improved efficiency.
特别地,普通密码技术适合资源不受限的普通终端加解密,不适合资源受限终端,也就是不适合资源不受限的终端与资源受限终端互通。物联网等无线网络中的资源受限终端加解密需要轻量级密码,但常见轻量级密码用于资源不受限的终端与资源受限终端互通,发挥不了资源不受限终端的资源优势,效率低,会加重不受限终端的负担。本发明的最大目的是设计一种能充分利用资源不受限终端的资源优势、又适合资源受限终端的、效率能达到普通密码级别的轻量级密码。In particular, ordinary encryption technology is suitable for encryption and decryption of common terminals with unlimited resources, but not suitable for terminals with limited resources, that is, it is not suitable for intercommunication between terminals with unlimited resources and limited resources. The encryption and decryption of resource-constrained terminals in wireless networks such as the Internet of Things requires lightweight ciphers, but common lightweight ciphers are used for intercommunication between resource-unlimited terminals and resource-constrained terminals, and cannot take advantage of the resource advantages of resource-limited terminals. , which is inefficient and will increase the burden on unrestricted terminals. The biggest purpose of the present invention is to design a lightweight cipher that can make full use of the resource advantages of unrestricted terminals, is suitable for resource-constrained terminals, and can reach the level of common ciphers.
【技术方案】【Technical solutions】
本发明中的非线性循环移位寄存器NRR采用的技术方案是:当字长为m比特时,n级NRR采用以下反馈模式由前n个字ai~ai+n-1中的首尾2个字递推下一个字ai+n The technical solution adopted by the nonlinear cyclic shift register NRR in the present invention is: when the word length is m bits, the n-level NRR adopts the following feedback mode by starting and ending 2 in the first n words a i ~a i+n-1 word recursion to the next word a i+n
其中,i≥0,n≥2,字长m取平台的位数;模运算mod表示求余数;<<<j表示循环左移j位,j在0~m-1之间循环变化,即j=imodm;表示模加;c为1~2m-1之间的奇数;输入的初始n个字a0~an-1取值都不限,输入的每个字都是任意m比特长的数。Among them, i≥0, n≥2, the word length m is the number of digits of the platform; the modulus operation mod means to find the remainder; <<<j means to rotate left by j bits, and j changes cyclically between 0 and m-1, that is j = imodm; Indicates modulo addition; c is an odd number between 1 and 2 m -1; the values of the initial n words a 0 to a n-1 input are not limited, and each input word is a number of any m-bit length.
本发明中的NRR与传统的(N)LFSR不同之处在于:(1)循环移位数j循环变化;(2)计数加c;(3)初值不受限。The NRR in the present invention differs from the traditional (N)LFSR in that: (1) the number of cyclic shifts j changes cyclically; (2) counting plus c; (3) the initial value is not limited.
流密码的加密方式为:密文C=P^KS;解密方式为:明文P=C^KS。其中KS为密钥流,所以其关键是如何产生密钥流。LSNRR采用了4个NRR。4个NRR的字长m均为32b(比特),级数n分别为4、5、4、3。其中第1个NRR用于密钥编排,另3个NRR的输出进行模加来产生密钥流。LSNRR产生密钥流的过程用KS=LSNRR(K,IV)表示。其中输入参数K为长度Lk≥16B(字节)的密钥;IV是保密通信中用于抗重放攻击的初始向量,与密钥K等长。对于16B的密钥和32位平台,将密钥K和初值IV表示成4个32位字级联:K=(K0||K1||K2||K3);IV=(IV0||IV1||IV2||IV3)。The encryption method of the stream cipher is: ciphertext C=P^KS; the decryption method is: plaintext P=C^KS. Among them, KS is the key stream, so the key is how to generate the key stream. LSNRR uses 4 NRRs. The word length m of the four NRRs is 32b (bits), and the number of stages n is 4, 5, 4, 3 respectively. The first NRR is used for key arrangement, and the outputs of the other three NRRs are modulo-added to generate the key stream. The process of LSNRR generating key stream is represented by KS=LSNRR(K, IV). The input parameter K is a key with a length of Lk≥16B (bytes); IV is an initial vector used for anti-replay attack in secure communication, which is the same length as the key K. For a 16B key and a 32-bit platform, the key K and the initial value IV are expressed as a concatenation of four 32-bit words: K=(K 0 ||K 1 ||K 2 ||K 3 ); IV=( IV 0 ||IV 1 ||IV 2 ||IV 3 ).
LSNRR中第1个NRR的初值为A0=(a0||a1||a2||a3)=K^IV。其反馈模式为:The initial value of the first NRR in the LSNRR is A 0 =(a 0 ||a 1 ||a 2 ||a 3 )=K^IV. Its feedback mode is:
ai+4={[(ai+3<<<j)^ai]+1}mod232,其中i≥0,j=imod32,^表示逐位异或运算。a i+4 ={[(a i+3 <<<j)^a i ]+1}mod2 32 , where i≥0, j=imod32, and ^ represents a bitwise XOR operation.
另3个NRR的初值分别为:The initial values of the other 3 NRRs are:
B0=(b0||b1||b2||b3||b4)=(ai+64+K1||ai+67+K2||ai+70+K3||ai+73+K0)||(ai+75+K2);B 0 =(b 0 ||b 1 ||b 2 ||b 3 ||b 4 )=(a i+64 +K 1 ||a i+67 +K 2 ||a i+70 +K 3 ||a i+73 +K 0 )||(a i+75 +K 2 );
D0=(d0||d1||d2||d3)=(ai+65+K2)||(ai+68+K3)||(ai+71+K0)||(ai+74+K1);D 0 =(d 0 ||d 1 ||d 2 ||d 3 )=(a i+65 +K 2 )||(a i+68 +K 3 )||(a i+71 +K 0 )||(a i+74 +K 1 );
E0=(e0||e1||e2)=(ai+66+K3)||(ai+69+K0)||(ai+72+K1)。E 0 =(e 0 ||e 1 ||e 2 )=(a i+66 +K 3 )||(a i+69 +K 0 )||(a i+72 +K 1 ).
对于i≥0,后3个NRR的反馈模式分别为For i≥0, the feedback modes of the last three NRRs are respectively
bi+5={[(bi+4<<<j1)+bi]+3}mod232,其中j1=imod32;b i+5 ={[(b i+4 <<<j 1 )+b i ]+3}mod2 32 , where j 1 =imod32;
di+4={[(di+3<<<j2)+di]+5}mod232,其中j2=i+11mod32;d i+4 ={[(d i+3 <<<j 2 )+d i ]+5}mod2 32 , where j 2 =i+11mod32;
ei+3={[(ei+2<<<j3)+ei]+7}mod232,其中j3=i+23mod32e i+3 ={[(e i+2 <<<j 3 )+e i ]+7}mod2 32 , where j 3 =i+23mod32
LSNRR的输出密钥流由后3个NRR的输出进行模加来产生: The output key stream of LSNRR is generated by modulo-adding the outputs of the last three NRRs:
【有益效果】【Beneficial effect】
相比常用对称密码,流密码LSNRR有以下优点:Compared with common symmetric ciphers, stream cipher LSNRR has the following advantages:
(1)周期更大、安全性更高。由于乘法系数b和循环移位数j不固定,字长为m比特时,n级NRR的周期大于(2m)n。对于反馈模式ai+n=[(ai+n-1<<<j)+ai+1]mod2m,当字长为8b(比特)时,测试得2级NRSR的周期为484192>216B(字节);3级NRR的周期为81,782456>224(16MB);4级NRR的周期为27,251403552>232(4GB)。当字长为16b时,2级NRR的周期为37,540033008>4G个短整数。对于反馈模式ai+n=[(b×ai+n-1)+(ai<<<j)+1]mod2m,当字长为8b时,b取1~2m-1之间循环变化的奇数,测试得2级NRR的周期为4,765440>216(64KB)。如果b取3~2m-1之间循环变化的奇数,周期更大。测试表明,周期与寄存器的初值、循环移位数j的初值及乘法系数b的初值无关。(1) The cycle is longer and the security is higher. Since the multiplication coefficient b and the cyclic shift number j are not fixed, when the word length is m bits, the period of n-level NRR is greater than (2 m ) n . For the feedback mode a i+n =[(a i+n-1 <<<j)+a i +1]mod2 m , when the word length is 8b (bit), the period of the 2-level NRSR is tested to be 484192> 2 16 B (bytes); the period of level 3 NRR is 81,782456 > 2 24 (16MB); the period of level 4 NRR is 27,251403552 > 2 32 (4GB). When the word length is 16b, the period of the 2-level NRR is 37,540033008>4G short integers. For the feedback mode a i+n =[(b×a i+n-1 )+(a i <<<j)+1]mod2 m , when the word length is 8b, b takes one of 1 to 2 m -1 The odd number of cyclical changes in the interval, the test shows that the period of the 2-level NRR is 4,765440>2 16 (64KB). If b is an odd number that changes cyclically between 3 and 2 m -1, the period is even greater. The test shows that the period has nothing to do with the initial value of the register, the initial value of the cyclic shift number j and the initial value of the multiplication coefficient b.
对于周期达到最大的LFSR,其输出状态1~2n-1是绝对均匀的;对于周期达到最大的NLFSR,其输出状态0~2n-1是绝对均匀的,遍历了所有状态才会重复,不可预测性差。测试表明,NRR产生的输出是伪随机均匀的,没有遍历所有状态也可能出现重复。寄存器状态重复不一定是周期重复,当寄存器的状态和循环移位数j的状态以及乘法系数b的状态同时重复才是周期重复。因此,NRR的不可预测性和安全性优于(N)LFSR。For the LFSR whose period reaches the maximum, its output state 1~2 n -1 is absolutely uniform; for the NLFSR whose period reaches the maximum, its output state 0~2 n -1 is absolutely uniform, and it will repeat after traversing all the states. Poor unpredictability. Tests have shown that the output generated by NRR is pseudo-random and uniform, and duplication may occur without traversing all states. The repetition of the register state is not necessarily periodic repetition. When the state of the register, the state of the cyclic shift number j and the state of the multiplication coefficient b are repeated at the same time, it is a periodic repetition. Therefore, the unpredictability and security of NRR is better than (N)LFSR.
NRR输入的初始n个字a0~an-1取值都不限。对于杂凑(Hash)函数标准SHA1和SHA2的消息扩展算法,如果初始消息全为0,则扩展消息也全为0。NRR不存在该问题。The values of the initial n words a 0 to a n-1 input by the NRR are not limited. For the message extension algorithms of hash (Hash) function standards SHA1 and SHA2, if the initial message is all 0, the extended message is also all 0. NRR does not have this problem.
另外,有个分组密码叫RC6,需要5轮加密才能实现伪随机性。其加密轮函数f(i,a,b,c,d)为:In addition, there is a block cipher called RC6, which requires 5 rounds of encryption to achieve pseudo-randomness. Its encryption round function f(i, a, b, c, d) is:
{u=[d(2d+1)]<<<5;t=[b(2b+1)]<<<5;a=[(a^t)<<<u]+k[i];c=[(c^u)<<<t]+k[i+1];}{u=[d(2d+1)]<<<5; t=[b(2b+1)]<<<5; a=[(a^t)<<<u]+k[i]; c=[(c^u)<<<t]+k[i+1];}
用NRR直接取代2个缓存变量u和t,对d和b进行可逆更新:Use NRR to directly replace the two cache variables u and t, and reversibly update d and b:
{t=d;d=[(t+1)<<<i]+b;b=(d<<<i)+t+1;a=[(a^d)<<<b]+k[i];c=[(c^b)<<<d]+k[i+1];}{t=d; d=[(t+1)<<<i]+b; b=(d<<<i)+t+1; a=[(a^d)<<<b]+k [i];c=[(c^b)<<<d]+k[i+1];}
5轮加密也实现了伪随机性,这也说明NRR具有良好的密码特性。5-round encryption also achieves pseudo-randomness, which also shows that NRR has good cryptographic properties.
因此,流密码LSNRR的周期大于常用对称密码。从这方面讲,LSNRR的安全性高于常用对称密码。Therefore, the period of the stream cipher LSNRR is larger than that of common symmetric ciphers. In this respect, the security of LSNRR is higher than that of commonly used symmetric ciphers.
(2)效率更高。在32位平台下(2.4GHz双核CPU、2GB内存、WindowsXP、C语言),NRR速度为700MB/s。常用(N)LFSR速度不超过630MB/s。(2) Higher efficiency. Under the 32-bit platform (2.4GHz dual-core CPU, 2GB memory, WindowsXP, C language), the NRR speed is 700MB/s. Commonly used (N)LFSR speed does not exceed 630MB/s.
单核时,常用对称密码的速度不超过50MB/s;双核时不超过100MB/s。2GHz单核时,RC6-ECB的加密速度,即RC6-CTR和RC6-OFB产生密钥流的速度为45MB/s;RC4、AES-CTR和AES-OFB产生密钥流的速度为30MB/s。2.4GHz双核时,AES-CTR和AES-OFB产生密钥流的速度为75MB/s。2GHz单核时,LSNRR产生密钥流的速度为70MB/s;2.4GHz双核时,LSNRR产生密钥流的速度为118MB/s。LSNRR的3个NRR能并行处理,三核时效率达到最佳,适合目前普遍使用的双核计算机。For single-core, the speed of common symmetric ciphers does not exceed 50MB/s; for dual-core, it does not exceed 100MB/s. At 2GHz single core, the encryption speed of RC6-ECB, that is, the speed of RC6-CTR and RC6-OFB to generate the key stream is 45MB/s; the speed of RC4, AES-CTR and AES-OFB to generate the key stream is 30MB/s . At 2.4GHz dual-core, the speed of AES-CTR and AES-OFB to generate key stream is 75MB/s. When the 2GHz single core is used, the speed of LSNRR to generate the key stream is 70MB/s; when the 2.4GHz dual-core is used, the speed of LSNRR to generate the key stream is 118MB/s. The three NRRs of LSNRR can be processed in parallel, and the efficiency reaches the best when the three cores are used, which is suitable for the dual-core computers commonly used at present.
(3)多平台适应性更灵活。(N)LFSR软件实现慢,解决的办法是,平台的位数为m时,并行m个(N)LFSR,相当于字长为m比特,但最大周期还是小于等于2n,除非象SNOW2一样采用模2m的本原多项式,最大周期才小于等于(2m)n。也就是说,对于不同的字长m和不同的级数n,(N)LFSR要寻找不同的反馈模式。不管字长m和级数n为多大,NRR存在固定的反馈模式
LSNRR能直接扩展成面向64位以上平台的密码算法,也能直接改成面向8位平台的算法。LSNRR can be directly extended to a cryptographic algorithm for platforms above 64 bits, and can also be directly changed to an algorithm for 8-bit platforms.
(4)资源受限不受限的环境都适用。普通密码技术适合资源不受限的普通终端加解密,不适合资源受限终端,也就是不适合资源不受限的终端与资源受限终端互通。物联网等无线网络中的资源受限终端加解密需要轻量级密码,但常见轻量级密码用于资源不受限的终端与资源受限终端互通,发挥不了资源不受限终端的资源优势,效率低,会加重不受限终端的负担。本发明的最大优势是设计了一种能充分利用资源不受限终端的资源优势、又适合资源受限终端的、效率高于普通密码的轻量级密码。LSNRR硬件实现需要的逻辑门电路(GE)数约为3284,符合轻量级密码的需求。(4) Applicable to both resource-constrained and unrestricted environments. Ordinary encryption technology is suitable for encryption and decryption of ordinary terminals with unlimited resources, but not suitable for terminals with limited resources, that is, it is not suitable for intercommunication between terminals with unlimited resources and limited resources. The encryption and decryption of resource-constrained terminals in wireless networks such as the Internet of Things requires lightweight ciphers, but common lightweight ciphers are used for intercommunication between resource-unlimited terminals and resource-constrained terminals, and cannot take advantage of the resource advantages of resource-limited terminals. , which is inefficient and will increase the burden on unrestricted terminals. The greatest advantage of the present invention is that it designs a light-weight cipher that can fully utilize the resource advantages of terminals with unlimited resources, is suitable for terminals with limited resources, and is more efficient than ordinary ciphers. The number of logic gates (GE) required for LSNRR hardware implementation is about 3284, which meets the requirements of lightweight cryptography.
附图说明Description of drawings
图1基于非线性循环移位寄存器的轻量级流密码LSNRRFigure 1 Lightweight stream cipher LSNRR based on nonlinear circular shift register
说明:表示模加。illustrate: Indicates modulo addition.
具体实施方式Detailed ways
本发明中的非线性循环移位寄存器NRR的具体实施方式是:当字长为m比特时,n级NRR采用以下反馈模式由前n个字ai~ai+n-1中的首尾2个字递推下一个字ai+n The specific implementation of the nonlinear cyclic shift register NRR in the present invention is: when the word length is m bits, the n-level NRR adopts the following feedback mode by the first and last 2 in the first n words a i ~a i+n-1 word recursion to the next word a i+n
其中,n≥2,字长m取平台的位数;<<<j表示循环左移j位,j在0~m-1之间循环变化,即j=imodm;表示模加;c为1~2m-1之间的奇数;输入的初始n个字a0~an-1取值都不限,输入的每个字都是任意m比特长的数。Among them, n≥2, the word length m takes the number of digits of the platform; <<<j means a cyclic left shift of j bits, and j changes cyclically between 0 and m-1, that is, j=imodm; Indicates modulo addition; c is an odd number between 1 and 2 m -1; the values of the initial n words a 0 to a n-1 input are not limited, and each input word is a number of any m-bit length.
LSNRR采用了4个NRR。4个NRR的字长m均为32b(比特),级数n分别为4、5、4、3。其中第1个NRR用于密钥编排,另3个NRR的输出进行模加来产生密钥流。LSNRR产生密钥流的过程用KS=LSNRR(K,IV)表示。其中输入参数K为长度Lk≥16B(字节)的密钥;IV是保密通信中用于抗重放攻击的初始向量,与密钥K等长。对于16B的密钥和32位平台,将密钥K和初值IV表示成4个32位字级联:K=(K0||K1||K2||K3);IV=(IV0||IV1||IV2||IV3)LSNRR uses 4 NRRs. The word length m of the four NRRs is 32b (bits), and the number of stages n is 4, 5, 4, 3 respectively. The first NRR is used for key arrangement, and the outputs of the other three NRRs are modulo-added to generate the key stream. The process of LSNRR generating key stream is represented by KS=LSNRR(K, IV). The input parameter K is a key with a length of Lk≥16B (bytes); IV is an initial vector used for anti-replay attack in secure communication, which is the same length as the key K. For a 16B key and a 32-bit platform, the key K and the initial value IV are expressed as a concatenation of four 32-bit words: K=(K 0 ||K 1 ||K 2 ||K 3 ); IV=( IV 0 ||IV 1 ||IV 2 ||IV 3 )
LSNRR中第1个NRR的初值为A0=(a0||a1||a2||a3)=K^IV。其反馈模式为:The initial value of the first NRR in the LSNRR is A 0 =(a 0 ||a 1 ||a 2 ||a 3 )=K^IV. Its feedback mode is:
ai+4={[(ai+3<<<j)^ai]+1}mod232,其中i≥0,j=imod32,^表示逐位异或运算。a i+4 ={[(a i+3 <<<j)^a i ]+1}mod2 32 , where i≥0, j=imod32, and ^ represents a bitwise XOR operation.
另3个NRR的初值分别为:The initial values of the other 3 NRRs are:
B0=(b0||b1||b2||b3||b4)=(ai+64+K1||ai+67+K2||ai+70+K3||ai+73+K0)||(ai+75+K2);B 0 =(b 0 ||b 1 ||b 2 ||b 3 ||b 4 )=(a i+64 +K 1 ||a i+67 +K 2 ||a i+70 +K 3 ||a i+73 +K 0 )||(a i+75 +K 2 );
D0=(d0||d1||d2||d3)=(ai+65+K2)||(ai+68+K3)||(ai+71+K0)||(ai+74+K1);D 0 =(d 0 ||d 1 ||d 2 ||d 3 )=(a i+65 +K 2 )||(a i+68 +K 3 )||(a i+71 +K 0 )||(a i+74 +K 1 );
E0=(e0||e1||e2)=(ai+66+K3)||(ai+69+K0)||(ai+72+K1)。E 0 =(e 0 ||e 1 ||e 2 )=(a i+66 +K 3 )||(a i+69 +K 0 )||(a i+72 +K 1 ).
对于i≥0,后3个NRR的反馈模式分别为For i≥0, the feedback modes of the last three NRRs are respectively
bi+5={[(bi+4<<<j1)+bi]+3}mod232,其中j1=imod32;b i+5 ={[(b i+4 <<<j 1 )+b i ]+3}mod2 32 , where j 1 =imod32;
di+4={[(di+3<<<j2)+di]+5}mod232,其中j2=i+11mod32;d i+4 ={[(d i+3 <<<j 2 )+d i ]+5}mod2 32 , where j 2 =i+11mod32;
ei+3={[(ei+2<<<j3)+ei]+7}mod232,其中j3=i+23mod32e i+3 ={[(e i+2 <<<j 3 )+e i ]+7}mod2 32 , where j 3 =i+23mod32
LSNRR的输出密钥流由后3个NRR的输出进行模加来产生: The output key stream of LSNRR is generated by modulo-adding the outputs of the last three NRRs:
流密码LSNRR的加密方式为:密文C=P^KS;解密方式为:明文P=C^KS。The encryption method of the stream cipher LSNRR is: ciphertext C=P^KS; the decryption method is: plaintext P=C^KS.
Claims (5)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510348756.XA CN105162579A (en) | 2015-06-18 | 2015-06-18 | Lightweight stream cipher LSNRR based on non-linear cyclic shift register |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510348756.XA CN105162579A (en) | 2015-06-18 | 2015-06-18 | Lightweight stream cipher LSNRR based on non-linear cyclic shift register |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN105162579A true CN105162579A (en) | 2015-12-16 |
Family
ID=54803344
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510348756.XA Pending CN105162579A (en) | 2015-06-18 | 2015-06-18 | Lightweight stream cipher LSNRR based on non-linear cyclic shift register |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN105162579A (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105553647A (en) * | 2016-02-26 | 2016-05-04 | 南京航空航天大学 | Light-weight stream cipher technology LSNR2 based on nonlinear ring shift register |
| CN105897403A (en) * | 2016-04-01 | 2016-08-24 | 苏州中科启慧软件技术有限公司 | Stream cipher technology SPRR based on parallel cyclic shift register |
| CN113886804A (en) * | 2021-12-09 | 2022-01-04 | 南京航空航天大学 | Lightweight stream cipher generation method based on parallel cyclic shift register |
| CN114629624A (en) * | 2022-03-11 | 2022-06-14 | 南京航空航天大学 | Lightweight Hash function construction method based on parallel cyclic shift register |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102176693A (en) * | 2011-03-04 | 2011-09-07 | 南京航空航天大学 | NRSR (nonlinear ring shifting register) |
| CN104486068A (en) * | 2014-12-12 | 2015-04-01 | 苏州中科启慧软件技术有限公司 | Stream cipher algorithm SNRR based on nonlinear circulating shift register |
| CN104506303A (en) * | 2014-12-19 | 2015-04-08 | 苏州中科启慧软件技术有限公司 | Parallel circulation shift register PRR |
| US9008313B1 (en) * | 2014-07-24 | 2015-04-14 | Elliptic Technologies Inc. | System and method for generating random key stream cipher texts |
-
2015
- 2015-06-18 CN CN201510348756.XA patent/CN105162579A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102176693A (en) * | 2011-03-04 | 2011-09-07 | 南京航空航天大学 | NRSR (nonlinear ring shifting register) |
| US9008313B1 (en) * | 2014-07-24 | 2015-04-14 | Elliptic Technologies Inc. | System and method for generating random key stream cipher texts |
| CN104486068A (en) * | 2014-12-12 | 2015-04-01 | 苏州中科启慧软件技术有限公司 | Stream cipher algorithm SNRR based on nonlinear circulating shift register |
| CN104506303A (en) * | 2014-12-19 | 2015-04-08 | 苏州中科启慧软件技术有限公司 | Parallel circulation shift register PRR |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105553647A (en) * | 2016-02-26 | 2016-05-04 | 南京航空航天大学 | Light-weight stream cipher technology LSNR2 based on nonlinear ring shift register |
| CN105897403A (en) * | 2016-04-01 | 2016-08-24 | 苏州中科启慧软件技术有限公司 | Stream cipher technology SPRR based on parallel cyclic shift register |
| CN113886804A (en) * | 2021-12-09 | 2022-01-04 | 南京航空航天大学 | Lightweight stream cipher generation method based on parallel cyclic shift register |
| CN113886804B (en) * | 2021-12-09 | 2022-04-29 | 南京航空航天大学 | Lightweight stream cipher generation method based on parallel cyclic shift register |
| CN114629624A (en) * | 2022-03-11 | 2022-06-14 | 南京航空航天大学 | Lightweight Hash function construction method based on parallel cyclic shift register |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Naif et al. | Secure IOT system based on chaos-modified lightweight AES | |
| US20090323927A1 (en) | Mechanism for chained output feedback encryption | |
| CN102176693A (en) | NRSR (nonlinear ring shifting register) | |
| CN104333446B (en) | A new ultra-lightweight QTL block cipher implementation method | |
| CN104065474B (en) | Novel low-resource efficient lightweight Surge block cipher implementation method | |
| CN114640454B (en) | A Cryptographic System of Post-Quantum Cryptography Crystals Kyber Protocol | |
| CN113078996B (en) | FPGA optimization implementation method, system and application of SM4 cryptographic algorithm | |
| CN108933653A (en) | A kind of AES encrypting and deciphering system and method based on large-scale data | |
| Zhao et al. | Block cipher design: generalized single-use-algorithm based on chaos | |
| CN105162579A (en) | Lightweight stream cipher LSNRR based on non-linear cyclic shift register | |
| CN114499826A (en) | A Flexible Serializable Lightweight Block Cipher Implementation Method | |
| CN104486068A (en) | Stream cipher algorithm SNRR based on nonlinear circulating shift register | |
| CN116684071A (en) | Method and system for realizing acceleration of white box protection scheme based on Boolean circuit | |
| CN103701591A (en) | Sequence password realization method and key stream generating method and device | |
| CN113886804B (en) | Lightweight stream cipher generation method based on parallel cyclic shift register | |
| CN105553647A (en) | Light-weight stream cipher technology LSNR2 based on nonlinear ring shift register | |
| CN114513298B (en) | Lightweight encryption method capable of accepting arbitrary plaintext length | |
| CN115694796A (en) | Internet of things security encryption method and device, storage medium and electronic equipment | |
| CN104219045A (en) | RC4 stream cipher generator | |
| CN108449169A (en) | A Chaotic Block Encryption Method for Wireless Sensor Networks | |
| Mandal et al. | An adaptive neural network guided random block length based cryptosystem for online wireless communication (ANNRBLC) | |
| Bokhari et al. | Performance of software and hardware oriented lightweight stream cipher in constraint environment: A review | |
| Kocheta et al. | A review of some recent stream ciphers | |
| CN105391546A (en) | Lightweight block cipher technology VHF based on double pseudo random transformation and Feistel structure | |
| Acla et al. | Performance evaluation of lightweight advanced encryption standard hardware implementation |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20151216 |
|
| WD01 | Invention patent application deemed withdrawn after publication |