WO2018165949A1 - Des软件防dpa攻击的方法及装置 - Google Patents
Des软件防dpa攻击的方法及装置 Download PDFInfo
- Publication number
- WO2018165949A1 WO2018165949A1 PCT/CN2017/076972 CN2017076972W WO2018165949A1 WO 2018165949 A1 WO2018165949 A1 WO 2018165949A1 CN 2017076972 W CN2017076972 W CN 2017076972W WO 2018165949 A1 WO2018165949 A1 WO 2018165949A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- mask
- des
- msp
- dynamic
- random number
- Prior art date
Links
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/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
-
- 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/002—Countermeasures against attacks on cryptographic mechanisms
- H04L9/003—Countermeasures against attacks on cryptographic mechanisms for power analysis, e.g. differential power analysis [DPA] or simple power analysis [SPA]
Definitions
- the present invention relates to the field of information security technologies, and in particular, to a method and apparatus for defending against DPA attacks by DES software.
- the DES algorithm is a widely used symmetric encryption/decryption algorithm.
- the DES algorithm changes a 64-bit plaintext input block into a 64-bit ciphertext output block. Its function is to re-enter the input 64-bit data block. Combine, and divide the output into two parts, L0 and R0, each part is 32 bits long, and the initial replacement is performed, that is, the ciphertext output is obtained.
- the F functions of each round of the DES algorithm include extended permutation, XOR with key, S-box substitution, and P-box permutation.
- the S box whose English name is Substitution-box, is the basic structure for the symmetric key algorithm to perform permutation calculations.
- the S-box is used in the block cipher algorithm and is a non-linear structure.
- the cipher strength directly determines the quality of the cipher algorithm.
- the DES mask scheme is convenient for hardware implementation against DPA attacks, but in the hardware DES cryptographic device, the 8 S-box implementations of each round of operation in the DES coprocessor are parallel, and the output of each S-box is parallel. It accounts for 4 bits (l/8 length) after P replacement, so the effect on the energy of the S box output always exists regardless of the position after the P replacement. If the 6-bit subkey of an S box is used as the target, then the remaining 28 bits of the output result are noise except for the 4 bit output of the S box. In response to this weakness, there are now related high-level cracking methods.
- the main object of the present invention is to provide a DES software anti-DPA attack method and apparatus, aiming at solving the problem that the DE S software is attacked by DPA high-order attacks.
- the present invention provides a method for defending against DPA attacks by DES software, including
- the IP is inversely permuted by the mask RX12 and the mask RXwork to obtain IjDES encrypted data.
- the step of generating a dynamic mask MSP according to the mask SP is characterized in that,
- a dynamic mask MSP is generated by the mask SP.
- the obtaining the random number as the mask S, before the step of assigning the mask RX12 and the mask SP includes,
- the IP is generated by a basic DES mask scheme.
- the step of acquiring a random number as the mask S includes:
- a 32-byte random number is obtained as the mask S.
- the present invention also provides a device for preventing DPA attacks by DES software, including
- obtaining an assignment unit configured to obtain a random number as a mask S, and assign the value of the mask S to the mask RX12 and the mask SP;
- the first generating unit is configured to generate a dynamic mask MSP according to the mask SP;
- an initial replacement unit configured to perform initial replacement on the IP using the mask RX12;
- an arithmetic unit configured to perform 16 rounds of the same operation using the mask RX12, the mask S, and the dynamic mask MSP
- an inverse permutation unit configured to perform inverse permutation of the IP by the mask RX12 and the mask RXwork to obtain DES encrypted data.
- the first generating unit includes a production module, configured to generate a dynamic mask MSP by using a mask SP on the basis of the static masks SP1-SP8.
- a second generating unit is further included, configured to generate an IP by using a basic DES masking scheme.
- the acquisition and assignment unit includes an acquisition module, configured to acquire a 32-byte random number as Mask s.
- the beneficial effects of the present invention are: based on the static masks SP1-SP8, the dynamic mask MSP is generated by the mask SP, and the 16-round operation is performed by the dynamic mask MSP, which is simple and effective, and can be realized for high Protection against DPA attacks.
- FIG. 1 is a schematic flowchart of a method for preventing a DPA attack by a DES software according to an embodiment of the present invention
- FIG. 2 is a schematic flowchart of a method for preventing a DPA attack by a DES software according to another embodiment of the present invention
- FIG. 3 is a structural block diagram of an apparatus for preventing a DPA attack by a DES software according to an embodiment of the present invention.
- first, second and the like in the present invention are used for the purpose of description only, and are not to be construed as indicating or implying their relative importance or implicitly indicating the number of technical features indicated.
- features defining “first” and “second” may include at least one of the features, either explicitly or implicitly.
- the technical solutions between the various embodiments may be combined with each other, but must be based on the realization of those skilled in the art, and when the combination of the technical solutions is contradictory or impossible to implement, it should be considered that the combination of the technical solutions does not exist. It is also within the scope of protection required by the present invention.
- DES English full name: Data Encryption Standard
- DES is a group symmetric cryptographic algorithm
- DES algorithm changes 64-bit plaintext input block into 64-bit ciphertext output block
- Its function is to recombine the input 64-bit data block in bits, and divide the output into two parts, L0 and R0. Each part is 32 bits long, and the initial replacement is performed, that is, the ciphertext output is obtained.
- the F functions of each round of the DES algorithm include extended permutation, XOR with key, S-box substitution, and P-box permutation.
- the S box is the basic structure of the symmetric key algorithm to perform permutation calculation.
- the S-box is used in the block cipher algorithm and is a non-linear structure.
- the cipher strength directly determines the quality of the cipher algorithm.
- the present invention provides a method for defending against DPA attacks by a DES software, including the following steps:
- [0045] 514 Perform 16 rounds of the same operation using the mask RX12, the mask S, and the dynamic mask MSP.
- step S1 l a random number is obtained as the mask S, and the random number can be a 32-byte random number.
- the value of the mask S is assigned to the mask RX12 and the mask SP.
- the mask RX12 is required for subsequent calculations, such as the initial replacement of IP and the inverse of IP.
- step S12 the dynamic mask MSP is generated according to the mask SP, the dynamic mask MSP is generated by the mask SP, and the 16-round operation is performed by the dynamic mask MSP, which is simple and effective, and the DES algorithm pair can be implemented. Protection against high-level DPA attacks improves the security of cryptographic devices.
- the specific execution code of step S12 is as follows:
- dynamicSPx[i][j] SPx[j A maskbits] A MSP[l].
- step S13 the IP is initialized and replaced by the mask RX12, and the initialization is replaced by: the input 64-bit data block is recombined in bits, and the output is divided into two parts, L0 and R0, each part is 32 bits long. .
- the mask RX12 is added during the initialization and replacement of the IP to improve the security of the DES algorithm.
- the specific execution code of step S13 is as follows:
- step S14 16 rounds of the same calculation are performed by using the mask RX12, the mask S, and the dynamic mask MSP to ensure the complexity of the encryption, and 16 rounds of the same calculation can be performed by using the dynamic mask MSP to improve the DES algorithm pair.
- the protection of high-order DPA attacks further improves the security of cryptographic devices.
- step S15 finally, the IP processed by the above step is inversely replaced by the mask RX12 and the mask RXwork, and the final DES encrypted data can be obtained.
- the execution code of step S15 is:
- a DES software anti-DPA attack method based on the static mask SP1-SP8, generates a dynamic mask MSP through a mask SP, and performs 16 round operations through a dynamic mask MSP, which is simple and effective, and can be Implement protection against high-level DPA attacks.
- a method for preventing a DPA attack by a DES software includes the following steps:
- S20 Generate an IP by using a basic DES masking scheme.
- S21 Obtain a 32-byte random number as the mask S, and assign the value of the mask S to the mask RX12 and the mask. Code SP.
- step S20 the IP generation scheme is consistent with the basic DES mask scheme, which is simple and straightforward, and no additional design is required.
- step S21 a random number is obtained as the mask S, and the random number is a 32-byte random number.
- the value of the mask S is assigned to the mask RX12 and the mask SP, For subsequent calculations, such as the initial replacement of IP and the inverse of IP, the mask RX12 is required.
- step S22 a dynamic mask MSP is generated according to the mask SP described above, and a dynamic mask MSP is generated by the mask SP on the basis of the static masks SP1-SP8, and then performed by the dynamic mask MSP.
- the round operation is simple and effective, and the DES algorithm can be protected against high-order DPA attacks, and the security of the cryptographic device can be improved.
- the specific execution code of step S22 is as follows:
- dynamicSPx[i][j] SPx[j A maskbits] A MSP[l].
- step S23 the IP is initialized and replaced by the mask RX12, and the initialization is replaced by: the input 64-bit data block is recombined in bits, and the output is divided into two parts, L0 and R0, each part is 32 bits long. .
- the mask RX12 is added during the initialization and replacement of the IP to improve the security of the DES algorithm.
- the specific execution code of step S23 is as follows:
- step S24 16 rounds of the same calculation are performed by using the mask RX12, the mask S, and the dynamic mask MSP to ensure the complexity of the encryption, and 16 rounds of the same calculation can be performed by using the dynamic mask MSP to improve the DES algorithm pair.
- the protection of high-order DPA attacks further improves the security of cryptographic devices.
- step S25 finally, the IP processed by the above step is processed by the mask RX12 and the mask RXwork. Inverse permutation, the final DES encrypted data can be obtained.
- the execution code of step S25 is:
- a DES software anti-DPA attack method based on the static mask SP1-SP8, generates a dynamic mask MSP through a mask SP, and performs 16 round operations through a dynamic mask MSP, which is simple and effective, and can be Implement protection against high-level DPA attacks.
- the present invention also provides a device for preventing DPA attacks by DES software, including:
- the second generating unit 10 is configured to generate an IP by using a basic DES masking scheme.
- the obtaining value unit 20 is configured to obtain a random number as the mask S, and the value of the mask S is given to the mask RX1 2 and the mask SP.
- the first generating unit 30 is configured to generate a dynamic mask MSP according to the mask SP.
- an initial replacement unit 40 configured to perform initial replacement on the IP using the mask RX12;
- the operation unit 50 is configured to perform 16 rounds of the same operation using the mask RX12, the mask S, and the dynamic mask MSP.
- the inverse permutation unit 60 is configured to perform inverse permutation of the IP by using the mask RX12 and the mask RXwork to obtain DES encrypted data.
- the IP generation scheme is consistent with the basic DES mask scheme, which is simple and straightforward, and no additional design is required.
- a random number is obtained as the mask S, and the random number may be a 32-byte random number.
- the value of the mask S is assigned to the mask RX12 and the mask. SP, for subsequent calculations, such as initial replacement of IP and inverse IP replacement, need to use mask RX12.
- the acquisition assignment unit 20 includes an acquisition module for acquiring a 32-byte random number as the mask S.
- the dynamic mask MSP is generated according to the mask SP, the dynamic mask MSP is generated by the mask SP, and the 16-round operation is performed by the dynamic mask MSP, which is simple and effective, and can implement DES.
- the algorithm protects against high-order DPA attacks and improves the security of cryptographic devices.
- First generating unit including There is a production module for generating a dynamic mask M SP by mask SP on the basis of static masks SP1-SP8.
- the IP is initialized and replaced by the mask RX12, and the initialization is replaced by:
- the input 64-bit data block is recombined in bits, and the output is divided into two parts, L0 and R0, each part is long. 3 2 digits.
- the mask RX12 is added during the initialization and replacement of the IP to improve the security of the DES algorithm.
- the over-mask RX12, the mask S, and the dynamic mask MSP perform 16 rounds of the same calculation to ensure the complexity of encryption, and the same calculation can be performed by dynamic mask MSP for 16 rounds, and the DES algorithm can be improved. Protection against high-level DPA attacks further enhances the security of cryptographic devices.
- the inverse permutation unit 60 finally obtains the final DES encrypted data by performing inverse permutation on the IP processed in the above step by using the mask RX12 and the mask RXwork.
- a device for preventing DPA attacks by the DES software based on the static mask SP1-SP8, generates a dynamic mask MSP through the mask SP, and performs 16 round operations through the dynamic mask MSP, which is simple and effective, and can be Implement protection against high-level DPA attacks.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Storage Device Security (AREA)
Abstract
本发明揭示了DES软件防DPA攻击的方法及装置,方法:获取随机数作为掩码S,将该值赋予掩码RX12和SP;根据掩码SP生成动态掩码;使用掩码RX12 对IP进行初始化置换;使用掩码RX12、S和动态掩码进行16轮运算;通过掩码RX12和RXwork对IP逆置换得到加密数据。可以防护高阶DPA的攻击。
Description
DES软件防 DPA攻击的方法及装置 技术领域
[0001] 本发明涉及到信息安全技术领域, 特别是涉及到一种 DES软件防 DPA攻击的方 法及装置。
背景技术
[0002] DES算法是一种应用较广的对称加 /解密算法, DES算法将 64位的明文输入块变 化成 64位的密文输出块, 其功能是把输入的 64位数据块按位重新组合, 并把输 出分为 L0、 R0两部分, 每部分各长 32位, 进行初始置换, 即得密文输出。 其中 每一轮 DES算法的 F函数包括扩展置换、 与密钥的异或、 S盒代换和 P盒置换。 S 盒, 英文名称为 Substitution-box, 是对称密钥算法执行置换计算的基本结构。 S 盒用在分组密码算法中, 是非线性结构, 其密码强度直接决定了密码算法的好 坏。
[0003] 随着金融 P0S终端的安全要求越来越高, 作为金融 P0S终端采用的重要的加密 算法 DES对 DPA攻击的防护要求也越来越高。 采用掩码算法的密码算法仍然可以 用高阶 DPA进行攻击, 为了防护高阶 DPA攻击, 需要对 S盒算法进行改造, 使得 改造后的算法可以防护高级 DPA攻击。
[0004] 当前, DES掩码方案进行防 DPA攻击用硬件实现方便, 但是在硬件 DES密码设 备中, DES协处理器中每轮运算的 8个 S盒实现是并行的, 每个 S盒的输出占 P置 换后的 4bit(l/8长度), 因此不管 S盒输出在 P置换后位置如何变化, 其对能量的影 响是始终存在的。 如果以一个 S盒的 6bit子密钥作为攻击目标, 那么在 P置换输出 结果中除了改 S盒的 4bit输出外, 其余 28bit输出结果都是噪声。 针对此弱点, 现 在已有相关高阶破解方法。
技术问题
[0005] 本发明的主要目的为提供一种 DES软件防 DPA攻击的方法及装置, 旨在解决 DE S软件被 DPA高阶攻击的问题。
问题的解决方案
技术解决方案
[0006] 本发明提出一种 DES软件防 DPA攻击的方法, 包括,
[0007] 获取随机数作为掩码 S, 同吋将掩码 S的值赋予掩码 RX12和掩码 SP;
[0008] 根据掩码 SP生成动态掩码 MSP;
[0009] 使用掩码 RX12对 IP进行初始化置换;
[0010] 使用掩码 RX12、 掩码 S以及动态掩码 MSP进行 16轮相同的运算;
[0011] 通过掩码 RX12和掩码 RXwork对 IP进行逆置换得至 IjDES加密数据。
[0012] 进一步地, 所述根据掩码 SP生成动态掩码 MSP的步骤, 其特征在于, 包括,
[0013] 在静态的掩码 SP1-SP8的基础上, 通过掩码 SP生成动态掩码 MSP。
[0014] 进一步地, 所述获取随机数作为掩码 S, 同吋赋予掩码 RX12和掩码 SP的步骤之 前, 包括,
[0015] 通过基础 DES掩码方案生成 IP。
[0016] 进一步地, 所述获取随机数作为掩码 S的步骤, 包括,
[0017] 获取 32个字节的随机数作为掩码 S。
[0018]
[0019] 本发明还提出了一种 DES软件防 DPA攻击的装置, 包括,
[0020] 获取赋值单元, 用于获取随机数作为掩码 S, 同吋将掩码 S的值赋予掩码 RX12 和掩码 SP;
[0021] 第一生成单元, 用于根据掩码 SP生成动态掩码 MSP;
[0022] 初始置换单元, 用于使用掩码 RX12对 IP进行初始化置换;
[0023] 运算单元, 用于使用掩码 RX12、 掩码 S以及动态掩码 MSP进行 16轮相同的运算
[0024] 逆置换单元, 用于通过掩码 RX12和掩码 RXwork对 IP进行逆置换得到 DES加密 数据。
[0025] 进一步地, 所述第一生成单元包括有生产模块, 用于在静态的掩码 SP1-SP8的 基础上, 通过掩码 SP生成动态掩码 MSP。
[0026] 进一步地, 还包括有第二生成单元, 用于通过基础 DES掩码方案生成 IP。
[0027] 进一步地, 所述获取赋值单元包括获取模块, 用于获取 32个字节的随机数作为
掩码 s。
发明的有益效果
有益效果
[0028] 本发明的有益效果是: 在静态的掩码 SP1-SP8的基础上, 通过掩码 SP生成动态 掩码 MSP, 再通过动态掩码 MSP进行 16轮运算, 简单有效, 可以实现对于高阶 D PA攻击的防护。
对附图的简要说明
附图说明
[0029] 图 1为本发明一实施例的 DES软件防 DPA攻击的方法的流程示意图;
[0030] 图 2为本发明另一实施例的 DES软件防 DPA攻击的方法的流程示意图;
[0031] 图 3为本发明一实施例的 DES软件防 DPA攻击的装置的结构框图。
[0032]
[0033] 本发明目的的实现、 功能特点及优点将结合实施例, 参照附图做进一步说明。
实施该发明的最佳实施例
本发明的最佳实施方式
[0034] 应当理解, 此处所描述的具体实施例仅仅用以解释本发明, 并不用于限定本发 明。
[0035] 在本发明中涉及"第一"、 "第二"等的描述仅用于描述目的, 而不能理解为指示 或暗示其相对重要性或者隐含指明所指示的技术特征的数量。 由此, 限定有 "第 一"、 "第二 "的特征可以明示或者隐含地包括至少一个该特征。 另外, 各个实施 例之间的技术方案可以相互结合, 但是必须是以本领域普通技术人员能够实现 为基础, 当技术方案的结合出现相互矛盾或无法实现吋应当认为这种技术方案 的结合不存在, 也不在本发明要求的保护范围之内。
[0036] 本技术领域技术人员可以理解, 除非特意声明, 这里使用的单数形式"一"、 " 一个"、 "所述 "和"该"也可包括复数形式。 应该进一步理解的是, 本实用新型的 说明书中使用的措辞"包括"是指存在所述特征、 整数、 步骤、 操作、 元件和 /或 组件, 但是并不排除存在或添加一个或多个其他特征、 整数、 步骤、 操作、 元
件、 组件和 /或它们的组。 这里使用的措辞"和 /或"包括一个或更多个相关联的列 出项的全部或任一单元和全部组合。
[0037] 本技术领域技术人员可以理解, 除非另外定义, 这里使用的所有术语 (包括技 术术语和科学术语) , 具有与本实用新型所属领域中的普通技术人员的一般理 解相同的意义。 还应该理解的是, 诸如通用字典中定义的那些术语, 应该被理 解为具有与现有技术的上下文中的意义一致的意义, 并且除非像这里一样被特 定定义, 否则不会用理想化或过于正式的含义来解释。
[0038] DES, 英文全称: Data Encryption Standard, 是分组对称密码算法, 是一种应 用较广的对称加 /解密算法, DES算法将 64位的明文输入块变化成 64位的密文输 出块, 其功能是把输入的 64位数据块按位重新组合, 并把输出分为 L0、 R0两部 分, 每部分各长 32位, 进行初始置换, 即得密文输出。 其中每一轮 DES算法的 F 函数包括扩展置换、 与密钥的异或、 S盒代换和 P盒置换。
[0039] S盒, 英文名称为 Substitution-box, 是对称密钥算法执行置换计算的基本结构。
S盒用在分组密码算法中, 是非线性结构, 其密码强度直接决定了密码算法的好 坏。
[0040]
[0041] 参照图 1, 提出本发明一实施例, 本发明提出一种 DES软件防 DPA攻击的方法 , 包括以下步骤:
[0042] 511、 获取随机数作为掩码 S, 同吋将掩码 S的值赋予掩码 RX12和掩码 SP。
[0043] 512、 根据掩码 SP生成动态掩码 MSP。
[0044] 513、 使用掩码 RX12对 IP进行初始化置换。
[0045] 514、 使用掩码 RX12、 掩码 S以及动态掩码 MSP进行 16轮相同的运算。
[0046] 515、 通过掩码 RX12和掩码 RXwork对 IP进行逆置换得到 DES加密数据。
[0047] 对于步骤 Sl l, 获取一个随机数作为掩码 S, 随机数可以为 32个字节的随机数, 掩码 S的值之后, 将掩码 S的值赋予掩码 RX12和掩码 SP, 以用于后续的计算, 例 如对 IP的初始置换和对 IP逆置换都需要用到掩码 RX12。
[0048] 对于步骤 S12, 根据上述的掩码 SP, 生成动态掩码 MSP, 通过掩码 SP生成动态 掩码 MSP, 再通过动态掩码 MSP进行 16轮运算, 简单有效, 可以实现 DES算法对
于高阶 DPA攻击的防护, 提高密码设备的安全性。 在本发明一具体实施例中, 步骤 S12具体的执行代码如下:
[0049] maskbits = (MSP[0]»24)&0x3F;
[0050] dynamicSPx[i][j] = SPx[jAmaskbits]AMSP[l]。
[0051] 对于步骤 S13, 利用掩码 RX12, 对 IP进行初始化置换, 初始化置换为: 输入的 64位数据块按位重新组合, 并把输出分为 L0、 R0两部分, 每部分各长 32位。 在 对 IP进行初始化置换的过程中加入掩码 RX12, 提高 DES算法的安全性。 在本发 明一具体实施例中, 步骤 S13具体的执行代码如下:
[0052] leftt= block[0];
[0053] right= block[l];
[0054] lefttA= RX12[0];
[0055] rightA= RX12[l];
[0056] 对于步骤 S14, 通过掩码 RX12、 掩码 S以及动态掩码 MSP进行 16轮相同的计算 , 确保加密的复杂度, 通过动态掩码 MSP进行 16轮相同的计算可以, 提高 DES算 法对高阶 DPA攻击的防护, 进一步提高密码设备的安全性。
[0057] 对于步骤 S 15, 最终, 通过掩码 RX12和掩码 RXwork对上述步骤处理后的 IP进 行逆置换, 可以得到最终的 DES加密数据。 在本发明一实施例中, 步骤 S15的执 行代码为:
[0058] lefttA= RX12[0];
[0059] rightA= RX12[l];
[0060] workA= RXwork;
[0061] 一种 DES软件防 DPA攻击的方法, 在静态的掩码 SP1-SP8的基础上, 通过掩码 S P生成动态掩码 MSP, 再通过动态掩码 MSP进行 16轮运算, 简单有效, 可以实现 对于高阶 DPA攻击的防护。
[0062]
[0063] 本发明另一实施例中, 一种 DES软件防 DPA攻击的方法, 包括以下步骤:
[0064] S20、 通过基础 DES掩码方案生成 IP。
[0065] S21、 获取 32个字节的随机数作为掩码 S, 同吋将掩码 S的值赋予掩码 RX12和掩
码 SP。
[0066] S22、 在静态的掩码 SP1-SP8的基础上, 通过掩码 SP生成动态掩码 MSP。
[0067] S23、 使用掩码 RX12对 IP进行初始化置换。
[0068] S24、 使用掩码 RX12、 掩码 S以及动态掩码 MSP进行 16轮相同的运算。
[0069] S25、 通过掩码 RX12和掩码 RXwork对 IP进行逆置换得到 DES加密数据。
[0070] 对于步骤 S20, IP的生成方案与基础的 DES掩码方案一致, 简单直接, 无需再 进行额外的设计。
[0071] 对于步骤 S21, 获取一个随机数作为掩码 S, 随机数为 32个字节的随机数, 掩码 S的值之后, 将掩码 S的值赋予掩码 RX12和掩码 SP, 以用于后续的计算, 例如对 I P的初始置换和对 IP逆置换都需要用到掩码 RX12。
[0072] 对于步骤 S22, 根据上述的掩码 SP, 生成动态掩码 MSP, 在静态的掩码 SP1-SP8 的基础上, 通过掩码 SP生成动态掩码 MSP, 再通过动态掩码 MSP进行 16轮运算 , 简单有效, 可以实现 DES算法对于高阶 DPA攻击的防护, 提高密码设备的安全 性。 在本发明一实施例中, 步骤 S22具体的执行代码如下:
[0073] maskbits = (MSP[0]»24)&0x3F;
[0074] dynamicSPx[i][j] = SPx[jAmaskbits]AMSP[l]。
[0075] 对于步骤 S23, 利用掩码 RX12, 对 IP进行初始化置换, 初始化置换为: 输入的 64位数据块按位重新组合, 并把输出分为 L0、 R0两部分, 每部分各长 32位。 在 对 IP进行初始化置换的过程中加入掩码 RX12, 提高 DES算法的安全性。 在本发 明一具体实施例中, 步骤 S23具体的执行代码如下:
[0076] leftt= block[0];
[0077] right= block[l];
[0078] lefttA= RX12[0];
[0079] rightA= RX12[l];
[0080] 对于步骤 S24, 通过掩码 RX12、 掩码 S以及动态掩码 MSP进行 16轮相同的计算 , 确保加密的复杂度, 通过动态掩码 MSP进行 16轮相同的计算可以, 提高 DES算 法对高阶 DPA攻击的防护, 进一步提高密码设备的安全性。
[0081] 对于步骤 S25, 最终, 通过掩码 RX12和掩码 RXwork对上述步骤处理后的 IP进
行逆置换, 可以得到最终的 DES加密数据。 在本发明一具体实施例中, 步骤 S25 的执行代码为:
[0082] lefttA= RX12[0];
[0083] rightA= RX12[l];
[0084] workA= RXwork;
[0085] 一种 DES软件防 DPA攻击的方法, 在静态的掩码 SP1-SP8的基础上, 通过掩码 S P生成动态掩码 MSP, 再通过动态掩码 MSP进行 16轮运算, 简单有效, 可以实现 对于高阶 DPA攻击的防护。
[0086]
[0087] 本发明还提出了一种 DES软件防 DPA攻击的装置, 包括:
[0088] 第二生成单元 10, 用于通过基础 DES掩码方案生成 IP。
[0089] 获取赋值单元 20, 用于获取随机数作为掩码 S, 同吋将掩码 S的值赋予掩码 RX1 2和掩码 SP。
[0090] 第一生成单元 30, 用于根据掩码 SP生成动态掩码 MSP。
[0091] 初始置换单元 40, 用于使用掩码 RX12对 IP进行初始化置换;
[0092] 运算单元 50, 用于使用掩码 RX12、 掩码 S以及动态掩码 MSP进行 16轮相同的运 算。
[0093] 逆置换单元 60, 用于通过掩码 RX12和掩码 RXwork对 IP进行逆置换得到 DES加 密数据。
[0094] 对于第二生成单元 10, IP的生成方案与基础的 DES掩码方案一致, 简单直接, 无需再进行额外的设计。
[0095] 对于获取赋值单元 20, 获取一个随机数作为掩码 S, 随机数可以为 32个字节的 随机数, 掩码 S的值之后, 将掩码 S的值赋予掩码 RX12和掩码 SP, 以用于后续的 计算, 例如对 IP的初始置换和对 IP逆置换都需要用到掩码 RX12。
[0096] 获取赋值单元 20包括获取模块, 用于获取 32个字节的随机数作为掩码 S。
[0097] 对于第一生成单元 30, 根据上述的掩码 SP, 生成动态掩码 MSP, 通过掩码 SP生 成动态掩码 MSP, 再通过动态掩码 MSP进行 16轮运算, 简单有效, 可以实现 DES 算法对于高阶 DPA攻击的防护, 提高密码设备的安全性。 第一生成单元, 包括
有生产模块, 用于在静态的掩码 SP1-SP8的基础上, 通过掩码 SP生成动态掩码 M SP。
[0098] 对于初始置换单元 40, 利用掩码 RX12, 对 IP进行初始化置换, 初始化置换为 : 输入的 64位数据块按位重新组合, 并把输出分为 L0、 R0两部分, 每部分各长 3 2位。 在对 IP进行初始化置换的过程中加入掩码 RX12, 提高 DES算法的安全性。
[0099] 对于运算单元 50, 过掩码 RX12、 掩码 S以及动态掩码 MSP进行 16轮相同的计算 , 确保加密的复杂度, 通过动态掩码 MSP进行 16轮相同的计算可以, 提高 DES算 法对高阶 DPA攻击的防护, 进一步提高密码设备的安全性。
[0100] 逆置换单元 60, 最终, 通过掩码 RX12和掩码 RXwork对上述步骤处理后的 IP进 行逆置换, 可以得到最终的 DES加密数据。
[0101] 一种 DES软件防 DPA攻击的装置, 在静态的掩码 SP1-SP8的基础上, 通过掩码 S P生成动态掩码 MSP, 再通过动态掩码 MSP进行 16轮运算, 简单有效, 可以实现 对于高阶 DPA攻击的防护。
[0102]
[0103] 以上所述仅为本发明的优选实施例, 并非因此限制本发明的专利范围, 凡是利 用本发明说明书及附图内容所作的等效结构或等效流程变换, 或直接或间接运 用在其他相关的技术领域, 均同理包括在本发明的专利保护范围内。
Claims
权利要求书
一种 DES软件防 DPA攻击的方法, 其特征在于, 包括,
获取随机数作为掩码 S, 同吋将掩码 S的值赋予掩码 RX12和掩码 SP; 根据掩码 SP生成动态掩码 MSP;
使用掩码 RX12对 IP进行初始化置换;
使用掩码 RX12、 掩码 S以及动态掩码 MSP进行 16轮相同的运算; 通过掩码 RX12和掩码 RXwork对 IP进行逆置换得到 DES加密数据。 如权利要求 1所述的 DES软件防 DPA攻击的方法, 其特征在于, 所述 根据掩码 SP生成动态 MSP的步骤, 其特征在于, 包括,
在静态的掩码 SP1-SP8的基础上, 通过掩码 SP生成动态掩码 MSP。 如权利要求 1所述的 DES软件防 DPA攻击的方法, 其特征在于, 所述 获取随机数作为掩码 S, 同吋赋予掩码 RX12和掩码 SP的步骤之前, 包 括,
通过基础 DES掩码方案生成 IP。
如权利要求 1所述的 DES软件防 DPA攻击的方法, 其特征在于, 所述 获取随机数作为掩码 S的步骤, 包括,
获取 32个字节的随机数作为掩码 S。
一种 DES软件防 DPA攻击的装置, 其特征在于, 包括,
获取赋值单元, 用于获取随机数作为掩码 S, 同吋将掩码 S的值赋予 掩码 RX12和掩码 SP;
第一生成单元, 用于根据掩码 SP生成动态掩码 MSP;
初始置换单元, 用于使用掩码 RX12对 IP进行初始化置换; 运算单元, 用于使用掩码 RX12、 掩码 S以及动态掩码 MSP进行 16轮相 同的运算;
逆置换单元, 用于通过掩码 RX12和掩码 RXwork对 IP进行逆置换得到 DES加密数据。
如权利要求 5所述的 DES软件防 DPA攻击的装置, 其特征在于, 所述 第一生成单元包括有生产模块, 用于在静态的掩码 SP1-SP8的基础上
, 通过掩码 SP生成动态掩码 MSP。
[权利要求 7] 如权利要求 5所述的 DES软件防 DPA攻击的装置, 其特征在于, 还包 括有第二生成单元, 用于通过基础 DES掩码方案生成 IP。
[权利要求 8] 如权利要求 5所述的 DES软件防 DPA攻击的装置, 其特征在于, 所述 获取赋值单元包括获取模块, 用于获取 32个字节的随机数作为掩码 S
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/076972 WO2018165949A1 (zh) | 2017-03-16 | 2017-03-16 | Des软件防dpa攻击的方法及装置 |
CN201780000957.8A CN107466453B (zh) | 2017-03-16 | 2017-03-16 | Des软件防dpa攻击的方法及装置 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/076972 WO2018165949A1 (zh) | 2017-03-16 | 2017-03-16 | Des软件防dpa攻击的方法及装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018165949A1 true WO2018165949A1 (zh) | 2018-09-20 |
Family
ID=60554257
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/076972 WO2018165949A1 (zh) | 2017-03-16 | 2017-03-16 | Des软件防dpa攻击的方法及装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107466453B (zh) |
WO (1) | WO2018165949A1 (zh) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109165531B (zh) * | 2018-09-11 | 2020-04-07 | 网御安全技术(深圳)有限公司 | 一种aes掩码方法、电子设备及存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1798888A1 (fr) * | 2005-12-19 | 2007-06-20 | St Microelectronics S.A. | Protection de l'exécution d'un algorithme DES |
CN103067155A (zh) * | 2012-12-27 | 2013-04-24 | 东南大学 | 一种防止基于功耗分析的des算法攻击的方法及测试电路 |
CN103647638A (zh) * | 2013-12-03 | 2014-03-19 | 北京中电华大电子设计有限责任公司 | 一种抵抗侧信道攻击的des掩码方法 |
CN103905462A (zh) * | 2014-04-16 | 2014-07-02 | 深圳国微技术有限公司 | 可抵御差分功耗分析攻击的加密处理装置及方法 |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
FR2967322B1 (fr) * | 2010-11-08 | 2012-12-28 | Morpho | Protection contre les ecoutes passives |
CN103888245A (zh) * | 2012-12-20 | 2014-06-25 | 北京握奇数据系统有限公司 | 一种智能卡的s盒随机化方法和系统 |
CN104125061A (zh) * | 2014-08-12 | 2014-10-29 | 昆腾微电子股份有限公司 | 使用rsa加密算法的电子部件中的防攻击方法 |
CN104618094B (zh) * | 2015-01-28 | 2015-12-30 | 山东华翼微电子技术股份有限公司 | 一种增强抗攻击能力的密码Mask方法 |
-
2017
- 2017-03-16 WO PCT/CN2017/076972 patent/WO2018165949A1/zh active Application Filing
- 2017-03-16 CN CN201780000957.8A patent/CN107466453B/zh active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1798888A1 (fr) * | 2005-12-19 | 2007-06-20 | St Microelectronics S.A. | Protection de l'exécution d'un algorithme DES |
CN103067155A (zh) * | 2012-12-27 | 2013-04-24 | 东南大学 | 一种防止基于功耗分析的des算法攻击的方法及测试电路 |
CN103647638A (zh) * | 2013-12-03 | 2014-03-19 | 北京中电华大电子设计有限责任公司 | 一种抵抗侧信道攻击的des掩码方法 |
CN103905462A (zh) * | 2014-04-16 | 2014-07-02 | 深圳国微技术有限公司 | 可抵御差分功耗分析攻击的加密处理装置及方法 |
Also Published As
Publication number | Publication date |
---|---|
CN107466453B (zh) | 2020-11-24 |
CN107466453A (zh) | 2017-12-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Nir et al. | ChaCha20 and Poly1305 for IETF Protocols | |
KR101345083B1 (ko) | 암호화 보호 방법 | |
Akkar et al. | An implementation of DES and AES, secure against some attacks | |
JP7076482B2 (ja) | Sboxを有する暗号プロセスを高次サイドチャネル攻撃からセキュアにする方法 | |
JP2015158665A (ja) | 形態保存暗号化のための可変長ブロック暗号装置および方法 | |
JPWO2008010441A1 (ja) | 暗号装置及びプログラムと方法 | |
CN111555862A (zh) | 基于掩码保护的随机冗余轮函数的白盒aes实现方法 | |
Teh et al. | A Chaos‐Based Authenticated Cipher with Associated Data | |
CN104410490B (zh) | 非线性挤压保护密码s盒的方法 | |
CN105656622A (zh) | 一种基于查表和扰动置乱相结合的白盒密码非线性编码保护方法 | |
US20110150225A1 (en) | Encryption devices for block having double block length, decryption devices, encryption method, decryption method, and programs thereof | |
US8958556B2 (en) | Method of secure cryptographic calculation, in particular, against attacks of the DFA and unidirectional type, and corresponding component | |
Preneel | Modes of operation of a block cipher | |
EP2702720A1 (en) | Method for applying a high entropy masking countermeasure in a block encryption algorithm, and a logic integrated circuit implementing such a method | |
US11201724B2 (en) | Method to counter DCA attacks of order 2 and higher on table-based implementations | |
WO2018165949A1 (zh) | Des软件防dpa攻击的方法及装置 | |
EP3286869B1 (en) | High-speed aes with transformed keys | |
Noura et al. | Tresc: Towards redesigning existing symmetric ciphers | |
CN110417540B (zh) | 一种抗差分功耗分析的信息加密方法 | |
Liu et al. | Improving tag generation for memory data authentication in embedded processor systems | |
Reddy et al. | A new symmetric probabilistic encryption scheme based on random numbers | |
RU2186467C2 (ru) | Способ блочного итеративного шифрования | |
CN105553644A (zh) | 32比特分组长度的轻量级加密解密方法 | |
JP2015082077A (ja) | 暗号化装置、制御方法、及びプログラム | |
Kushwah et al. | Chaotic Map based Block Encryption |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17900342 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 15-01-2020) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17900342 Country of ref document: EP Kind code of ref document: A1 |