+

CN105656619A - AES (Advanced Encryption Standard) encryption method and power attack resisting method based on the same - Google Patents

AES (Advanced Encryption Standard) encryption method and power attack resisting method based on the same Download PDF

Info

Publication number
CN105656619A
CN105656619A CN201610074012.8A CN201610074012A CN105656619A CN 105656619 A CN105656619 A CN 105656619A CN 201610074012 A CN201610074012 A CN 201610074012A CN 105656619 A CN105656619 A CN 105656619A
Authority
CN
China
Prior art keywords
data
output
xor
bit
power consumption
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.)
Granted
Application number
CN201610074012.8A
Other languages
Chinese (zh)
Other versions
CN105656619B (en
Inventor
刘雷波
朱敏
吴有余
罗凯
尹首
尹首一
魏少军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
Wuxi Research Institute of Applied Technologies of Tsinghua University
Original Assignee
Wuxi Research Institute of Applied Technologies of Tsinghua University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wuxi Research Institute of Applied Technologies of Tsinghua University filed Critical Wuxi Research Institute of Applied Technologies of Tsinghua University
Priority to CN201610074012.8A priority Critical patent/CN105656619B/en
Publication of CN105656619A publication Critical patent/CN105656619A/en
Application granted granted Critical
Publication of CN105656619B publication Critical patent/CN105656619B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic 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/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

本发明公开了一种AES加密方法和基于及的抗功耗攻击方法,AES加密方法包括:对明文数据进行分组;将轮函数的输入与扩展的密钥进行异或操作;使用8位输入、32位输出的S盒进行数据替换;通过S盒输出的32位数据进行移位;对行移位操作输出的32位数据对应地进行异或操作;对扩展密钥进行异或;使用8位输入、8位输出的S盒进行数据替换;与扩展密钥进行异或;输出密文数据。本发明具有如下优点:加密方法中各个操作主要所需的操作只有查表、移位和异或,这在逻辑实现上是较为简单且高效的。抗功耗攻击方法带有列混淆,抗功耗攻击效果好。

The invention discloses an AES encryption method and an anti-power consumption attack method based on and. The AES encryption method includes: grouping plaintext data; performing XOR operation on the input of the round function and the extended key; using 8-bit input, The 32-bit output S box performs data replacement; the 32-bit data output through the S box is shifted; the 32-bit data output by the row shift operation is correspondingly XORed; the extended key is XORed; use 8 bits Input, 8-bit output S-box for data replacement; XOR with extended key; output ciphertext data. The invention has the following advantages: the main operations required by each operation in the encryption method are table lookup, shift and XOR, which are relatively simple and efficient in terms of logic implementation. The anti-power attack method has column confusion, and the anti-power attack effect is good.

Description

一种AES加密方法和基于及的抗功耗攻击方法An AES encryption method and an anti-power consumption attack method based on

技术领域technical field

本发明涉及信息安全技术领域,具体涉及一种AES加密方法和基于及的抗功耗攻击方法。The invention relates to the technical field of information security, in particular to an AES encryption method and an anti-power consumption attack method based on and.

背景技术Background technique

随着信息化的发展,信息安全问题也越来越重要,人们在这个过程中提出了各种不同的密码算法,在这繁多的密码算法中,AES(AdvancedEncryptionStandard,高级加密标准)广为全世界所使用且已成为一个国际通用的对称加密算法,以其密钥建立时间短、灵敏度高、内存要求低等优点,大量应用于信息安全领域,如电子商务和通讯加密等。With the development of informatization, information security issues are becoming more and more important. People have proposed various cryptographic algorithms in this process. Among these various cryptographic algorithms, AES (Advanced Encryption Standard, Advanced Encryption Standard) is widely used all over the world. It is used and has become an internationally common symmetric encryption algorithm. With its advantages of short key establishment time, high sensitivity, and low memory requirements, it is widely used in information security fields, such as e-commerce and communication encryption.

随着人们对AES算法进行各种不同层次的分析,出现了很多对AES算法的攻击破解方式,在众多的攻击方式中,功耗攻击通过分析密码算法执行和功耗之间的关系,对使用该算法的密码芯片内部的密钥进行数学解析分析,如简单功耗分析(SPA)和差分功耗分析(DPA)等,并最终获取密钥,从而对密码芯片的安全性造成了很大的威胁。As people analyze the AES algorithm at various levels, there are many ways to attack and crack the AES algorithm. Among the many attack methods, the power consumption attack analyzes the relationship between the execution of the cryptographic algorithm and the The key inside the encryption chip of this algorithm is analyzed mathematically, such as Simple Power Analysis (SPA) and Differential Power Analysis (DPA), etc., and the key is finally obtained, which has caused a great impact on the security of the encryption chip. threaten.

传统AES加密算法的实现中,主要的运算操作可分为“S盒变换、行变换、列混淆、与扩展密钥的异或”这四个步骤,很多学者在此基础上提出了各种不同抗功耗攻击的防御策略。本发明针对一种改进的AES实现方案,这种实现方案简化了AES实现过程中复杂的列混淆运算,并结合该实现方案提出了一种抗功耗攻击的方法,这种方法基于功耗的汉明重量模型理论,通过算法级上的互补操作来平衡功耗,使芯片上运算的功耗信息得以隐藏,并达到抗功耗攻击的目的。In the implementation of the traditional AES encryption algorithm, the main operation can be divided into four steps: "S-box transformation, row transformation, column confusion, XOR with extended key". Defense strategies against power consumption attacks. The present invention is aimed at an improved AES implementation scheme, which simplifies the complex column confusion operation in the AES implementation process, and combines the implementation scheme to propose a method for resisting power consumption attacks. This method is based on power consumption The Hamming weight model theory balances power consumption through complementary operations at the algorithm level, so that the power consumption information calculated on the chip can be hidden, and the purpose of resisting power consumption attacks can be achieved.

现有的以AES-128为例,图1展示了AES-128算法的实现过程,在这个实现过程中,以字节作为基本操作单元,需要将“S盒变换、行变换、列混淆、与扩展密钥的异或”作为一个轮函数循环操作10次。其中,所有的数学运算都是针对G(2^8)域上的运算而言。The existing AES-128 is taken as an example. Figure 1 shows the implementation process of the AES-128 algorithm. In this implementation process, bytes are used as the basic operation unit, and "S-box transformation, row transformation, column confusion, and The XOR of the extended key is operated 10 times as a round function. Among them, all mathematical operations are for operations on the G(2^8) field.

针对这种AES加密实现,人们提出了很多种不同的抗功耗攻击方法,常见的有对中间数据进行掩码(masking)操作,这种方法通过使用随机掩码来与加密运算产生的中间数据进行一定的结合运算,使中间数据随机化;或者使用功耗平衡电路,使得运算功耗保持平衡并与处理的数据无关;也有通过插入随机延时的方法,让加密操作执行的时间点不确定。For this kind of AES encryption implementation, people have proposed many different anti-power consumption attack methods. The common one is to perform masking operation on the intermediate data. This method uses a random mask to compare with the intermediate data generated by the encryption operation. Perform a certain combination of operations to randomize the intermediate data; or use a power balance circuit to keep the power consumption of the operation balanced and independent of the processed data; there is also a method of inserting a random delay to make the execution time of the encryption operation uncertain. .

AES加密的一种改进实现方式可以通过简化轮函数的四步操作,使得加密过程中没有复杂的列混淆操作。这种实现方式仅需要四个查找表、每轮每列的四次异或,以及存储这些数据的额外存储空间。An improved implementation of AES encryption can simplify the four-step operation of the round function, so that there is no complicated column confusion operation in the encryption process. This implementation requires only four lookup tables, four XORs per column per round, and additional storage to store these data.

但现有AES上抗功耗攻击的方法主要是针对传统的AES实现方案来设计的,缺乏针对这种不带列混淆,且更高效的加密实现过程的抗功耗攻击策略。However, the existing methods for resisting power consumption attacks on AES are mainly designed for traditional AES implementation schemes, and there is a lack of anti power consumption attack strategies for this kind of non-column confusion and more efficient encryption implementation process.

发明内容Contents of the invention

本发明旨在至少解决上述技术问题之一。The present invention aims to solve at least one of the above-mentioned technical problems.

为此,本发明的第一个目的在于提出一种AES加密方法。For this reason, the first purpose of the present invention is to propose a kind of AES encryption method.

本发明的第二个目的在于提出一种基于AES加密方法的抗功耗攻击方法。The second purpose of the present invention is to propose an anti-power consumption attack method based on the AES encryption method.

为了实现上述目的,本发明的实施例公开了一种AES加密方法,包括如下步骤:S1:对明文数据进行分组;S200:初始化循环次数为0;S201:将轮函数的输入与扩展的密钥进行异或操作;S202:使用N位输入、M位输出的S盒进行数据替换,其中,N和M均为自然数,M>N且M被N整除;S203:通过所述S盒输出的M位数据进行移位,得到分组矩阵列混淆操作的一个列的数据;S204:对行移位操作输出的M位数据对应地进行异或操作,得到一次轮函数的输出值,循环次数加1;S205:判断当前循环次数是否达到预设次数,如果没有当前循环次数达到预设次数则进入步骤S3,否则返回步骤S201;S3:对扩展密钥进行异或;S4:使用N位输入、P位输出的S盒进行数据替换,其中,P为自然数且P被N整除;S5:与扩展密钥进行异或;S6:输出密文数据。In order to achieve the above object, the embodiment of the present invention discloses an AES encryption method, including the following steps: S1: group the plaintext data; S200: initialize the number of cycles to 0; S201: combine the input of the round function with the extended key Perform XOR operation; S202: Use N-bit input, M-bit output S-box for data replacement, where N and M are both natural numbers, M>N and M is divisible by N; S203: M output through the S-box Bit data is shifted to obtain the data of a column of the grouping matrix column confusion operation; S204: Correspondingly XOR operation is performed on the M-bit data output by the row shift operation to obtain the output value of a round function, and the number of cycles is increased by 1; S205: Judging whether the current number of cycles reaches the preset number, if no current cycle number reaches the preset number, go to step S3, otherwise return to step S201; S3: XOR the extended key; S4: use N-bit input, P-bit The output S box performs data replacement, where P is a natural number and P is divisible by N; S5: XOR with the extended key; S6: Output ciphertext data.

根据本发明实施例的AES加密方法,各个操作主要所需的操作只有查表、移位和异或,这在逻辑实现上是较为简单且高效的。According to the AES encryption method of the embodiment of the present invention, the main operations required for each operation are table lookup, shift and XOR, which are relatively simple and efficient in logic implementation.

另外,根据本发明上述实施例的AES加密方法,还可以具有如下附加的技术特征:In addition, the AES encryption method according to the foregoing embodiments of the present invention can also have the following additional technical features:

进一步地,N为8,M为32且P为8。Further, N is 8, M is 32 and P is 8.

为了实现上述目的,本发明的实施例公开了一种基于AES加密方法的抗功耗攻击方法,包括以下步骤:SA:获取明文数据;SB:通过权利要求1或2所述的AES加密方法对所述明文数据进行加密,在对所述明文数据进行加密的过程中引入一个互补操作以使得加密操作产生的功耗和所述互补操作产生的功耗的和为近似一个常数,所述互补操作包括与扩展密钥的反进行异或、反S盒数据替换、反数据的行位移和同或运算;SC:输出密文。In order to achieve the above object, the embodiment of the present invention discloses an anti-power consumption attack method based on the AES encryption method, comprising the following steps: SA: obtain plaintext data; SB: use the AES encryption method described in claim 1 or 2 to The plaintext data is encrypted, and a complementary operation is introduced in the process of encrypting the plaintext data so that the sum of the power consumption generated by the encryption operation and the power consumption generated by the complementary operation is approximately a constant, and the complementary operation Including XOR with the reverse of the extended key, reverse S-box data replacement, row shift of reverse data and XOR operation; SC: output ciphertext.

本发明的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.

附图说明Description of drawings

本发明的上述和/或附加的方面和优点从结合下面附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and comprehensible from the description of the embodiments in conjunction with the following drawings, wherein:

图1是相关技术的AES-128实现过程的流程图;Fig. 1 is the flowchart of the AES-128 realization process of related art;

图2是本发明一个实施例的AES加密方法的流程图;Fig. 2 is the flowchart of the AES encryption method of an embodiment of the present invention;

图3是本发明一个实施例的AES加密方法中部分操作的数据变换图;Fig. 3 is the data transformation figure of part operation in the AES encryption method of an embodiment of the present invention;

图4是本发明一个实施例的基于AES加密方法的抗功耗攻击方法的抗功耗攻击实现框图。FIG. 4 is a block diagram of an anti-power consumption attack implementation block diagram of an anti-power consumption attack method based on an AES encryption method according to an embodiment of the present invention.

具体实施方式detailed description

下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能理解为对本发明的限制。Embodiments of the present invention are described in detail below, examples of which are shown in the drawings, wherein the same or similar reference numerals designate the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the figures are exemplary only for explaining the present invention and should not be construed as limiting the present invention.

在本发明的描述中,需要理解的是,术语“中心”、“纵向”、“横向”、“上”、“下”、“前”、“后”、“左”、“右”、“竖直”、“水平”、“顶”、“底”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性。In describing the present invention, it should be understood that the terms "center", "longitudinal", "transverse", "upper", "lower", "front", "rear", "left", "right", " The orientations or positional relationships indicated by "vertical", "horizontal", "top", "bottom", "inner" and "outer" are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and Simplified descriptions, rather than indicating or implying that the device or element referred to must have a particular orientation, be constructed and operate in a particular orientation, and thus should not be construed as limiting the invention. In addition, the terms "first" and "second" are used for descriptive purposes only, and should not be understood as indicating or implying relative importance.

在本发明的描述中,需要说明的是,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。In the description of the present invention, it should be noted that unless otherwise specified and limited, the terms "installation", "connection" and "connection" should be understood in a broad sense, for example, it can be a fixed connection or a detachable connection. Connected, or integrally connected; it can be mechanically connected or electrically connected; it can be directly connected or indirectly connected through an intermediary, and it can be the internal communication of two components. Those of ordinary skill in the art can understand the specific meanings of the above terms in the present invention in specific situations.

参照下面的描述和附图,将清楚本发明的实施例的这些和其他方面。在这些描述和附图中,具体公开了本发明的实施例中的一些特定实施方式,来表示实施本发明的实施例的原理的一些方式,但是应当理解,本发明的实施例的范围不受此限制。相反,本发明的实施例包括落入所附加权利要求书的精神和内涵范围内的所有变化、修改和等同物。These and other aspects of embodiments of the invention will become apparent with reference to the following description and drawings. In these descriptions and drawings, some specific implementations of the embodiments of the present invention are specifically disclosed to represent some ways of implementing the principles of the embodiments of the present invention, but it should be understood that the scope of the embodiments of the present invention is not limited by This restriction. On the contrary, the embodiments of the present invention include all changes, modifications and equivalents coming within the spirit and scope of the appended claims.

以下结合附图描述根据本发明实施例的AES加密方法。The following describes the AES encryption method according to the embodiment of the present invention with reference to the accompanying drawings.

图1是本发明一个实施例的AES加密方法的流程图。请参考图1,一种AES加密方法,包括以下步骤:FIG. 1 is a flowchart of an AES encryption method according to an embodiment of the present invention. Please refer to Figure 1, an AES encryption method, including the following steps:

S1:对明文数据进行分组。S1: Group plaintext data.

S200:初始化循环次数为0。S200: The number of initialization cycles is 0.

S201:将轮函数的输入与扩展的密钥进行异或操作。该步骤与原始AES的实现完全一样,将轮函数的输入与扩展的密钥执行模2加操作,逻辑上表现为异或操作。S201: Execute an XOR operation on the input of the round function and the extended key. This step is exactly the same as the implementation of the original AES, and the input of the round function and the extended key are performed to perform a modulo 2 addition operation, which is logically expressed as an XOR operation.

S202:使用N位输入、M位输出的S盒进行数据替换,其中,N和M均为自然数,M>N且M被N整除。在本发明的一个示例中,N为8、M为32,即通过使用一个8位输入,32位输出的改进S盒执行字节替换。该32位输出是在原始AES加密过程中S盒变换的8位输出数据基础上,预先设定好而得到的。S202: Use an S-box with N-bit input and M-bit output to perform data replacement, where N and M are both natural numbers, M>N and M is divisible by N. In an example of the present invention, N is 8 and M is 32, that is, byte replacement is performed by using an 8-bit input, 32-bit output modified S-box. The 32-bit output is pre-set on the basis of the 8-bit output data transformed by the S-box during the original AES encryption process.

S203:通过S盒输出的M位数据进行移位,得到原来AES算法中分组矩阵列混淆操作的一个列的数据。S203: Shift the M-bit data output by the S-box to obtain the data of one column of the grouping matrix column obfuscation operation in the original AES algorithm.

S204:对行移位操作输出的M位数据对应地进行异或操作,得到一次轮函数的输出值,循环次数加1。具体地,对行移位操作输出的32位数据对应地进行模2加(异或),最终得到一次轮函数的输出值。S204: Correspondingly perform an XOR operation on the M-bit data output by the row shift operation to obtain an output value of a round function, and add 1 to the number of cycles. Specifically, modulo 2 addition (exclusive OR) is performed on the 32-bit data output by the row shift operation, and finally the output value of the primary round function is obtained.

S205:判断当前循环次数是否达到预设次数,如果没有当前循环次数达到预设次数则进入步骤S3,否则返回步骤S201。S205: Determine whether the current number of cycles reaches the preset number, if no current cycle number reaches the preset number, go to step S3, otherwise return to step S201.

S3:对扩展密钥进行异或。S3: XOR the extended key.

S4:使用N位输入、P位输出的S盒进行数据替换,其中,P为自然数且P被N整除。其中,P为8。S4: Use an S-box with N-bit input and P-bit output for data replacement, where P is a natural number and P is divisible by N. Among them, P is 8.

S5:与扩展密钥进行异或。S5: XOR with the extended key.

S6:输出密文数据。S6: Output ciphertext data.

根据本发明实施例的AES加密方法,各个操作主要所需的操作只有查表、移位和异或,这在逻辑实现上是较为简单且高效的,与传统算法实现的不同之处是“改进的S盒变换、行移位、32位数据异或”这三个操作。According to the AES encryption method of the embodiment of the present invention, the main operations required by each operation are only table lookup, shift and XOR, which is relatively simple and efficient in logic implementation, and the difference from traditional algorithm implementation is that "improved The three operations of S-box transformation, row shift, and 32-bit data XOR".

图3是本发明一个实施例的AES加密方法中部分操作的数据变换图,在本发明的一个示例中,图3中每一个Sxx均代表一个字节数据,字节数据前的系数代表G(2^8)有限域上的乘法运算(乘以该系数),“+”为G(2^8)有限域上的加法(逻辑上即异或)运算,{a,b,c,d}代表a,b,c,d这四个字节数据拼接成的32位数据。Fig. 3 is the data transformation diagram of part operation in the AES encryption method of an embodiment of the present invention, and in an example of the present invention, each Sxx all represents a byte data in Fig. 3, and the coefficient before the byte data represents G ( 2^8) multiplication operation on the finite field (multiplied by the coefficient), "+" is the addition (logically XOR) operation on the G(2^8) finite field, {a,b,c,d} Represents the 32-bit data spliced by the four bytes of data a, b, c, and d.

以下将结合附图描述根据本发明实施例的一种基于AES加密方法的抗功耗攻击方法。A method for resisting power consumption attacks based on an AES encryption method according to an embodiment of the present invention will be described below with reference to the accompanying drawings.

请参考图4,一种基于AES加密方法的抗功耗攻击方法,包括以下步骤:Please refer to Figure 4, an anti-power consumption attack method based on the AES encryption method, including the following steps:

SA:获取明文数据。SA: Obtain plaintext data.

SB:通过上述的AES加密方法对所述明文数据进行加密,在对所述明文数据进行加密的过程中引入一个互补操作以使得加密操作产生的功耗和所述互补操作产生的功耗的和为一个常数,所述互补操作包括与扩展密钥的反进行异或、反S盒数据替换、反数据的行位移和同或运算。SB: Encrypt the plaintext data through the above-mentioned AES encryption method, and introduce a complementary operation in the process of encrypting the plaintext data so that the sum of the power consumption generated by the encryption operation and the power consumption generated by the complementary operation is a constant, and the complementary operation includes XOR with the inverse of the extended key, inverse S-box data replacement, row displacement of inverse data, and exclusive OR operation.

具体地,在上述实施例的AES加密方法中,随着输入数据的不同,运算过程产生中间数据的汉明重量会有很大区别,通过汉明重量模型可知,相应的运算功耗差别也会很明显。典型的功耗攻击方法(如DPA),便是通过捕捉不同猜测密钥时产生的功耗曲线,利用运算不同中间数据的过程中产生功耗的差别来得以实现。针对上文提出的这种改进AES算法的实现,通过在加密运算执行过程中同时引入一个互补操作。Specifically, in the AES encryption method of the above-mentioned embodiment, with the difference of input data, the Hamming weight of the intermediate data generated during the operation process will be very different. According to the Hamming weight model, the corresponding difference in the power consumption of the operation will also be It is clear. A typical power consumption attack method (such as DPA) is realized by capturing the power consumption curve generated when guessing different keys, and using the difference in power consumption generated during the operation of different intermediate data. For the implementation of the improved AES algorithm proposed above, a complementary operation is simultaneously introduced during the execution of the encryption operation.

加密过程中假定某次操作可视为函数F(x),产生的汉明重量为HW(F(x)),相应的功耗为:In the encryption process, it is assumed that an operation can be regarded as a function F(x), and the generated Hamming weight is HW(F(x)), and the corresponding power consumption is:

P≈kHW(F(x))+dP≈kHW(F(x))+d

与此同时,互补操作进行F’(x)运算,产生的汉明重量为HW(F’(x))并且F’和F所做的操作方式近似一样(也即下式k相同),相应的功耗为:At the same time, the complementary operation performs the F'(x) operation, and the resulting Hamming weight is HW(F'(x)) and the operations of F' and F are approximately the same (that is, the following formula k is the same), corresponding The power consumption is:

P′≈kHW(F′(x))+dP′≈kHW(F′(x))+d

这个过程整个硬件功耗为L=L1+L’,这样只要保证:The entire hardware power consumption in this process is L=L1+L', so as long as it is guaranteed:

HW(F(x))+HW(F′(x))=CHW(F(x))+HW(F'(x))=C

就使得互补操作和正常加密操作,这二者的产生的功耗之和近似恒定,而与加密运算产生的中间数据数值无关,这就隐藏了运算过程中的功耗和数据信息并实现抗功耗攻击的目的。This makes the sum of the power consumption generated by the complementary operation and the normal encryption operation approximately constant, regardless of the value of the intermediate data generated by the encryption operation, which hides the power consumption and data information during the operation process and realizes anti-power purpose of the attack.

在平衡功耗的互补操作中,具体需要引入的运算为:与扩展密钥的反进行异或、反S盒字节替换、反数据的行移位以及同或运算。In the complementary operation of balancing power consumption, the specific operations that need to be introduced are: XOR with the inverse of the extended key, reverse S-box byte replacement, row shift of inverse data, and exclusive OR operation.

互补操作一:与扩展密钥的反进行异或。扩展密钥异或操作同时,执行互补操作“与扩展密钥的反进行异或”,二者的输出互为反数据,则二者的汉明重量之和将恒定为一个常数,由此实现功耗近似平衡。Complementary operation one: XOR with the inverse of the extended key. At the same time as the XOR operation of the extended key, the complementary operation "XOR with the inverse of the extended key" is performed, and the outputs of the two are the inverse data of each other, and the sum of the Hamming weights of the two will be constant as a constant, thus realizing Power consumption is approximately balanced.

数据x与密钥进行异或:The data x is XORed with the key:

F1(x)=x⊕k1F1(x)=x⊕k1

互补操作:Complementary operations:

Ff 11 ,, (( xx )) == xx ⊕⊕ kk 11 ‾‾

即可保证can guarantee

HW(F1(x))⊕HW(F1′(x))=C1HW(F1(x))⊕HW(F1′(x))=C1

其中,k1为扩展密钥,C1为常数。Among them, k1 is an extended key, and C1 is a constant.

互补操作二:反S盒字节替换。在上述实施例的AES加密方法中,改进的S盒替换是8位输入32位输出,这个过程往往通过一个矩阵查找表来实现,变换函数记为F2(x),则:Complementary operation two: reverse S-box byte replacement. In the AES encryption method of the foregoing embodiment, the improved S-box replacement is 8-bit input and 32-bit output. This process is often realized by a matrix lookup table, and the transformation function is denoted as F2 (x), then:

F2(x)={x′,x′,3x′,2x′}F2(x)={x',x',3x',2x'}

取互补操作使其输出均为正常加密输出的反:Complementary operations make the output the inverse of the normal encrypted output:

Ff 22 ′′ (( xx )) == {{ xx ′′ ‾‾ ,, xx ′′ ‾‾ ,, 33 xx ′′ ‾‾ ,, 22 xx ′′ ‾‾ }}

其中,x’代表传统的字节输入经过S盒变换得到的字节输出。”{}”代表数据的拼接,这样同样能保证:Among them, x' represents the byte output obtained by transforming the traditional byte input through the S-box. "{}" represents the splicing of data, which can also guarantee:

HW(F2(x))+HW(F2′(x))=C2HW(F2(x))+HW(F2'(x))=C2

如此一来同样实现了汉明重量恒定,相应的总功耗近似恒定,而与加密数据的中间值无关。In this way, the Hamming weight is also constant, and the corresponding total power consumption is approximately constant, regardless of the median value of the encrypted data.

互补操作三:反数据的行移位。在执行行移位的过程中,由于上一级操作的输出中,除了一个正常输出,还有一个反数据的输出,由此,在对数据行移位的同时引入额外操作,即对其反数据执行相同的行移位,二者的功耗之和在汉明重量的模型下也实现了平衡。Complementary operation three: row shifting of inverse data. In the process of performing row shifting, since the output of the upper-level operation, in addition to a normal output, there is also an output of reverse data, thus, an additional operation is introduced while shifting the data row, that is, its reverse The data performs the same row shift, and the sum of the power consumption of the two is also balanced under the model of Hamming weight.

互补操作四:同或运算。在上述实施例的AES加密方法中,32位数据异或是针对4个数据进行异或操作,需要顺序执行三次异或,在执行第一次异或的同时,互补操作执行同或运算,操作的输入数据与正常加密操作输入数据相同,后两次加密异或操作的同时互补操作也为异或运算,则引入操作所得的中间数据和有用的加密中间数据一直处于互补关系。同样能实现恒定的汉明重量,仍有近似的运算功耗恒定,而与中间数据无关。Complementary operation four: same-or operation. In the AES encryption method of the above-mentioned embodiment, the 32-bit data XOR is performed for the XOR operation of 4 data, and three XOR operations need to be performed sequentially. While performing the first XOR operation, the complementary operation performs the XOR operation, and the operation The input data is the same as the input data of the normal encryption operation, and the complementary operation of the last two encrypted XOR operations is also an XOR operation, so the intermediate data obtained by the introduction operation and the useful encrypted intermediate data are always in a complementary relationship. A constant Hamming weight can also be achieved, and there is still an approximate constant computational power consumption independent of the intermediate data.

另外,本发明实施例的一种AES加密方法和基于及的抗功耗攻击方法的其它构成以及作用对于本领域的技术人员而言都是已知的,为了减少冗余,不做赘述。In addition, other configurations and functions of an AES encryption method and an and-based anti-power consumption attack method in the embodiment of the present invention are known to those skilled in the art, and will not be repeated in order to reduce redundancy.

在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of this specification, descriptions referring to the terms "one embodiment", "some embodiments", "example", "specific examples", or "some examples" mean that specific features described in connection with the embodiment or example , structure, material or characteristic is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

尽管已经示出和描述了本发明的实施例,本领域的普通技术人员可以理解:在不脱离本发明的原理和宗旨的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由权利要求及其等同限定。Although the embodiments of the present invention have been shown and described, those skilled in the art can understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principle and spirit of the present invention. The scope of the invention is defined by the claims and their equivalents.

Claims (3)

1.一种AES加密方法,其特征在于,包括如下步骤:1. an AES encryption method, is characterized in that, comprises the steps: S1:对明文数据进行分组;S1: Group plaintext data; S200:初始化循环次数为0;S200: the number of initialization cycles is 0; S201:将轮函数的输入与扩展的密钥进行异或操作;S201: XOR the input of the round function and the extended key; S202:使用N位输入、M位输出的S盒进行数据替换,其中,N和M均为自然数,M>N且M被N整除;S202: Use an S box with N-bit input and M-bit output to perform data replacement, where N and M are both natural numbers, M>N and M is divisible by N; S203:通过所述S盒输出的M位数据进行移位,得到分组矩阵列混淆操作的一个列的数据;S203: shifting the M-bit data output by the S box to obtain the data of one column of the grouping matrix column confusion operation; S204:对行移位操作输出的M位数据对应地进行异或操作,得到一次轮函数的输出值,循环次数加1;S204: Correspondingly perform an XOR operation on the M-bit data output by the row shift operation to obtain an output value of a round function, and add 1 to the number of cycles; S205:判断当前循环次数是否达到预设次数,如果没有当前循环次数达到预设次数则进入步骤S3,否则返回步骤S201;S205: Judging whether the current number of cycles reaches the preset number, if no current cycle number reaches the preset number, enter step S3, otherwise return to step S201; S3:对扩展密钥进行异或;S3: XOR the extended key; S4:使用N位输入、P位输出的S盒进行数据替换,其中,P为自然数且P被N整除;S4: Use an S-box with N-bit input and P-bit output for data replacement, where P is a natural number and P is divisible by N; S5:与扩展密钥进行异或;S5: XOR with the extended key; S6:输出密文数据。S6: output ciphertext data. 2.根据权利要求1所述的AES加密方法,其特征在于,N为8,M为32且P为8。2. The AES encryption method according to claim 1, wherein N is 8, M is 32 and P is 8. 3.一种基于AES加密方法的抗功耗攻击方法,其特征在于,包括以下步骤:3. An anti-power consumption attack method based on AES encryption method, is characterized in that, comprises the following steps: SA:获取明文数据;SA: Obtain plaintext data; SB:通过权利要求1或2所述的AES加密方法对所述明文数据进行加密,在对所述明文数据进行加密的过程中引入一个互补操作以使得加密操作产生的功耗和所述互补操作产生的功耗的和近似为一个常数,所述互补操作包括与扩展密钥的反进行异或、反S盒数据替换、反数据的行位移和同或运算;SB: The plaintext data is encrypted by the AES encryption method described in claim 1 or 2, and a complementary operation is introduced in the process of encrypting the plaintext data so that the power consumption generated by the encryption operation is equal to the complementary operation The sum of the generated power consumption is approximately a constant, and the complementary operation includes XOR with the reverse of the extended key, reverse S-box data replacement, row displacement of reverse data and exclusive OR operation; SC:输出密文。SC: output ciphertext.
CN201610074012.8A 2016-02-02 2016-02-02 An AES encryption method and an anti-power attack method based thereon Active CN105656619B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610074012.8A CN105656619B (en) 2016-02-02 2016-02-02 An AES encryption method and an anti-power attack method based thereon

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610074012.8A CN105656619B (en) 2016-02-02 2016-02-02 An AES encryption method and an anti-power attack method based thereon

Publications (2)

Publication Number Publication Date
CN105656619A true CN105656619A (en) 2016-06-08
CN105656619B CN105656619B (en) 2019-02-26

Family

ID=56488268

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610074012.8A Active CN105656619B (en) 2016-02-02 2016-02-02 An AES encryption method and an anti-power attack method based thereon

Country Status (1)

Country Link
CN (1) CN105656619B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105871536A (en) * 2016-06-14 2016-08-17 东南大学 AES-algorithm-oriented power analysis attack resistant method based on random time delay
CN106101096A (en) * 2016-06-10 2016-11-09 北京数盾信息科技有限公司 A kind of high-speed encryption module separated based on interface bus
CN106130712A (en) * 2016-06-14 2016-11-16 刘雷波 A kind of opportunistic infections fault-resistant attack method based on INS network
CN106506142A (en) * 2016-11-22 2017-03-15 北京航空航天大学 A low-complexity AES integrated encryption and decryption implementation method
CN110071794A (en) * 2019-04-28 2019-07-30 苏州国芯科技股份有限公司 A kind of information ciphering method based on aes algorithm, system and associated component
CN110336658A (en) * 2019-07-01 2019-10-15 武汉能钠智能装备技术股份有限公司 Encryption method, user equipment, storage medium and device based on aes algorithm
CN111262684A (en) * 2020-01-13 2020-06-09 燕山大学 A power battery traceability management coding encryption method based on improved AES algorithm
CN111680329A (en) * 2020-08-14 2020-09-18 成都中轨轨道设备有限公司 Data processing method for improving data security
CN112396377A (en) * 2020-11-20 2021-02-23 国网天津市电力公司 Power equipment warehouse management and control system based on Internet of things
CN112765686A (en) * 2021-01-06 2021-05-07 苏州裕太微电子有限公司 Power consumption attack prevention framework and method for algorithm key in chip
CN114218588A (en) * 2021-12-10 2022-03-22 中国电子科技集团公司第四十七研究所 Anti-attack block cipher encryption method for multi-scenario applications
CN117767272A (en) * 2023-11-22 2024-03-26 国网冀北电力有限公司智能配电网中心 New energy consumption capability evaluation system and evaluation method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110296198A1 (en) * 2010-05-27 2011-12-01 Kabushiki Kaisha Toshiba Cryptographic processing apparatus and ic card
CN103916236A (en) * 2014-04-25 2014-07-09 东南大学 Power attack prevention method oriented at AES algorithm and circuit achieving method thereof
CN104065474A (en) * 2014-07-14 2014-09-24 衡阳师范学院 A New Low-Resource Efficient Lightweight Surge Block Cipher Implementation Method
CN104301095A (en) * 2014-10-13 2015-01-21 深圳中科讯联科技有限公司 DES round operation method and circuit

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110296198A1 (en) * 2010-05-27 2011-12-01 Kabushiki Kaisha Toshiba Cryptographic processing apparatus and ic card
CN103916236A (en) * 2014-04-25 2014-07-09 东南大学 Power attack prevention method oriented at AES algorithm and circuit achieving method thereof
CN104065474A (en) * 2014-07-14 2014-09-24 衡阳师范学院 A New Low-Resource Efficient Lightweight Surge Block Cipher Implementation Method
CN104301095A (en) * 2014-10-13 2015-01-21 深圳中科讯联科技有限公司 DES round operation method and circuit

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106101096A (en) * 2016-06-10 2016-11-09 北京数盾信息科技有限公司 A kind of high-speed encryption module separated based on interface bus
CN106101096B (en) * 2016-06-10 2022-06-28 北京数盾信息科技有限公司 High-speed encryption module based on interface bus separation
CN106130712A (en) * 2016-06-14 2016-11-16 刘雷波 A kind of opportunistic infections fault-resistant attack method based on INS network
CN105871536B (en) * 2016-06-14 2019-01-29 东南大学 A kind of anti-power consumption attack method towards aes algorithm based on random delay
CN106130712B (en) * 2016-06-14 2019-09-06 刘雷波 A kind of opportunistic infections fault-resistant attack method based on INS network
CN105871536A (en) * 2016-06-14 2016-08-17 东南大学 AES-algorithm-oriented power analysis attack resistant method based on random time delay
CN106506142A (en) * 2016-11-22 2017-03-15 北京航空航天大学 A low-complexity AES integrated encryption and decryption implementation method
CN106506142B (en) * 2016-11-22 2020-11-03 北京航空航天大学 A low-complexity AES integrated encryption/decryptor implementation method
CN110071794B (en) * 2019-04-28 2022-06-07 苏州国芯科技股份有限公司 AES algorithm-based information encryption method, system and related components
CN110071794A (en) * 2019-04-28 2019-07-30 苏州国芯科技股份有限公司 A kind of information ciphering method based on aes algorithm, system and associated component
CN110336658A (en) * 2019-07-01 2019-10-15 武汉能钠智能装备技术股份有限公司 Encryption method, user equipment, storage medium and device based on aes algorithm
CN111262684A (en) * 2020-01-13 2020-06-09 燕山大学 A power battery traceability management coding encryption method based on improved AES algorithm
CN111680329B (en) * 2020-08-14 2020-11-10 成都中轨轨道设备有限公司 Data processing method for improving data security
CN111680329A (en) * 2020-08-14 2020-09-18 成都中轨轨道设备有限公司 Data processing method for improving data security
CN112396377A (en) * 2020-11-20 2021-02-23 国网天津市电力公司 Power equipment warehouse management and control system based on Internet of things
CN112765686A (en) * 2021-01-06 2021-05-07 苏州裕太微电子有限公司 Power consumption attack prevention framework and method for algorithm key in chip
CN114218588A (en) * 2021-12-10 2022-03-22 中国电子科技集团公司第四十七研究所 Anti-attack block cipher encryption method for multi-scenario applications
CN117767272A (en) * 2023-11-22 2024-03-26 国网冀北电力有限公司智能配电网中心 New energy consumption capability evaluation system and evaluation method

Also Published As

Publication number Publication date
CN105656619B (en) 2019-02-26

Similar Documents

Publication Publication Date Title
CN105656619A (en) AES (Advanced Encryption Standard) encryption method and power attack resisting method based on the same
D'souza et al. Advanced encryption standard (AES) security enhancement using hybrid approach
Kumar et al. Development of modified AES algorithm for data security
JP7031580B2 (en) Cryptographic device, encryption method, decryption device, and decryption method
US7532721B2 (en) Implementation of a switch-box using a subfield method
ES2717999T3 (en) Cryptographic method by blocks to encrypt / decrypt messages and cryptographic devices to implement this method
US8369516B2 (en) Encryption apparatus having common key encryption function and embedded apparatus
CN107070630B (en) A Fast and Safe Hardware Structure of AES Algorithm
KR101324351B1 (en) Method for generating a cipher-based message authentication code
KR20050078271A (en) Hardware cryptographic engine and method improving power consumption and operation speed
CN110572255A (en) Lightweight Block Cipher Algorithm Shadow Implementation Method, Device, and Computer-Readable Medium
CN104348625A (en) Encryption and decryption device and encryption and decryption method thereof
Selvanayagam et al. Secure file storage on cloud using cryptography
Jacob et al. Towards the generation of a dynamic key-dependent S-box to enhance security
JP2021500760A (en) Protecting modular inversion operations from external surveillance attacks
Waqas et al. Generation of AES-like S-boxes by replacing affine matrix
Jeong et al. Differential fault analysis on block cipher SEED
Arshad et al. New extension of data encryption standard over 128-bit key for digital images
CN101866401B (en) Method for resisting side channel attacks by evolutive S boxes
Xu et al. A white-box AES-like implementation based on key-dependent substitution-linear transformations
Nissar et al. Implementation of security enhancement in AES by inducting dynamicity in AES s-box
Gangadari et al. FPGA implementation of compact S-Box for AES algorithm using composite field arithmetic
CN110532763B (en) Password construction method and system based on high-order orthomorphism replacement
Jassim et al. A modified advanced encryption standard for color images
CN104954118B (en) A kind of mimicry encryption method and system encoded based on vector network with DES

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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: 20250915

Address after: 100084 Beijing City, Haidian District Tsinghua Yuan

Patentee after: TSINGHUA University

Country or region after: China

Patentee after: Wuxi Research Institute of Applied Technologies Tsinghua University

Address before: 214072 Jiangsu Province Wuxi City Binhu District Jianzhu West Road 777 National Integrated Circuit Design Center A3 Building

Patentee before: Wuxi Research Institute of Applied Technologies Tsinghua University

Country or region before: China

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载