CN112202547B - A lightweight block cipher GFCS implementation method, device and readable storage medium - Google Patents
A lightweight block cipher GFCS implementation method, device and readable storage medium Download PDFInfo
- Publication number
- CN112202547B CN112202547B CN202011254102.8A CN202011254102A CN112202547B CN 112202547 B CN112202547 B CN 112202547B CN 202011254102 A CN202011254102 A CN 202011254102A CN 112202547 B CN112202547 B CN 112202547B
- Authority
- CN
- China
- Prior art keywords
- round
- data
- key
- blocks
- rounds
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0618—Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
- H04L9/0631—Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0618—Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
- H04L9/0625—Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation with splitting of the data block into left and right halves, e.g. Feistel based algorithms, DES, FEAL, IDEA or KASUMI
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Storage Device Security (AREA)
Abstract
Description
技术领域technical field
本发明属于密码技术领域,具体涉及一种轻量级分组密码GFCS实现方法、装置及可读存储介质。The invention belongs to the technical field of cryptography, and in particular relates to a method, a device and a readable storage medium for implementing a lightweight block cipher GFCS.
背景技术Background technique
随着万网互联时代的不断推进,各种无线传感器、射频识别标签、智能卡等资源占用量少、耗电量低且实现效率高的嵌入式设备和人们的生活变得息息相关。而无线传感器等电量存储能力较低的资源受限设备中,选用传统的复杂的密码算法对其中的数据进行保护显然是不适用也不必要的,因此,轻量级分组密码算法的设计受到了越来越多的关注。With the continuous advancement of the Internet of Things era, various wireless sensors, radio frequency identification tags, smart cards and other embedded devices that occupy less resources, consume less power, and achieve high efficiency have become closely related to people's lives. In the resource-constrained devices with low power storage capacity such as wireless sensors, it is obviously inapplicable and unnecessary to use traditional complex cryptographic algorithms to protect the data in them. Therefore, the design of lightweight block cipher algorithms has been affected by more and more attention.
轻量级分组密码算法的设计,需要在保证一定安全性的同时,降低算法的运算成本或者是运算性能,使其可以达到资源消耗少,执行效率高,适用于软硬件实现的效果。另一方面,密码分析技术的不断发展,也给轻量级分组密码算法的设计提供了更多的思路和改进方向,促使轻量级分组密码算法既能保证安全性又能提供更好的实现效率。由于轻量级分组密码算法的相关标准并未制定,因此,如何设计出有一定安全性且实现效率高的轻量级分组密码算法仍然是接下来很长一段时间需要研究的重要问题。The design of the lightweight block cipher algorithm needs to reduce the computational cost or computational performance of the algorithm while ensuring certain security, so that it can achieve the effect of low resource consumption and high execution efficiency, which is suitable for software and hardware implementation. On the other hand, the continuous development of cryptanalysis technology also provides more ideas and improvement directions for the design of lightweight block cipher algorithms, which promotes lightweight block cipher algorithms to not only ensure security but also provide better implementation. efficiency. Since the relevant standards for lightweight block cipher algorithms have not been formulated, how to design a lightweight block cipher algorithm with certain security and high implementation efficiency is still an important issue that needs to be studied for a long time in the future.
发明内容SUMMARY OF THE INVENTION
本发明的目的是提供一种全新的手段实现轻量级分组密码算法的加密和解密,在保证安全性的同时,提高算法效率,降低算法的资源占用面积。The purpose of the present invention is to provide a brand-new means to realize the encryption and decryption of the lightweight block cipher algorithm, while ensuring the security, improving the efficiency of the algorithm and reducing the resource occupied area of the algorithm.
一方面,本发明提供的一种轻量级分组密码GFCS实现方法,包括如下步骤:On the one hand, a light-weight block cipher GFCS implementation method provided by the present invention comprises the following steps:
S1:将长度为L明文或密文作为待加密或待解密数据,并将其划分为4个数据块;以及获取长度为L的初始密钥,并将初始密钥划分为4个子块,L为被4整除的正整数;S1: Take plaintext or ciphertext of length L as the data to be encrypted or decrypted, and divide it into 4 data blocks; and obtain an initial key of length L, and divide the initial key into 4 sub-blocks, L is a positive integer divisible by 4;
S2:将所述初始密钥的4个子块进行至少N轮密钥扩展轮运算得到4个子块的轮密钥;S2: perform at least N rounds of key expansion round operations on the 4 sub-blocks of the initial key to obtain the round keys of the 4 sub-blocks;
S3:若为加密运算,利用轮密钥、待加密数据以及轮运算函数先进行N-1轮异或运算和移位运算,再进行一轮异或运算得到密文;S3: If it is an encryption operation, use the round key, the data to be encrypted and the round operation function to first perform N-1 rounds of XOR operation and shift operation, and then perform one round of XOR operation to obtain the ciphertext;
若为解密运算,利用轮密钥、待解密数据以及轮运算函数先进行一次异或运算,再进行N-1轮异或运算和移位运算得到明文。If it is a decryption operation, use the round key, the data to be decrypted and the round operation function to perform an XOR operation first, and then perform N-1 rounds of XOR operation and shift operation to obtain the plaintext.
本发明提供的GFCS分组密码算法主要是基于广义Feistel结构的密码算法,此算法基础运算部件简单轻量,仅由通用部件异或,逻辑与,逻辑非及循环移位构成,并且轮函数重复使用密钥扩展算法的基础部件,可以进一步提高硬件实现效率。The GFCS block cipher algorithm provided by the present invention is mainly a cipher algorithm based on the generalized Feistel structure. The basic operation components of the algorithm are simple and lightweight, and only consist of general components XOR, logical AND, logical NOT and cyclic shift, and the round function is repeatedly used. The basic component of the key expansion algorithm can further improve the efficiency of hardware implementation.
加密运算的前N-1轮异或运算和移位运算中,针对第r轮的每个数据块,按照移位顺序,将标记位i的加密数据标记位i的轮密钥以及下一个标记位的加密数据或下下一个标记位的加密数据输入标记位i的F函数Fi的输出结果或进行异或运算作为按移位顺序的下一个标记位在下一轮的加密数据其中,若下一个标记位的加密数据是下一个标记位在下一轮的加密数据,则选择下下个标记位的加密数据输入至标记位i的F函数中,其中,四个数据块中对应存在三个F函数与同一识别标记的轮密钥对应的轮运算函数f为同一函数,存在一个F函数满足:F(x)=x。In the first N-1 rounds of XOR operation and shift operation of the encryption operation, for each data block in the rth round, according to the shift order, the encrypted data of the marked bit i is round key for bit i and the encrypted data for the next flag bit or the encrypted data of the next flag bit The output result of the F function F i with the input flag i or XOR operation is performed as the encrypted data in the next round of the next mark bit in the shift order Among them, if the encrypted data of the next marker bit is the encrypted data of the next marker bit in the next round, then select the encrypted data of the next marker bit and input it into the F function of the marker bit i, wherein the corresponding There are three F functions and the round operation function f corresponding to the round key of the same identification mark is the same function, and there is one F function satisfying: F(x)=x.
最后一轮异或运算中,将标记位i的加密数据标记位i的轮密钥以及下一个标记位的加密数据输入标记位i的F函数Fi的输出结果进行异或运算得到密文。In the last round of XOR operation, the encrypted data of bit i will be marked round key for bit i and the encrypted data for the next flag bit The output result of the F function F i with the input flag i Perform an exclusive OR operation to obtain the ciphertext.
解密过程与加密过程相对应,解密过程中移位顺序与加密过程恰好相反,F函数也一一对应,轮密钥的使用是从第N轮密钥扩展到第一轮密钥扩展得到的轮密钥依次参与解密的N轮运算中。The decryption process corresponds to the encryption process. The shift order in the decryption process is exactly the opposite of the encryption process. The F function also corresponds to one-to-one. The keys participate in the N rounds of decryption in turn.
可选地,若为加密运算,待加密数据的4个数据块在前N-1轮异或运算和移位运算对应的计算公式如下:Optionally, if it is an encryption operation, the calculation formulas corresponding to the first N-1 rounds of XOR operation and shift operation of the four data blocks of the data to be encrypted are as follows:
其中,下标a、b、c、d是加密过程按照移位运算中移位顺序依次设置的数据块识别标记,X表示加密数据,上标r表示轮数,表示第r+1轮密钥扩展轮运算中得到的识别标记a对应的轮密钥;Fa、Fb、Fc、Fd存在三个公式中F函数与同一识别标记的轮密钥对应的轮运算函数f为同一函数,存在一个公式中的F函数满足:F(x)=x。Among them, the subscripts a, b, c, and d are the data block identification marks set sequentially in the encryption process according to the shift sequence in the shift operation, X represents the encrypted data, and the superscript r represents the number of rounds. Indicates the round key corresponding to the identification mark a obtained in the r+1th round of key expansion round operation; F a , F b , F c , and F d exist in three formulas in which the F function corresponds to the round key of the same identification mark The round operation function f of is the same function, and the F function in a formula satisfies: F(x)=x.
可选地,若为加密运算,待加密数据的4个数据块在第N轮异或运算的公式如下:Optionally, if it is an encryption operation, the formula for the N-th XOR operation of the four data blocks of the data to be encrypted is as follows:
若加密运算,L长度的明文P划分为4个数据块,初始密钥K分也划分为4个子块,K=(k0,k1,k2,k3),针对各个子块设置了轮函数fi=f,(i=0,1,2,3),本发明在加密过程中,针对明文P的4个数据块的移位顺序可以是按照0→1→2→3→0的顺序依次进行移位,还可以针对4个数据块以其他顺序进行移位,譬如0→1→3→2→0,本发明对此不进行具体的限定,为了保护各种移位顺序,本发明按照移位顺序将4个数据块进行了标记,标记为a、b、c、d,对应设置的移位顺序为:a→b→c→d→a;于此同时,上述Fa、Fb、Fc、Fd中存在三个函数与f0、f1、f2、f3对应一致,存在一个函数满足:F(x)=x,具体哪一个本发明对此不进行限定。If the encryption operation is performed, the plaintext P of length L is divided into 4 data blocks, The initial key K is also divided into 4 sub-blocks, K=(k 0 , k 1 , k 2 , k 3 ), and the round function f i =f is set for each sub-block, (i=0,1,2, 3), in the encryption process of the present invention, the shift sequence for the 4 data blocks of the plaintext P may be shifted in the order of 0→1→2→3→0, or the 4 data blocks may be shifted by other Shift in sequence, such as 0→1→3→2→0, which is not specifically limited in the present invention. In order to protect various shift sequences, the present invention marks 4 data blocks according to the shift sequence. are a, b, c, and d, and the corresponding shift order is: a→b→c→d→a; at the same time, there are three functions in the above F a , F b , F c , and F d and f 0 , f 1 , f 2 , and f 3 correspond to the same, and there is a function that satisfies: F(x)=x, which is not limited in the present invention.
可选地,若为解密运算,针对密文进行第一次异或运算的公式如下:Optionally, if it is a decryption operation, for the ciphertext The formula to perform the first XOR operation is as follows:
式中,下标d、c、b、a是解密过程按照移位运算中移位顺序依次设置的数据块识别标记,Y表示解密数据,表示密文C中数据块识别标记d对应在第一次异或运算的解密结果,上标N表示轮数,表示第N轮密钥扩展轮运算中得到的识别标记a对应的轮密钥;Fa、Fb、Fc、Fd均为设置的F函数,且在三个公式中F函数与同一识别标记的轮密钥对应的轮运算函数f为同一函数,剩余一个公式中的F函数满足:F(x)=x。In the formula, the subscripts d, c, b, and a are the data block identification marks set sequentially in the decryption process according to the shift sequence in the shift operation, Y represents the decrypted data, Indicates that the data block identification mark d in the ciphertext C corresponds to the decryption result of the first XOR operation, and the superscript N represents the number of rounds, Indicates the round key corresponding to the identification mark a obtained in the Nth round of key expansion round operation; F a , F b , F c , and F d are all set F functions, and in the three formulas, the F function is the same as the same identification The round operation function f corresponding to the marked round key is the same function, and the F function in the remaining formula satisfies: F(x)=x.
同理,解密过程的移位顺序与加密过程恰好相反,本发明解密过程的移位顺序为:d→c→b→a→d,所以加密过程和解密过程同一识别标记表示同一个数据块。同理,上述Fa、Fb、Fc、Fd中存在三个函数与f0、f1、f2、f3对应一致,存在一个函数满足:F(x)=x,此过程中与加密过程是一一对应的。Similarly, the shift sequence of the decryption process is just opposite to that of the encryption process. The shift sequence of the decryption process of the present invention is: d→c→b→a→d, so the same identification mark in the encryption process and the decryption process represents the same data block. Similarly, there are three functions in the above F a , F b , F c , and F d that correspond to f 0 , f 1 , f 2 , and f 3 , and there is a function that satisfies: F(x)=x, in this process There is a one-to-one correspondence with the encryption process.
可选地,针对密文C进行N-1轮异或运算和移位运算得到明文的过程中,每一轮异或运算和移位运算公式如下:Optionally, in the process of performing N-1 rounds of XOR operation and shift operation on ciphertext C to obtain plaintext, the formula for each round of XOR operation and shift operation is as follows:
可选地,步骤S2中初始密钥K的4个子块k0,k1,k2,k3对应在N轮密钥扩展轮运算中,第r轮的轮密钥Kr记为:其中,表示第r轮的轮密钥的四个子块,f0,f1,f2,f3表示四个子块分别对应的轮函数f,其中,轮函数记为:Optionally, the four sub-blocks k 0 , k 1 , k 2 , and k 3 of the initial key K in step S2 correspond to N rounds of key expansion round operations, and the round key K r of the rth round is recorded as: in, Represents the four sub-blocks of the round key of the rth round, f 0 , f 1 , f 2 , f 3 represent the round function f corresponding to the four sub-blocks respectively, where the round function is denoted as:
f:(x0,x1,x2,x3)→(y0,y1,y2,y3)f: (x 0 , x 1 , x 2 , x 3 )→(y 0 , y 1 , y 2 , y 3 )
式中,x0,x1,x2,x3分别表示输入轮函数f的4个子块数据,y0,y1,y2,y3分别表示对应的输出数据,且满足:In the formula, x 0 , x 1 , x 2 , and x 3 respectively represent the four sub-block data of the input round function f, and y 0 , y 1 , y 2 , and y 3 respectively represent the corresponding output data, and satisfy:
本算法在轮函数中加入逻辑与和逻辑非运算进一步提高算法的混淆性,并且轮函数重复使用密钥扩展算法的基础部件,可以进一步提高硬件实现效率。The algorithm adds logical AND and logical NOT operations to the round function to further improve the confusion of the algorithm, and the round function reuses the basic components of the key expansion algorithm, which can further improve the hardware implementation efficiency.
可选地,若L为128,对应每个数据块的长度为32;若L为64,对应每个数据块的长度为16;若L为256,对应每个数据块的长度为64。Optionally, if L is 128, the corresponding length of each data block is 32; if L is 64, the corresponding length of each data block is 16; if L is 256, the corresponding length of each data block is 64.
第二方面,本发明还提供一种基于上述实现方法的装置,包括:In a second aspect, the present invention also provides a device based on the above implementation method, comprising:
数据加载模块:用于获取长度为L明文或密文,以及获取长度为L的初始密钥,Data loading module: used to obtain the plaintext or ciphertext of length L, and to obtain the initial key of length L,
轮密钥生成模块:用于将所述初始密钥的4个子块进行至少N轮密钥扩展轮运算得到4个子块的轮密钥Round key generation module: used to perform at least N rounds of key expansion round operations on the 4 sub-blocks of the initial key to obtain the round keys of the 4 sub-blocks
加解密模块:用于加密运算时,利用轮密钥、待加密数据以及轮运算函数先N-1轮异或运算和移位运算,再进行一轮异或运算得到密文;或用于解密运算时,利用轮密钥、待解密数据以及轮运算函数先进行一次异或运算,再进行N-1轮异或运算和移位运算得到明文。Encryption and decryption module: When used for encryption operation, use the round key, the data to be encrypted and the round operation function to perform N-1 rounds of XOR operation and shift operation, and then perform one round of XOR operation to obtain the ciphertext; or for decryption During the operation, use the round key, the data to be decrypted and the round operation function to perform an XOR operation first, and then perform N-1 rounds of XOR operation and shift operation to obtain the plaintext.
第三方面,本发明还提供一种装置,包括存储器和处理器,所述存储器存储了计算机程序,所述处理器调用所述计算机程序以执行所述轻量级分组密码GFCS实现方法的步骤。In a third aspect, the present invention further provides an apparatus comprising a memory and a processor, wherein the memory stores a computer program, and the processor invokes the computer program to execute the steps of the method for implementing the lightweight block cipher GFCS.
第四方面,本发明还提供一种可读存储介质,存储了计算机程序,所述计算机程序被处理器调用以执行所述轻量级分组密码GFCS实现方法的步骤。In a fourth aspect, the present invention further provides a readable storage medium storing a computer program, the computer program being invoked by a processor to execute the steps of the method for implementing the lightweight block cipher GFCS.
有益效果beneficial effect
本发明提供的所述方法只利用了简单的异或运算以及循环移位运算,并具有良好的混淆扩散能力,进而使得这种轻量级分组密码在保证一定安全性的同时可以进一步节约硬件资源,提高实现效率,且本发明也通过实验对其安全性和效率进行了验证。The method provided by the present invention only utilizes simple XOR operation and cyclic shift operation, and has good confusion and diffusion capability, so that this lightweight block cipher can further save hardware resources while ensuring certain security , the realization efficiency is improved, and the safety and efficiency of the present invention are also verified through experiments.
附图说明Description of drawings
图1是本发明实施例提供的轻量级分组密码GFCS实现方法的架构示意图。FIG. 1 is a schematic structural diagram of a method for implementing a lightweight block cipher GFCS provided by an embodiment of the present invention.
具体实施方式Detailed ways
本发明提供的一种轻量级分组密码GFCS实现方法的目的在于保证分组密码安全性的同时,进一步降低算法的资源占用面积和提高实现效率。本实施例中以明文P的4个数据块的移位顺序可以是按照0→1→2→3→0的顺序依次进行移位为例进行说明,下面将结合实施例对本发明做进一步的说明。The purpose of the light-weight block cipher GFCS implementation method provided by the present invention is to further reduce the resource occupation area of the algorithm and improve the implementation efficiency while ensuring the security of the block cipher. In this embodiment, four data blocks of plaintext P are used The shift sequence of , can be described by taking the sequence of 0→1→2→3→0 as an example for description, and the present invention will be further described below with reference to the embodiments.
本实施例中所述方法包括:The method described in this embodiment includes:
步骤1:将128比特明文/密文及128比特密钥加载至寄存器,作为待加/解密数据。Step 1: Load the 128-bit plaintext/ciphertext and the 128-bit key into the register as data to be encrypted/decrypted.
步骤2:将128比特的初始密钥进行N轮的密钥扩展算法扩展为N个长度为128比特的轮密钥,密钥扩展算法如下:Step 2: Extend the 128-bit initial key to N rounds of key expansion algorithms into N round keys with a length of 128 bits. The key expansion algorithm is as follows:
将初始密钥K分成4个32比特的子块,即K=(k0,k1,k2,k3),第r轮的轮密钥的输入记为 其中4个函数分别表示为fi=f<<<ai(i=0,1,2,3;ai=1,7,11,2)是一组基于异或运算,非运算,与运算和循环移位运算的函数,其中f是作用于输入为32比特的函数,<<<为循环左移运算,记为:f:(x0,x1,x2,x3)→(y0,y1,y2,y3),存在:Divide the initial key K into four 32-bit sub-blocks, namely K=(k 0 , k 1 , k 2 , k 3 ), and the input of the round key of the rth round is denoted as The four functions are respectively expressed as f i =f<<<a i (i=0,1,2,3; a i =1,7,11,2) is a group based on XOR operation, NOT operation, and The function of operation and cyclic shift operation, where f is the function that acts on the input of 32 bits, <<< is the cyclic left shift operation, denoted as: f:(x 0 , x 1 , x 2 , x 3 )→( y 0 , y 1 , y 2 , y 3 ), exist:
其中,r为当前轮数,~、&分别表示异或运算,非运算,与运算。where r is the current round number, ~ and & represent XOR, NOT, and AND respectively.
步骤3:若为加密运算,则加密过程为:Step 3: If it is an encryption operation, the encryption process is:
将输入明文P分成4个长度为32比特的子块,即首先重复执行下列操作N-1次:Divide the input plaintext P into 4 sub-blocks of length 32 bits, namely First repeat the following N-1 times:
其中,r为当前轮数,fi(i=0,1,2)与密钥扩展算法中的前三个函数相同;然后执行下列操作1次:where r is the current round number, f i (i=0,1,2) is the same as the first three functions in the key expansion algorithm; then perform the following operations once:
最后输出密文 The final output ciphertext
若为解密运算,解密过程为:If it is a decryption operation, the decryption process is:
将输入密文C分成4个长度为32比特的子块,即首先,执行下列操作1次:Divide the input ciphertext C into 4 sub-blocks of length 32 bits, namely First, do the following 1 time:
然后,重复执行下列操作N-1次:Then, repeat the following operations N-1 times:
其中,r为当前轮数,fi(i=0,1,2)与密钥扩展算法中的前三个函数相同。最后输出明文 Among them, r is the current round number, and f i (i=0, 1, 2) is the same as the first three functions in the key expansion algorithm. final output plaintext
应当理解,上述实施例中以明文长度或密文长度128为例,本发明并不局限于此实施例;且本实施例中是F3函数满足:F(x)=x。其他F0、F1、F2分别与f0、f1、f2对应,但本发明并不局限于此实施例。It should be understood that in the above embodiment, the plaintext length or the ciphertext length 128 is used as an example, and the present invention is not limited to this embodiment; and in this embodiment, the F3 function satisfies: F(x) = x. The other F 0 , F 1 , and F 2 correspond to f 0 , f 1 , and f 2 respectively, but the present invention is not limited to this embodiment.
在一些可行的方案中,本发明提供了一种基于上述轻量级分组密码GFCS实现方法的装置,包括:In some feasible solutions, the present invention provides a device based on the above-mentioned lightweight block cipher GFCS implementation method, including:
数据加载模块:用于获取长度为L明文或密文,以及获取长度为L的初始密钥,Data loading module: used to obtain the plaintext or ciphertext of length L, and to obtain the initial key of length L,
轮密钥生成模块:用于将所述初始密钥的4个子块进行至少N轮密钥扩展轮运算得到4个子块的轮密钥Round key generation module: used to perform at least N rounds of key expansion round operations on the 4 sub-blocks of the initial key to obtain the round keys of the 4 sub-blocks
加解密模块:用于加密运算时,利用轮密钥、待加密数据以及轮运算函数先N-1轮异或运算和移位运算,再进行一轮异或运算得到密文;或用于解密运算时,利用轮密钥、待解密数据以及轮运算函数先进行一次异或运算,再进行N-1轮异或运算和移位运算得到明文。Encryption and decryption module: When used for encryption operation, use the round key, the data to be encrypted and the round operation function to perform N-1 rounds of XOR operation and shift operation, and then perform one round of XOR operation to obtain the ciphertext; or for decryption During the operation, use the round key, the data to be decrypted and the round operation function to perform an XOR operation first, and then perform N-1 rounds of XOR operation and shift operation to obtain the plaintext.
具体各个模块的实现过程请参照上述方法的内容,在此不再赘述。应该理解到,上述功能模块的划分仅仅是一种逻辑功能的划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。同时,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。For the specific implementation process of each module, please refer to the content of the above method, which will not be repeated here. It should be understood that the division of the above functional modules is only a division of logical functions, and other division methods may be used in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored. or not. Meanwhile, the above-mentioned integrated units may be implemented in the form of hardware, and may also be implemented in the form of software functional units.
在一些可行的方案中,本发明还提供一种装置,包括存储器和处理器,所述存储器存储了计算机程序,所述处理器调用所述计算机程序以执行所述轻量级分组密码GFCS实现方法的步骤。In some feasible solutions, the present invention also provides an apparatus including a memory and a processor, the memory stores a computer program, and the processor invokes the computer program to execute the lightweight block cipher GFCS implementation method A step of.
在一些可行的方案中,本发明还提供一种可读存储介质,存储了计算机程序,所述计算机程序被处理器调用以执行所述轻量级分组密码GFCS实现方法的步骤。In some feasible solutions, the present invention also provides a readable storage medium storing a computer program, the computer program being invoked by a processor to execute the steps of the method for implementing the lightweight block cipher GFCS.
其中,具体的实现过程还可以参照上述方法内容。应当理解,在本发明实施例中,所称处理器可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable GateArray,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。存储器可以包括只读存储器和随机存取存储器,并向处理器提供指令和数据。存储器的一部分还可以包括非易失性随机存取存储器。例如,存储器还可以存储设备类型的信息。The specific implementation process may also refer to the content of the above method. It should be understood that, in this embodiment of the present invention, the processor may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The memory, which may include read-only memory and random access memory, provides instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store device type information.
所述可读存储介质为计算机可读存储介质,其可以是前述任一实施例所述的控制器的内部存储单元,例如控制器的硬盘或内存。所述可读存储介质也可以是所述控制器的外部存储设备,例如所述控制器上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述可读存储介质还可以既包括所述控制器的内部存储单元也包括外部存储设备。所述可读存储介质用于存储所述计算机程序以及所述控制器所需的其他程序和数据。所述可读存储介质还可以用于暂时地存储已经输出或者将要输出的数据。The readable storage medium is a computer-readable storage medium, which may be an internal storage unit of the controller described in any of the foregoing embodiments, such as a hard disk or a memory of the controller. The readable storage medium may also be an external storage device of the controller, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the controller card, flash card (Flash Card) and so on. Further, the readable storage medium may also include both an internal storage unit of the controller and an external storage device. The readable storage medium is used to store the computer program and other programs and data required by the controller. The readable storage medium can also be used to temporarily store data that has been output or is to be output.
实验验证:Experimental verification:
本发明GFCS-128算法迭代40轮的测试数据如表1所示:The test data of the GFCS-128 algorithm iteration of the present invention for 40 rounds are shown in Table 1:
表1 GFCS算法测试数据Table 1 GFCS algorithm test data
本发明所述的GFCS密码算法在ASIC进行硬件实现,同时在Synopsys DesignCompiler Version B-2008.09进行综合,其中综合工艺库为SMIC 0.18um,在综合实验中,面积资源单位为1622GE。GFCS-128算法所占用的资源面积是1622GE。各轻量级分组密码算法实现面积比较如表2所示。The GFCS cryptographic algorithm of the present invention is implemented in hardware in ASIC and synthesized in Synopsys DesignCompiler Version B-2008.09, wherein the integrated process library is SMIC 0.18um, and in the comprehensive experiment, the area resource unit is 1622GE. The resource area occupied by the GFCS-128 algorithm is 1622GE. The implementation area comparison of each lightweight block cipher algorithm is shown in Table 2.
表2各轻量级分组密码算法实现面积比较Table 2 Comparison of the implementation area of each lightweight block cipher algorithm
需要强调的是,本发明所述的实例是说明性的,而不是限定性的,因此本发明不限于具体实施方式中所述的实例,凡是由本领域技术人员根据本发明的技术方案得出的其他实施方式,不脱离本发明宗旨和范围的,不论是修改还是替换,同样属于本发明的保护范围。It should be emphasized that the examples described in the present invention are illustrative rather than restrictive, so the present invention is not limited to the examples described in the specific implementation manner, and all those obtained by those skilled in the art according to the technical solutions of the present invention Other embodiments that do not depart from the spirit and scope of the present invention, whether modified or replaced, also belong to the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011254102.8A CN112202547B (en) | 2020-11-11 | 2020-11-11 | A lightweight block cipher GFCS implementation method, device and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011254102.8A CN112202547B (en) | 2020-11-11 | 2020-11-11 | A lightweight block cipher GFCS implementation method, device and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112202547A CN112202547A (en) | 2021-01-08 |
CN112202547B true CN112202547B (en) | 2022-04-12 |
Family
ID=74033409
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011254102.8A Active CN112202547B (en) | 2020-11-11 | 2020-11-11 | A lightweight block cipher GFCS implementation method, device and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112202547B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112910630B (en) * | 2021-02-02 | 2022-12-06 | 浙江大华技术股份有限公司 | Method and device for replacing expanded key |
CN113452508B (en) * | 2021-08-27 | 2021-12-10 | 北京华云安信息技术有限公司 | Data encryption method, device, equipment and computer readable storage medium |
CN114070552B (en) * | 2021-10-28 | 2022-11-08 | 国核自仪系统工程有限公司 | Data encryption method and device, data decryption method and device, equipment and medium |
CN114598470B (en) * | 2022-03-17 | 2023-12-19 | 北京启明星辰信息安全技术有限公司 | Encryption method, decryption method, device, and computer-readable storage medium |
CN115694796A (en) * | 2022-10-08 | 2023-02-03 | 国网江苏省电力有限公司电力科学研究院 | Internet of things security encryption method and device, storage medium and electronic equipment |
CN115987489B (en) * | 2022-12-28 | 2023-10-20 | 北京电子科技学院 | Lightweight encryption and decryption method and device and storage medium |
CN118869192A (en) * | 2024-07-04 | 2024-10-29 | 北京海泰方圆科技股份有限公司 | Dynamic packet length encryption method, device, equipment and storage medium |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111431697A (en) * | 2020-03-31 | 2020-07-17 | 衡阳师范学院 | A New Lightweight Block Cipher CORL Implementation Method |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW556111B (en) * | 1999-08-31 | 2003-10-01 | Toshiba Corp | Extended key generator, encryption/decryption unit, extended key generation method, and storage medium |
KR101330664B1 (en) * | 2012-06-15 | 2013-11-15 | 한국전자통신연구원 | Low power encryption apparatus and method |
CN104333446B (en) * | 2014-11-10 | 2016-01-13 | 衡阳师范学院 | A new ultra-lightweight QTL block cipher implementation method |
CN109768854B (en) * | 2019-03-29 | 2020-02-04 | 衡阳师范学院 | Method for realizing lightweight block cipher algorithm |
CN111245598B (en) * | 2020-03-31 | 2022-06-14 | 衡阳师范学院 | A Realization Method of Lightweight AEROGEL Block Cipher |
CN111464564B (en) * | 2020-05-08 | 2022-12-23 | 郑州信大捷安信息技术股份有限公司 | Data high-speed encryption and decryption method and device based on symmetric cryptographic algorithm |
-
2020
- 2020-11-11 CN CN202011254102.8A patent/CN112202547B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111431697A (en) * | 2020-03-31 | 2020-07-17 | 衡阳师范学院 | A New Lightweight Block Cipher CORL Implementation Method |
Also Published As
Publication number | Publication date |
---|---|
CN112202547A (en) | 2021-01-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112202547B (en) | A lightweight block cipher GFCS implementation method, device and readable storage medium | |
CN101626289B (en) | Design method of AES encryption chip and computer encryptor | |
CN104639314A (en) | Device based on AES (advanced encryption standard) encryption/decryption algorithm and pipelining control method | |
CN102006161B (en) | Nonlinear transformation method for symmetric key encryption and implementation method thereof | |
CN1648967A (en) | Cryptographic apparatus, cryptographic method, and storage medium thereof | |
CN106254062A (en) | Stream cipher realizes device and sequential cipher realization method thereof | |
Lu et al. | A compact, lightweight and low-cost 8-bit datapath AES circuit for IOT applications in 28nm CMOS | |
US20110261958A1 (en) | Table splitting for cryptographic processes | |
CN114640454A (en) | Cryptosystem of post-quantum cryptography Kyber protocol | |
CN102664730B (en) | 128 bit secret key expansion method based on AES (Advanced Encryption Standard) | |
CN112134691A (en) | Method, device and medium for realizing NLCS block cipher with repeatable components | |
CN106982116B (en) | A Local File Encryption Method Based on AES Based on Reversible Logic Circuit | |
CN113949504B (en) | High-speed SM4 cryptographic algorithm circuit suitable for mobile device | |
CN111478766B (en) | Method, device and storage medium for realizing block cipher MEG | |
CN105472602A (en) | Encryption device and encryption method | |
JP2004054128A (en) | Encrypting system | |
CN111314054B (en) | A lightweight ECEG block cipher implementation method, system and storage medium | |
Duc et al. | Hardware implementation of AES with S-Box using composite-field for WLAN systems | |
CN107171782B (en) | AES private log encryption method based on reversible logic circuit | |
CN114826560B (en) | Lightweight block cipher CREF implementation method and system | |
CN109039608B (en) | An 8-bit AES circuit based on dual S cores | |
CN111614457A (en) | Improved lightweight packet encryption and decryption method, device and storage medium based on P permutation | |
JP2004078053A (en) | Ciphering device | |
CN116647328A (en) | Lightweight block cipher realization method and system of novel PSP structure | |
CN112054889B (en) | Method and device for generating message authentication code and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20231208 Address after: 421000 Northwest storefront on the second floor of Linghu Township Sports Center, Zhuhui District, Hengyang City, Hunan Province Patentee after: Hengyang Hengjiu Space Decoration Design Engineering Co.,Ltd. Address before: 421002 Hengyang Teachers College, No.16, Henghua Road, Zhuhui District, Hengyang City, Hunan Province Patentee before: Hengyang Normal University |
|
TR01 | Transfer of patent right |