WO2022227273A1 - Smart card protection method and apparatus capable of side channel attack resistance - Google Patents

Smart card protection method and apparatus capable of side channel attack resistance Download PDF

Info

Publication number
WO2022227273A1
WO2022227273A1 PCT/CN2021/104178 CN2021104178W WO2022227273A1 WO 2022227273 A1 WO2022227273 A1 WO 2022227273A1 CN 2021104178 W CN2021104178 W CN 2021104178W WO 2022227273 A1 WO2022227273 A1 WO 2022227273A1
Authority
WO
WIPO (PCT)
Prior art keywords
security policy
smart card
security
policy
application layer
Prior art date
Application number
PCT/CN2021/104178
Other languages
French (fr)
Chinese (zh)
Inventor
张新访
董逢华
胡瑞璟
肖灵
苏昆
Original Assignee
武汉天喻信息产业股份有限公司
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 武汉天喻信息产业股份有限公司 filed Critical 武汉天喻信息产业股份有限公司
Publication of WO2022227273A1 publication Critical patent/WO2022227273A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • G06F21/77Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information in smart cards
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • G06F21/75Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information by inhibiting the analysis of circuitry or operation
    • G06F21/755Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information by inhibiting the analysis of circuitry or operation with measures against power attack

Definitions

  • the present invention relates to the field of smart cards, in particular to a method and device for protecting smart cards against side channel attacks.
  • a smart card is a general term for a plastic card with a microchip embedded in it.
  • a smart card requires data interaction through a reader and may be subject to side-channel attacks in the process.
  • Side-channel attack is an attack method that utilizes the information leaked by the smart card during the operation process.
  • the power consumption attack is a common attack method currently used by attackers. This type of attack is represented by differential power analysis (side channel).
  • the attack method collects the power consumption information of the chip in the encryption operation of the smart card, and then processes and analyzes the power consumption information to obtain useful information about the cracking.
  • security processing methods are generally added at the chip layer of the smart card or the COS (Chip Operating System, on-chip operating system) layer of the smart card to prevent various side-channel attacks. Because different chips or different COS layers implement different protection methods, it is difficult to ensure that all key processes can meet the security requirements, so new security processing methods need to be added.
  • COS Chip Operating System, on-chip operating system
  • Embodiments of the present invention provide a smart card anti-side channel attack protection method and device, so as to solve the inconsistency in the implementation of different chip layers or COS layers in related technologies, and it is difficult to ensure that all key processes can meet the security requirements, so it is necessary to add new Security processing method, but if too much security processing is added, it will increase the difficulty of application development and debugging.
  • a first aspect provides a smart card anti-side channel attack protection method, a smart card anti-side channel attack protection method, characterized in that it includes the following steps: calculating a security policy sequence number according to a security policy sequence mark and a policy factor; The security policy serial number invokes the corresponding security policy in the application layer of the smart card; the application layer executes the corresponding security policy.
  • the security policy includes one or more types of security policies, and before invoking the corresponding security policy in the application layer of the smart card according to the security policy sequence number, including: performing one or more of the security policies in sequence. Numbering.
  • the security policies include one or more types, each of the security policies has a corresponding number, and the invoking the corresponding security policies in the application layer of the smart card according to the security policy sequence number includes: when When the security policy serial number is the same as the security policy number, the security policy corresponding to the number is invoked.
  • the calculating the security policy sequence number according to the security policy sequence mark and the policy factor includes: taking the remainder of the security policy sequence mark and the policy factor to obtain the security policy sequence number; wherein, the security policy sequence number
  • the tag includes at least one byte, and each byte takes the remainder of the policy factor to obtain the security policy sequence number, and the policy factor is a preset positive integer.
  • the method further includes: executing an application process; and executing the above-mentioned smart card anti-side-channel attack protection method again.
  • a smart card anti-side channel attack protection device which includes: a calculation module for calculating a security policy sequence number according to a security policy sequence mark and a policy factor; a calling module for calculating a security policy sequence number according to the security policy sequence number The corresponding security policy in the application layer of the smart card is called; the execution module is used for executing the corresponding security policy in the application layer.
  • the smart card anti-side channel attack protection device further includes an acquisition module configured to acquire the security policy sequence mark, wherein the security policy sequence mark is a random number.
  • a computer device in a third aspect, includes a processor and a memory, the memory stores at least one piece of program code, the program code is loaded and executed by the processor to implement the above smart card Anti-side channel attack protection method.
  • a computer-readable storage medium stores at least one piece of program code, the program code is loaded and executed by a processor to implement the above-mentioned smart card anti-side-channel attack protection method.
  • FIG. 2 is a flowchart of steps of a first smart card anti-side channel attack protection method provided by an embodiment of the present invention
  • FIG. 3 is a flowchart of steps of a second smart card anti-side channel attack protection method provided by an embodiment of the present invention
  • FIG. 4 is a flowchart of steps of executing a corresponding security policy at an application layer in a method for protecting against side channel attacks on a smart card provided by an embodiment of the present invention
  • FIG. 5 is a flowchart of steps of a third smart card anti-side channel attack protection method provided by an embodiment of the present invention.
  • the embodiments of the present invention provide a smart card anti-side channel attack protection method and device, which can solve the inconsistency of implementation of different chip layers or COS layers, and it is difficult to ensure that all key processes can meet the security requirements, so it is necessary to add new security However, if too much security processing is added, it will increase the difficulty of application development and debugging.
  • a method for protecting a smart card against side channel attacks may include the following steps:
  • S201 Calculate the security policy sequence number according to the security policy sequence mark and the policy factor.
  • the smart card before S201, it is possible to check whether the smart card is under attack through the program counter, add 1 to the last input value of the program counter, and compare it with the internally stored value, if If it is inconsistent, the verification fails, indicating that there is an external attack, record the number of attacks, and the smart card enters an abnormal state to lock. It can be used as the value of the security policy sequence tag, and the security policy sequence number obtained after the security policy sequence tag and the policy factor are calculated are also random.
  • the calculation of the security policy sequence number according to the security policy sequence mark and the policy factor may specifically include: the value of the policy factor is denoted as ⁇ , ⁇ may be an integer greater than 0, and the security policy sequence mark may be composed of multiple bytes Composition, each byte can be a random number generated before the application layer process, each byte can be calculated by taking the remainder of ⁇ to obtain a security policy serial number to call the security policy, the security policy serial number is denoted as x, according to the calculation of the remainder The formula can know that the value range of x is from 0 to ⁇ -1. Since the bytes marked by the security policy sequence are random numbers obtained randomly, the value x obtained by the bytes calculated by taking the remainder of the policy factor ⁇ is also random.
  • the smart card issuer can control the value range of the security policy serial number value x by setting ⁇ , which can further increase the diversity of configuration security policies. By setting different numbers of bytes, different security policies can be flexibly configured. When the smart card does not need a strong ability to resist side channel attacks, a small number of bytes can be set to invoke the security policy to resist side channel attacks without increasing It is difficult to develop and debug the application layer. When the smart card needs a strong ability to resist side channel attacks, you can increase the number of security policies to be invoked by increasing the number of bytes, so as to strengthen the ability of the smart card to resist side channel attacks.
  • S202 Invoke the corresponding security policy in the application layer security policy according to the security policy sequence number.
  • the security policy includes one or more, and before invoking the corresponding security policy in the application layer of the smart card according to the security policy sequence number, it may include: pressing one or more of the security policies according to Numbering is performed in sequence, and the security policies can have ⁇ types. All types of security policies are numbered from 1 to ⁇ . After the security policies are numbered, it is convenient to call the security policies according to the numbers to resist side channel attacks.
  • the security policies include one or more types, that is, ⁇ is 1 or greater than 1, each of the security policies corresponds to a number, and the application of the smart card is invoked according to the security policy sequence number.
  • the corresponding security policy in the layer may include: when the calculated security policy serial number is a number between 1 and ⁇ , calling the security policy with the same number and security policy serial number to resist side channel attacks. When the security policy serial number is greater than ⁇ , there is no corresponding security policy to call. This calling method is simple and can call the security policy one by one.
  • the calculated security policy serial number may or may not call the security policy.
  • the security policy can be called, which increases the diversity of security policy configuration schemes.
  • the security policy serial number can be a number from 1 to ⁇ , then a security policy with the corresponding number from 1 to ⁇ can be called, and the security policy serial number can also be greater than ⁇ and less than or equal to ⁇ -1 or If the number is equal to 0, there is no corresponding security policy that can be invoked.
  • the smart card issuer can control the calling security by setting the value of the policy factor. The number of types of policies or the probability of invoking a security policy.
  • S203 Execute the security policy at the application layer.
  • the security policy includes one or more types, and executing the corresponding security policy at the application layer may include: step S301 , determining the corresponding security policy according to the security policy enable flag Whether the security policy is enabled, if so, execute the corresponding security policy.
  • the security policy sequence mark includes multiple bytes, each byte calculates the policy factor to obtain a security policy sequence number. If the security policy sequence number does not have a corresponding security policy sequence number If the security policy can be invoked, continue to search for the next byte. If the security policy serial number has a corresponding security policy that can be invoked, then judge whether the corresponding security policy is enabled according to the security policy enable flag, and if it is enabled, execute the corresponding security policy.
  • the security policy enable flag may include at least one bit, and the number of bits may be the same as the The number of security policies is the same, each bit can correspond to a security policy, and each bit can be numbered from 1. When the bit is 1, it means that the corresponding security policy is in the open state, and the corresponding security policy can be called after being called. Execute, when the bit is 0, it means that the corresponding security policy is in a closed state, and the corresponding security policy cannot be executed after being invoked. You can control whether to execute the invoked security policy by setting the bit. It is set by the smart card issuer under certain conditions, so that it is convenient to choose a flexible security configuration scheme according to the actual situation. This method increases the diversity of protection strategies.
  • step S302 may be further included to execute the called security policy according to a security policy input factor, and the value of the security policy input factor is generated before the application layer process.
  • the random number can be generated by a random number generator.
  • the value of the security policy input factor can be the same as or different from the value marked in the security policy sequence.
  • the security policy input factor can increase the diversity of security policy execution. To further increase the anti-attack capability of the smart card, after executing all the called security policies, the next program counter can be generated, saved and returned.
  • the security policy includes one or more of increasing a random delay, increasing an algorithm operation, performing a write operation to a specific address, or increasing a specific data operation according to an input factor of the security policy, wherein the The security policy input factor is a random number; specifically, the security policy includes:
  • a random delay can be introduced at the application layer, so that the encryption operation does not occur at the same time point of multiple power consumption waveforms, which increases the difficulty of the alignment operation, which in turn increases the difficulty of side channel attacks.
  • the length of the random delay can be The length of the security policy input factor.
  • the algorithm can be a symmetric algorithm or a digest algorithm, such as DES, 3DES, SM1, SM3, SM4, SHA1, SHA256, etc., where DES is a block encrypted with a key Algorithm, 3DES is a general term for triple data encryption algorithm block cipher, SM1, SM3, SM4 is a national secret algorithm issued by the National Cryptography Administration, SHA1, SHA256 are planned by the US National Security Agency, and by the US National Standards and Skills The algorithm released by the research institute, the key and data used by the above algorithm can be calculated according to the security policy input factor.
  • DES is a block encrypted with a key Algorithm
  • 3DES is a general term for triple data encryption algorithm block cipher
  • SM1, SM3, SM4 is a national secret algorithm issued by the National Cryptography Administration
  • SHA1, SHA256 are planned by the US National Security Agency, and by the US National Standards and Skills
  • the algorithm released by the research institute, the key and data used by the above algorithm can
  • a write operation can be performed to a specific address at the application layer, and the written data and length can be calculated according to the security policy input factor.
  • a specific data copy or data comparison operation can be added at the application layer, and the data length and content can be calculated according to the security policy input factor.
  • step S3 may be included to execute an application process, and the application process may be PIN verification
  • step S4 may also include selecting the execution order and the number of the current security policy according to the random number obtained at the beginning of the application process as the security policy sequence mark and the security policy input factor, for use in Resist side-channel attacks, and finally return the verification result.
  • a smart card anti-side-channel attack protection device may include a computing module, a calling module and an execution module.
  • the detailed description of each module is as follows: The policy sequence mark and the policy factor calculate the security policy sequence number; the calling module is used for calling the corresponding security policy in the application layer of the smart card according to the security policy sequence number; the execution module is used for executing the corresponding security policy at the application layer .
  • the smart card anti-side-channel attack protection device is used to implement a security control center at the application layer, uniformly configure and manage the security policy of the application layer, and the security processing of the application layer is carried out in the security control center.
  • the side-channel attack protection device invokes security policies to resist side-channel attacks. By hiding important processes among various random security policies, it enhances the ability of smart cards to resist side-channel attacks, and greatly reduces the difficulty of increasing security processing at the application layer. Reduces the difficulty of application development and debugging.
  • the smart card anti-side channel attack protection device further includes an acquisition module, which is configured to acquire the security policy sequence mark, wherein the security policy sequence mark is a random number, and The security policy input factor can be obtained, and its security input factor is also a random number.
  • the random number can be generated by a random number generator.
  • the security policy sequence mark and the security policy input factor can be the same random number or different random numbers.
  • the random number method makes the invoked security policy random, which further increases the ability of the smart card to resist side-channel attacks. There is no need to add too many security policies to resist side-channel attacks, which reduces the difficulty of application development and debugging.
  • embodiments of the present invention also provide a computer device, which may include a processor and a memory, and the memory may store a piece of program code or multiple pieces of program code, and the program code is loaded and executed by the processor to achieve the following: The above-mentioned smart card anti-side channel attack protection method.
  • embodiments of the present invention further provide a computer-readable storage medium, where one piece of program code or multiple pieces of program code may be stored in the computer-readable storage medium, and the program code is loaded and executed by a processor to achieve the following: The above-mentioned smart card anti-side channel attack protection method.
  • the smart card anti-side channel attack protection method is to calculate the security policy sequence number by taking the remainder of the policy factor according to the security policy sequence mark, and then calling the corresponding security policy in the application layer of the smart card according to the security policy sequence number, and executing the corresponding security policy at the application layer.
  • Policies are used to resist side channel attacks.
  • the smart card anti-side channel attack protection device implements a security control center at the application layer to uniformly configure and manage application layer security policies. It is used to invoke application layer security policies before and after the application layer process to resist side channel attack. Therefore, the application layer only needs to call the smart card anti-side-channel attack protection device before and after important processes to resist side-channel attacks. It reduces the difficulty of adding security processing at the application layer, and reduces the difficulty of application development and debugging.
  • the terms “installed”, “connected” and “connected” should be understood in a broad sense, for example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection, It can also be an electrical connection; it can be a direct connection, an indirect connection through an intermediate medium, or an internal connection between two components.
  • installed should be understood in a broad sense, for example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection, It can also be an electrical connection; it can be a direct connection, an indirect connection through an intermediate medium, or an internal connection between two components.

Abstract

The present invention relates to a smart card protection method and apparatus capable of side channel attack resistance. The method comprises the following steps: calculating a security policy sequence number according to a security policy sequence mark and a policy factor; calling a corresponding security policy in an application layer of a smart card according to the security policy sequence number; and executing the corresponding security policy in the application layer. Security requirements can be met on chips with different security levels by means of an application layer of a smart card merely calling, before and after an important process, a security policy by means of a smart card protection apparatus capable of side channel attack resistance, such that the difficulty of adding security processing to an application is reduced, and by means of hiding the process between random security policies, a capability of the smart card to resist a side channel attack is enhanced.

Description

一种智能卡抗侧信道攻击防护方法和装置A kind of smart card anti-side channel attack protection method and device 技术领域technical field
本发明涉及智能卡领域,特别涉及一种智能卡抗侧信道攻击防护方法和装置。The present invention relates to the field of smart cards, in particular to a method and device for protecting smart cards against side channel attacks.
背景技术Background technique
随着智能卡的日益普及,智能卡的应用已经遍布人们生活的方方面面。智能卡是内嵌有微芯片的塑料卡的通称,智能卡需要通过读写器进行数据交互,在这个过程中可能会受到旁路攻击。旁路攻击是利用智能卡在运算过程中泄漏出的信息进行攻击的一种攻击方法,其中的功耗攻击是目前攻击者常用的攻击方法,以差分功耗分析(侧信道)为代表的该类型攻击手段采集的是智能卡加密运算中芯片的功率消耗信息,然后对功耗信息处理和分析,获取关于破解的有用信息。With the increasing popularity of smart cards, the application of smart cards has spread to all aspects of people's lives. A smart card is a general term for a plastic card with a microchip embedded in it. A smart card requires data interaction through a reader and may be subject to side-channel attacks in the process. Side-channel attack is an attack method that utilizes the information leaked by the smart card during the operation process. The power consumption attack is a common attack method currently used by attackers. This type of attack is represented by differential power analysis (side channel). The attack method collects the power consumption information of the chip in the encryption operation of the smart card, and then processes and analyzes the power consumption information to obtain useful information about the cracking.
相关技术中,一般是在智能卡的芯片层或者智能卡的COS(Chip Operating System,片内操作系统)层增加安全处理方法,防止各类旁路攻击。因为不同的芯片或者不同的COS层实现的防护方式不一样,很难保证所有的重点流程都能满足安全要求,因此需要增加新的安全处理方法。In the related art, security processing methods are generally added at the chip layer of the smart card or the COS (Chip Operating System, on-chip operating system) layer of the smart card to prevent various side-channel attacks. Because different chips or different COS layers implement different protection methods, it is difficult to ensure that all key processes can meet the security requirements, so new security processing methods need to be added.
但是,实现安全防护策略必将付出代码长度、运算时间、RAM(RandomAccess Memory,随机存取存储器)空间等方面的开销代价,如果增加过多的安全处理,就会增加应用开发调测的难度,这将影响智能卡的可用性。However, implementing the security protection strategy will inevitably pay the cost of code length, computing time, RAM (Random Access Memory, random access memory) space, etc. If too much security processing is added, it will increase the difficulty of application development and debugging. This will affect the availability of smart cards.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供一种智能卡抗侧信道攻击防护方法和装置,以解决相关技术中不同的芯片层或者COS层实现不一致,很难保证所有的重点流程都能满足安全要求,因此需要增加新的安全处理方法,但是如果增加过多的安全处理,就会增加应用开发调测的难度的问题。Embodiments of the present invention provide a smart card anti-side channel attack protection method and device, so as to solve the inconsistency in the implementation of different chip layers or COS layers in related technologies, and it is difficult to ensure that all key processes can meet the security requirements, so it is necessary to add new Security processing method, but if too much security processing is added, it will increase the difficulty of application development and debugging.
第一方面,提供了一种智能卡抗侧信道攻击防护方法,一种智能卡抗侧信道攻击防护方法,其特征在于,其包括以下步骤:根据安全 策略顺序标记以及策略因子计算安全策略序号;根据所述安全策略序号调用智能卡的应用层中相应的安全策略;在应用层执行相应的所述安全策略。A first aspect provides a smart card anti-side channel attack protection method, a smart card anti-side channel attack protection method, characterized in that it includes the following steps: calculating a security policy sequence number according to a security policy sequence mark and a policy factor; The security policy serial number invokes the corresponding security policy in the application layer of the smart card; the application layer executes the corresponding security policy.
一些实施例中,在根据安全策略顺序标记以及策略因子计算安全策略序号之前,还包括:获取所述安全策略顺序标记,其中,所述安全策略顺序标记为随机数。In some embodiments, before calculating the security policy sequence number according to the security policy sequence tag and the policy factor, the method further includes: acquiring the security policy sequence tag, wherein the security policy sequence tag is a random number.
一些实施例中,所述安全策略包括一种或者多种,在根据所述安全策略序号调用智能卡的应用层中相应的安全策略之前,包括:将一种或者多种所述安全策略按顺序进行编号。In some embodiments, the security policy includes one or more types of security policies, and before invoking the corresponding security policy in the application layer of the smart card according to the security policy sequence number, including: performing one or more of the security policies in sequence. Numbering.
一些实施例中,所述安全策略包括一种或者多种,每一种所述安全策略对应具有一个编号,所述根据所述安全策略序号调用智能卡的应用层中相应的安全策略,包括:当所述安全策略序号与所述安全策略的编号相同时,则调用与所述编号对应的所述安全策略。In some embodiments, the security policies include one or more types, each of the security policies has a corresponding number, and the invoking the corresponding security policies in the application layer of the smart card according to the security policy sequence number includes: when When the security policy serial number is the same as the security policy number, the security policy corresponding to the number is invoked.
一些实施例中,所述根据安全策略顺序标记以及策略因子计算安全策略序号,包括:将所述安全策略顺序标记对所述策略因子取余数得到所述安全策略序号;其中,所述安全策略顺序标记包括至少一个字节,每个字节对所述策略因子取余数得到一个所述安全策略序号,所述策略因子为预设的正整数。In some embodiments, the calculating the security policy sequence number according to the security policy sequence mark and the policy factor includes: taking the remainder of the security policy sequence mark and the policy factor to obtain the security policy sequence number; wherein, the security policy sequence number The tag includes at least one byte, and each byte takes the remainder of the policy factor to obtain the security policy sequence number, and the policy factor is a preset positive integer.
一些实施例中,所述安全策略包括一种或者多种,所述在应用层执行相应的所述安全策略,包括:根据安全策略启用标记判断相应的所述安全策略是否开启,若是,则执行对应的所述安全策略;其中,所述安全策略启用标记包括至少一个bit位,每个bit位对应一种所述安全策略,当所述bit位为1时,对应的所述安全策略处于开启状态;当所述bit位为0时,对应的所述安全策略处于关闭状态。In some embodiments, the security policy includes one or more types, and executing the corresponding security policy at the application layer includes: judging whether the corresponding security policy is enabled according to the security policy enable flag, and if so, executing the corresponding security policy. The corresponding security policy; wherein, the security policy enable flag includes at least one bit, each bit corresponds to one of the security policies, and when the bit is 1, the corresponding security policy is on state; when the bit is 0, the corresponding security policy is in a closed state.
一些实施例中,所述安全策略包括根据安全策略输入因子,增加随机延时、增加算法运算、对特定地址做写操作或者增加特定的数据操作其中的一种或者多种,其中,所述安全策略输入因子为随机数。In some embodiments, the security policy includes one or more of increasing random delay, increasing algorithm operation, performing a write operation to a specific address, or increasing a specific data operation according to the input factor of the security policy, wherein the security The policy input factor is a random number.
一些实施例中,在应用层执行相应的所述安全策略之后,还包括: 执行应用流程;再次执行上述的智能卡抗侧信道攻击防护方法。In some embodiments, after the application layer executes the corresponding security policy, the method further includes: executing an application process; and executing the above-mentioned smart card anti-side-channel attack protection method again.
第二方面,提供了一种智能卡抗侧信道攻击防护装置,其包括:计算模块,其用于根据安全策略顺序标记以及策略因子计算安全策略序号;调用模块,其用于根据所述安全策略序号调用智能卡的应用层中相应的安全策略;执行模块,其用于在应用层执行相应的所述安全策略。In a second aspect, a smart card anti-side channel attack protection device is provided, which includes: a calculation module for calculating a security policy sequence number according to a security policy sequence mark and a policy factor; a calling module for calculating a security policy sequence number according to the security policy sequence number The corresponding security policy in the application layer of the smart card is called; the execution module is used for executing the corresponding security policy in the application layer.
一些实施例中,所述智能卡抗侧信道攻击防护装置还包括获取模块,其用于获取所述安全策略顺序标记,其中,所述安全策略顺序标记为随机数。In some embodiments, the smart card anti-side channel attack protection device further includes an acquisition module configured to acquire the security policy sequence mark, wherein the security policy sequence mark is a random number.
第三方面,提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条程序代码,所述程序代码由所述处理器加载并执行以实现如上述的智能卡抗侧信道攻击防护方法。In a third aspect, a computer device is provided, the computer device includes a processor and a memory, the memory stores at least one piece of program code, the program code is loaded and executed by the processor to implement the above smart card Anti-side channel attack protection method.
第四方面,一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条程序代码,所述程序代码由处理器加载并执行以实现如上述的智能卡抗侧信道攻击防护方法。In a fourth aspect, a computer-readable storage medium stores at least one piece of program code, the program code is loaded and executed by a processor to implement the above-mentioned smart card anti-side-channel attack protection method.
本发明提供的技术方案带来的有益效果包括:The beneficial effects brought by the technical solution provided by the present invention include:
本发明实施例提供了一种智能卡抗侧信道攻击防护方法和装置,由于智能卡抗侧信道攻击防护方法是根据安全策略顺序标记以及策略因子计算安全策略序号,根据所述安全策略序号调用智能卡的应用层中相应的安全策略,在应用层执行相应的所述安全策略。因此,应用层只需要在重要流程前通过调用安全策略的方法来抵抗侧信道攻击,不用增加过多的安全处理,大大降低了应用层增加安全处理的难度,降低了应用开发调测的难度。Embodiments of the present invention provide a smart card anti-side channel attack protection method and device, because the smart card anti-side channel attack protection method calculates a security policy sequence number according to a security policy sequence mark and a policy factor, and invokes an application of a smart card according to the security policy sequence number The corresponding security policy in the layer is implemented, and the corresponding security policy is implemented in the application layer. Therefore, the application layer only needs to use the security policy method to resist side-channel attacks before important processes, without adding too much security processing, which greatly reduces the difficulty of adding security processing at the application layer and reduces the difficulty of application development and debugging.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在 不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.
图1为本发明实施例提供的一种智能卡抗侧信道攻击防护装置的结构示意图;1 is a schematic structural diagram of a smart card anti-side channel attack protection device according to an embodiment of the present invention;
图2为本发明实施例提供的第一种智能卡抗侧信道攻击防护方法的步骤流程图;FIG. 2 is a flowchart of steps of a first smart card anti-side channel attack protection method provided by an embodiment of the present invention;
图3为本发明实施例提供的第二种智能卡抗侧信道攻击防护方法的步骤流程图;3 is a flowchart of steps of a second smart card anti-side channel attack protection method provided by an embodiment of the present invention;
图4为本发明实施例提供的一种智能卡抗侧信道攻击防护方法在应用层执行相应的安全策略的步骤流程图;FIG. 4 is a flowchart of steps of executing a corresponding security policy at an application layer in a method for protecting against side channel attacks on a smart card provided by an embodiment of the present invention;
图5为本发明实施例提供的第三种智能卡抗侧信道攻击防护方法的步骤流程图。FIG. 5 is a flowchart of steps of a third smart card anti-side channel attack protection method provided by an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present invention.
本发明实施例提供了一种智能卡抗侧信道攻击防护方法和装置,其能解决不同的芯片层或者COS层实现不一致,很难保证所有的重点流程都能满足安全要求,因此需要增加新的安全处理方法,但是如果增加过多的安全处理,就会增加应用开发调测的难度的问题。The embodiments of the present invention provide a smart card anti-side channel attack protection method and device, which can solve the inconsistency of implementation of different chip layers or COS layers, and it is difficult to ensure that all key processes can meet the security requirements, so it is necessary to add new security However, if too much security processing is added, it will increase the difficulty of application development and debugging.
参见图2所示,为本发明实施例提供的一种智能卡抗侧信道攻击防护方法,其可以包括以下步骤:Referring to FIG. 2, a method for protecting a smart card against side channel attacks provided by an embodiment of the present invention may include the following steps:
S201:根据安全策略顺序标记以及策略因子计算安全策略序号。S201: Calculate the security policy sequence number according to the security policy sequence mark and the policy factor.
参见图3和图5所示,在一些实施例中,于S201之前,可以通过程序计数器来校验智能卡是否受到攻击,将输入的上一次程序计数器数值加1,和内部保存的值比较,如果不一致则校验不通过说明存在外 部攻击,记录攻击次数,智能卡进入异常状态锁死,如果校验通过则继续步骤S1,先获取随机数,随机数可以由随机数生成器产生,随机数的数值可以作为安全策略顺序标记的数值,安全策略顺序标记以及策略因子计算后得到的安全策略序号也是随机的。Referring to FIG. 3 and FIG. 5 , in some embodiments, before S201, it is possible to check whether the smart card is under attack through the program counter, add 1 to the last input value of the program counter, and compare it with the internally stored value, if If it is inconsistent, the verification fails, indicating that there is an external attack, record the number of attacks, and the smart card enters an abnormal state to lock. It can be used as the value of the security policy sequence tag, and the security policy sequence number obtained after the security policy sequence tag and the policy factor are calculated are also random.
在一些实施例中,所述根据安全策略顺序标记以及策略因子计算安全策略序号,具体可以包括:策略因子数值记为β,β可以是大于0的整数,安全策略顺序标记可以由多个字节组成,每个字节可以是应用层流程之前产生的随机数,每个字节可以通过对β取余数计算得到一个安全策略序号来调用安全策略,安全策略序号记为x,根据取余数的计算公式可以知道x的取值范围是0到β-1,由于安全策略顺序标记的字节是随机获取的随机数,则字节通过对策略因子β取余数计算后得到的值x也是随机的,智能卡发卡方可以通过对β的设置来控制安全策略序号数值x的取值范围,能进一步增加配置安全策略的多样性,有更多的安全策略配置方案去抵抗侧信道攻击,也可以根据实际情况通过设置不同数量的字节,来灵活配置不同的安全策略,当智能卡不需要很强的抵抗侧信道攻击能力时,可以设置少量的字节来调用安全策略用于抵抗侧信道攻击,不会增加应用层开发调测的难度,当智能卡需要很强的抵抗侧信道攻击能力时,可以通过增加字节的数量来增加调用的安全策略数量,加强智能卡抵抗侧信道攻击能力。In some embodiments, the calculation of the security policy sequence number according to the security policy sequence mark and the policy factor may specifically include: the value of the policy factor is denoted as β, β may be an integer greater than 0, and the security policy sequence mark may be composed of multiple bytes Composition, each byte can be a random number generated before the application layer process, each byte can be calculated by taking the remainder of β to obtain a security policy serial number to call the security policy, the security policy serial number is denoted as x, according to the calculation of the remainder The formula can know that the value range of x is from 0 to β-1. Since the bytes marked by the security policy sequence are random numbers obtained randomly, the value x obtained by the bytes calculated by taking the remainder of the policy factor β is also random. The smart card issuer can control the value range of the security policy serial number value x by setting β, which can further increase the diversity of configuration security policies. By setting different numbers of bytes, different security policies can be flexibly configured. When the smart card does not need a strong ability to resist side channel attacks, a small number of bytes can be set to invoke the security policy to resist side channel attacks without increasing It is difficult to develop and debug the application layer. When the smart card needs a strong ability to resist side channel attacks, you can increase the number of security policies to be invoked by increasing the number of bytes, so as to strengthen the ability of the smart card to resist side channel attacks.
S202:根据所述安全策略序号调用应用层安全策略中相应的安全策略。S202: Invoke the corresponding security policy in the application layer security policy according to the security policy sequence number.
在一些实施例中,所述安全策略包括一种或者多种,在根据所述安全策略序号调用智能卡的应用层中相应的安全策略之前,可以包括:将一种或者多种所述安全策略按顺序进行编号,所述安全策略可以有α种,将所有种类的安全策略从1开始到α编号,对安全策略编号后方便按照编号调用安全策略用于抵抗侧信道攻击。In some embodiments, the security policy includes one or more, and before invoking the corresponding security policy in the application layer of the smart card according to the security policy sequence number, it may include: pressing one or more of the security policies according to Numbering is performed in sequence, and the security policies can have α types. All types of security policies are numbered from 1 to α. After the security policies are numbered, it is convenient to call the security policies according to the numbers to resist side channel attacks.
在一些实施例中,所述安全策略包括一种或者多种,也即α为1或者大于1,每一种所述安全策略对应具有一个编号,所述根据所述安 全策略序号调用智能卡的应用层中相应的安全策略,可以包括:当计算得到的安全策略序号为1到α之中的数时,则调用数字编号和安全策略序号相同的安全策略用于抵抗侧信道攻击,当计算得到的安全策略序号为大于α的数时,则没有对应的安全策略可以调用,这种调用方法简单,能一一对应的调用安全策略,计算出的安全策略序号有可能可以调用安全策略,也有可能不可以调用安全策略,增加了安全策略配置方案的多样性,本实施例中,安全策略顺序标记可以通过对策略因子取余数计算得到安全策略序号来调用安全策略,策略因子数值可以是β,β是大于0的整数,根据取余数的计算公式可以知道安全策略序号的取值范围是0到β-1,智能卡发卡方可以通过对β的设置来控制安全策略序号的取值范围,当β的值大于α时,安全策略序号可以是1至α之中的数,则可以调用编号为1至α之中对应编号的一种安全策略,安全策略序号还可以是大于α小于或等于β-1或等于0的数,则没有对应的安全策略可以调用,则β的值设置得越大,安全策略顺序标记通过对策略因子取余数计算后能调用对应安全策略的概率就越小;当β的值小于或等于α时,安全策略序号可以是0,则没有对应的安全策略可以调用,安全策略序号还可以是1到β-1之中的数,则可以调用编号为1到β-1之中对应编号的一种安全策略,则β的值设置得越小,字节通过取余数计算后能调用对应安全策略的种类就越少,智能卡发卡方可以通过对策略因子数值的设置来控制调用安全策略的种类数量或调用安全策略的概率。In some embodiments, the security policies include one or more types, that is, α is 1 or greater than 1, each of the security policies corresponds to a number, and the application of the smart card is invoked according to the security policy sequence number. The corresponding security policy in the layer may include: when the calculated security policy serial number is a number between 1 and α, calling the security policy with the same number and security policy serial number to resist side channel attacks. When the security policy serial number is greater than α, there is no corresponding security policy to call. This calling method is simple and can call the security policy one by one. The calculated security policy serial number may or may not call the security policy. The security policy can be called, which increases the diversity of security policy configuration schemes. In this embodiment, the security policy sequence mark can be calculated by taking the remainder of the policy factor to obtain the security policy serial number to call the security policy. The value of the policy factor can be β, and β is For an integer greater than 0, according to the calculation formula of the remainder, the value range of the security policy serial number can be known from 0 to β-1. The smart card issuer can control the value range of the security policy serial number by setting β. When the value of β When it is greater than α, the security policy serial number can be a number from 1 to α, then a security policy with the corresponding number from 1 to α can be called, and the security policy serial number can also be greater than α and less than or equal to β-1 or If the number is equal to 0, there is no corresponding security policy that can be invoked. The larger the value of β is, the smaller the probability that the security policy sequence mark can invoke the corresponding security policy after calculating the remainder of the policy factor; when the value of β When it is less than or equal to α, the security policy sequence number can be 0, then there is no corresponding security policy to call. A security policy corresponding to the number, the smaller the value of β is set, the fewer types of corresponding security policies can be called after the byte is calculated by taking the remainder. The smart card issuer can control the calling security by setting the value of the policy factor. The number of types of policies or the probability of invoking a security policy.
S203:在应用层执行所述安全策略。S203: Execute the security policy at the application layer.
参见图4所示,在一些实施例中,所述安全策略包括一种或者多种,所述在应用层执行相应的所述安全策略,可以包括:步骤S301,根据安全策略启用标记判断相应的所述安全策略是否开启,若是,则执行相应的所述安全策略,当安全策略顺序标记包括多个字节,每个字节对策略因子计算得到一个安全策略序号,如果安全策略序号没有对应的安全策略可以调用,则继续查找下一个字节,如果安全策略序 号有对应的安全策略可以调用,则根据安全策略启用标记判断相应的所述安全策略是否开启,若开启,则执行相应的所述安全策略,若不开启,则不执行相应的所述安全策略,继续查找下一个字节,直至所有字节执行完毕;安全策略启用标记可以包括至少一个bit位,bit位的数量可以和所述安全策略的数量相同,每个bit位可以对应一种安全策略,可以对每个bit位从1开始编号,当bit位为1时表示对应的安全策略处于开启状态,对应的安全策略调用后可以执行,当bit位为0时表示对应的安全策略处于关闭状态,对应的安全策略调用后不可以执行,可以通过对bit位的设置来控制是否执行调用的安全策略,安全策略启用标记可以在安全条件下由智能卡发卡方设置,便于根据实际情况选择灵活的安全配置方案,这种方法增加防护策略方式的多样性。Referring to FIG. 4 , in some embodiments, the security policy includes one or more types, and executing the corresponding security policy at the application layer may include: step S301 , determining the corresponding security policy according to the security policy enable flag Whether the security policy is enabled, if so, execute the corresponding security policy. When the security policy sequence mark includes multiple bytes, each byte calculates the policy factor to obtain a security policy sequence number. If the security policy sequence number does not have a corresponding security policy sequence number If the security policy can be invoked, continue to search for the next byte. If the security policy serial number has a corresponding security policy that can be invoked, then judge whether the corresponding security policy is enabled according to the security policy enable flag, and if it is enabled, execute the corresponding security policy. If the security policy is not enabled, the corresponding security policy will not be executed, and the next byte will continue to be searched until all bytes are executed; the security policy enable flag may include at least one bit, and the number of bits may be the same as the The number of security policies is the same, each bit can correspond to a security policy, and each bit can be numbered from 1. When the bit is 1, it means that the corresponding security policy is in the open state, and the corresponding security policy can be called after being called. Execute, when the bit is 0, it means that the corresponding security policy is in a closed state, and the corresponding security policy cannot be executed after being invoked. You can control whether to execute the invoked security policy by setting the bit. It is set by the smart card issuer under certain conditions, so that it is convenient to choose a flexible security configuration scheme according to the actual situation. This method increases the diversity of protection strategies.
参见图4所示,在一些实施例中,在步骤S301之后,还可以包括步骤S302,根据安全策略输入因子来执行调用的所述安全策略,安全策略输入因子的数值是在应用层流程前产生的随机数,随机数可以是随机数生成器产生的,安全策略输入因子的数值可以和安全策略顺序标记的数值相同,也可以不相同,通过安全策略输入因子可以增加安全策略执行的多样性,进一步增加智能卡抗攻击的能力,执行完所有调用的安全策略后,可以生成下一次程序计数器,保存并返回。Referring to FIG. 4 , in some embodiments, after step S301, step S302 may be further included to execute the called security policy according to a security policy input factor, and the value of the security policy input factor is generated before the application layer process. The random number can be generated by a random number generator. The value of the security policy input factor can be the same as or different from the value marked in the security policy sequence. The security policy input factor can increase the diversity of security policy execution. To further increase the anti-attack capability of the smart card, after executing all the called security policies, the next program counter can be generated, saved and returned.
在一些实施例中,所述安全策略包括根据安全策略输入因子,增加随机延时、增加算法运算、对特定地址做写操作或者增加特定的数据操作其中的一种或者多种,其中,所述安全策略输入因子为随机数;具体的,所述安全策略包括:In some embodiments, the security policy includes one or more of increasing a random delay, increasing an algorithm operation, performing a write operation to a specific address, or increasing a specific data operation according to an input factor of the security policy, wherein the The security policy input factor is a random number; specifically, the security policy includes:
1)应用层增加随机延时1) Add random delay at the application layer
可以在应用层通过引入随机延时,使得加密运算不发生在多条功耗波形图的同一时间点上,增加了对齐操作的难度,继而增加侧信道攻击的难度,随机延时的长度可以是安全策略输入因子的长度。A random delay can be introduced at the application layer, so that the encryption operation does not occur at the same time point of multiple power consumption waveforms, which increases the difficulty of the alignment operation, which in turn increases the difficulty of side channel attacks. The length of the random delay can be The length of the security policy input factor.
2)应用层增加算法运算2) The application layer adds algorithm operations
可以在应用层增加一次算法运算,算法可以是对称算法,还可以 是摘要算法,比如DES、3DES、SM1、SM3、SM4、SHA1、SHA256、等算法,其中DES是一种使用密钥加密的块算法,3DES是三重数据加密算法块密码的通称,SM1、SM3、SM4是一种国密算法由国家密码局发布的算法,SHA1、SHA256是由美国国家安全局所规划,并由美国国家规范与技能研究院发布的算法,上述算法使用的密钥和数据可以根据安全策略输入因子计算得来。An algorithm operation can be added at the application layer. The algorithm can be a symmetric algorithm or a digest algorithm, such as DES, 3DES, SM1, SM3, SM4, SHA1, SHA256, etc., where DES is a block encrypted with a key Algorithm, 3DES is a general term for triple data encryption algorithm block cipher, SM1, SM3, SM4 is a national secret algorithm issued by the National Cryptography Administration, SHA1, SHA256 are planned by the US National Security Agency, and by the US National Standards and Skills The algorithm released by the research institute, the key and data used by the above algorithm can be calculated according to the security policy input factor.
3)应用层对特定地址做写操作3) The application layer writes to a specific address
可以在应用层对特定地址做一次写入操作,写入的数据和长度可以根据安全策略输入因子计算得来。A write operation can be performed to a specific address at the application layer, and the written data and length can be calculated according to the security policy input factor.
4)应用层增加特定的数据操作4) The application layer adds specific data operations
可以在应用层增加一次特定的数据拷贝或数据比较操作,数据长度和内容可以根据安全策略输入因子计算得来。A specific data copy or data comparison operation can be added at the application layer, and the data length and content can be calculated according to the security policy input factor.
参见图3和图5所示,在一些实施例中,在应用层执行相应的所述安全策略之后,即执行完步骤S2后,可以包括步骤S3执行应用流程,应用流程可以是PIN校验,校验完后保存校验结果,还可以包括步骤S4再次根据应用流程起始时获取的随机数,作为安全策略顺序标记和安全策略输入因子选择本次安全策略的执行顺序和个数,用于抵抗侧信道攻击,最后返回校验结果,通过将重要流程隐藏在随机的各类安全策略之间,增强了智能卡抵抗侧信道攻击的能力。Referring to FIG. 3 and FIG. 5 , in some embodiments, after the application layer executes the corresponding security policy, that is, after step S2 is executed, step S3 may be included to execute an application process, and the application process may be PIN verification, After the verification is completed, the verification result is saved, and the step S4 may also include selecting the execution order and the number of the current security policy according to the random number obtained at the beginning of the application process as the security policy sequence mark and the security policy input factor, for use in Resist side-channel attacks, and finally return the verification result. By hiding important processes among various random security policies, the ability of smart cards to resist side-channel attacks is enhanced.
参见图1所示,为本发明实施例提供的一种智能卡抗侧信道攻击防护装置,可以包括计算模块,调用模块和执行模块,每个模块的详细描述如下:计算模块,其用于根据安全策略顺序标记以及策略因子计算安全策略序号;调用模块,其用于根据所述安全策略序号调用智能卡的应用层中相应的安全策略;执行模块,其用于在应用层执行相应的所述安全策略。Referring to FIG. 1 , a smart card anti-side-channel attack protection device provided by an embodiment of the present invention may include a computing module, a calling module and an execution module. The detailed description of each module is as follows: The policy sequence mark and the policy factor calculate the security policy sequence number; the calling module is used for calling the corresponding security policy in the application layer of the smart card according to the security policy sequence number; the execution module is used for executing the corresponding security policy at the application layer .
智能卡抗侧信道攻击防护装置用于在应用层实现一个安全控制中心,统一配置和管理应用层安全策略,应用层的安全处理在安全控制中心中进行,应用层只需要在重要流程前后通过智能卡抗侧信道攻击 防护装置调用安全策略来抵抗侧信道攻击,通过将重要流程隐藏在随机的各类安全策略之间,增强了智能卡抵抗侧信道攻击的能力,大大降低了应用层增加安全处理的难度,降低了应用开发调测的难度。The smart card anti-side-channel attack protection device is used to implement a security control center at the application layer, uniformly configure and manage the security policy of the application layer, and the security processing of the application layer is carried out in the security control center. The side-channel attack protection device invokes security policies to resist side-channel attacks. By hiding important processes among various random security policies, it enhances the ability of smart cards to resist side-channel attacks, and greatly reduces the difficulty of increasing security processing at the application layer. Reduces the difficulty of application development and debugging.
参见图1所示,在一些实施例中,所述智能卡抗侧信道攻击防护装置还包括获取模块,其用于获取所述安全策略顺序标记,其中,所述安全策略顺序标记为随机数,还可以获取安全策略输入因子,其安全输入因子也是随机数,随机数可以由随机数生成器产生,安全策略顺序标记和安全策略输入因子可以是相同的随机数也可以是不同的随机数,通过产生随机数的方式使得调用的安全策略也是随机的,进一步增加智能卡的抗侧信道攻击能力,不用增加过多的安全策略去抵抗侧信道攻击,降低应用开发调测的难度。Referring to FIG. 1 , in some embodiments, the smart card anti-side channel attack protection device further includes an acquisition module, which is configured to acquire the security policy sequence mark, wherein the security policy sequence mark is a random number, and The security policy input factor can be obtained, and its security input factor is also a random number. The random number can be generated by a random number generator. The security policy sequence mark and the security policy input factor can be the same random number or different random numbers. The random number method makes the invoked security policy random, which further increases the ability of the smart card to resist side-channel attacks. There is no need to add too many security policies to resist side-channel attacks, which reduces the difficulty of application development and debugging.
在一些实施例中,本发明实施例还提供了一种计算机设备,可以包括处理器和存储器,存储器中可以存储有一条程序代码或者多条程序代码,程序代码由处理器加载并执行以实现如上述的智能卡抗侧信道攻击防护方法。In some embodiments, embodiments of the present invention also provide a computer device, which may include a processor and a memory, and the memory may store a piece of program code or multiple pieces of program code, and the program code is loaded and executed by the processor to achieve the following: The above-mentioned smart card anti-side channel attack protection method.
在一些实施例中,本发明实施例还提供了一种计算机可读存储介质,计算机可读存储介质中可以存储有一条程序代码或者多条程序代码,程序代码由处理器加载并执行以实现如上述的智能卡抗侧信道攻击防护方法。In some embodiments, embodiments of the present invention further provide a computer-readable storage medium, where one piece of program code or multiple pieces of program code may be stored in the computer-readable storage medium, and the program code is loaded and executed by a processor to achieve the following: The above-mentioned smart card anti-side channel attack protection method.
本发明实施例提供的一种智能卡抗侧信道攻击防护方法和装置的原理为:The principles of a smart card anti-side channel attack protection method and device provided by the embodiments of the present invention are as follows:
由于智能卡抗侧信道攻击防护方法是根据安全策略顺序标记对策略因子取余数计算得到安全策略序号,再根据安全策略序号调用智能卡的应用层中相应的安全策略,在应用层执行相应的所述安全策略用于抵抗侧信道攻击,智能卡抗侧信道攻击防护装置在应用层实现一个安全控制中心,统一配置和管理应用层安全策略,其用于在应用层流程前后调用应用层安全策略用于抵抗侧信道攻击。因此,应用层只需要在重要流程前后调用智能卡抗侧信道攻击防护装置来抵抗侧信道攻 击,通过将重要流程隐藏在随机的各类安全策略之间,增强了智能卡抵抗侧信道攻击的能力,大大降低了应用层增加安全处理的难度,降低了应用开发调测的难度。Because the smart card anti-side channel attack protection method is to calculate the security policy sequence number by taking the remainder of the policy factor according to the security policy sequence mark, and then calling the corresponding security policy in the application layer of the smart card according to the security policy sequence number, and executing the corresponding security policy at the application layer. Policies are used to resist side channel attacks. The smart card anti-side channel attack protection device implements a security control center at the application layer to uniformly configure and manage application layer security policies. It is used to invoke application layer security policies before and after the application layer process to resist side channel attack. Therefore, the application layer only needs to call the smart card anti-side-channel attack protection device before and after important processes to resist side-channel attacks. It reduces the difficulty of adding security processing at the application layer, and reduces the difficulty of application development and debugging.
在本发明的描述中,需要说明的是,术语“上”、“下”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "upper", "lower", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, It is not intended to indicate or imply that the device or element referred to must have a particular orientation, be constructed and operate in a particular orientation, and therefore should not be construed as limiting the invention. Unless otherwise expressly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection, It can also be an electrical connection; it can be a direct connection, an indirect connection through an intermediate medium, or an internal connection between two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
需要说明的是,在本发明中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in the present invention, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and are not necessarily required or implied Any such actual relationship or sequence exists between these entities or operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
以上所述仅是本发明的具体实施方式,使本领域技术人员能够理解或实现本发明。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所申请的原理和新颖特点相一致的最宽的范围。The above descriptions are only specific embodiments of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims (10)

  1. 一种智能卡抗侧信道攻击防护方法,其特征在于,其包括以下步骤:A method for protecting a smart card against side channel attacks, comprising the following steps:
    根据安全策略顺序标记以及策略因子计算安全策略序号;Calculate the security policy serial number according to the security policy sequence mark and the policy factor;
    根据所述安全策略序号调用智能卡的应用层中相应的安全策略;Invoke the corresponding security policy in the application layer of the smart card according to the security policy serial number;
    在应用层执行相应的所述安全策略。The corresponding security policy is executed at the application layer.
  2. 如权利要求1所述的智能卡抗侧信道攻击防护方法,其特征在于,在根据安全策略顺序标记以及策略因子计算安全策略序号之前,还包括:The method for protecting a smart card against side-channel attacks according to claim 1, wherein before calculating the security policy sequence number according to the security policy sequence mark and the policy factor, the method further comprises:
    获取所述安全策略顺序标记,其中,所述安全策略顺序标记为随机数。Obtain the security policy sequence tag, where the security policy sequence tag is a random number.
  3. 如权利要求1所述的智能卡抗侧信道攻击防护方法,其特征在于,所述安全策略包括一种或者多种,每一种所述安全策略对应具有一个编号,所述根据所述安全策略序号调用智能卡的应用层中相应的安全策略,包括:The method for protecting a smart card against side-channel attacks according to claim 1, wherein the security policies include one or more types, each of the security policies has a corresponding number, and the security policies have a serial number according to the security policy. Invoke the corresponding security policy in the application layer of the smart card, including:
    当所述安全策略序号与所述安全策略的编号相同时,则调用与所述编号对应的所述安全策略。When the security policy serial number is the same as the security policy number, the security policy corresponding to the number is invoked.
  4. 如权利要求1所述的智能卡抗侧信道攻击防护方法,其特征在于,所述根据安全策略顺序标记以及策略因子计算安全策略序号,包括:The method for protecting a smart card against side-channel attacks according to claim 1, wherein the calculating the security policy sequence number according to the security policy sequence mark and the policy factor comprises:
    将所述安全策略顺序标记对所述策略因子取余数得到所述安全策略序号;Taking the remainder of the security policy sequence mark to the policy factor to obtain the security policy sequence number;
    其中,所述安全策略顺序标记包括至少一个字节,每个字节对所述策略因子取余数得到一个所述安全策略序号,所述策略因子为预设的正整数。The security policy sequence mark includes at least one byte, and each byte takes the remainder of the policy factor to obtain the security policy sequence number, and the policy factor is a preset positive integer.
  5. 如权利要求1所述的智能卡抗侧信道攻击防护方法,其特征在于,所述安全策略包括一种或者多种,所述在应用层执行相应的所述安全策略,包括:The method for protecting a smart card against side channel attacks according to claim 1, wherein the security policy includes one or more types, and the execution of the corresponding security policy at the application layer includes:
    根据安全策略启用标记判断相应的所述安全策略是否开启,若是, 则执行对应的所述安全策略;Determine whether the corresponding security policy is enabled according to the security policy enable flag, and if so, execute the corresponding security policy;
    其中,所述安全策略启用标记包括至少一个bit位,每个bit位对应一种所述安全策略,当所述bit位为1时,对应的所述安全策略处于开启状态;当所述bit位为0时,对应的所述安全策略处于关闭状态。Wherein, the security policy enable flag includes at least one bit, each bit corresponds to one of the security policies, when the bit is 1, the corresponding security policy is in an open state; when the bit is When it is 0, the corresponding security policy is in a closed state.
  6. 如权利要求1所述的智能卡抗侧信道攻击防护方法,其特征在于:The smart card anti-side channel attack protection method of claim 1, wherein:
    所述安全策略包括根据安全策略输入因子,增加随机延时、增加算法运算、对特定地址做写操作或者增加特定的数据操作其中的一种或者多种,其中,所述安全策略输入因子为随机数。The security policy includes, according to the security policy input factor, one or more of increasing random delay, increasing algorithm operation, performing a write operation to a specific address, or adding a specific data operation, wherein the security policy input factor is random. number.
  7. 如权利要求1所述的智能卡抗侧信道攻击防护方法,其特征在于,在应用层执行相应的所述安全策略之后,还包括:The method for protecting a smart card against side-channel attacks according to claim 1, wherein after the application layer executes the corresponding security policy, the method further comprises:
    执行应用流程;Execute the application process;
    再次执行权利要求1至7任一项所述的智能卡抗侧信道攻击防护方法。Execute the smart card anti-side channel attack protection method according to any one of claims 1 to 7 again.
  8. 一种智能卡抗侧信道攻击防护装置,其特征在于,其包括:A smart card anti-side channel attack protection device, characterized in that it includes:
    计算模块,其用于根据安全策略顺序标记以及策略因子计算安全策略序号;a calculation module, which is used to calculate the security policy sequence number according to the security policy sequence mark and the policy factor;
    调用模块,其用于根据所述安全策略序号调用智能卡的应用层中相应的安全策略;a calling module, which is used to call the corresponding security policy in the application layer of the smart card according to the security policy sequence number;
    执行模块,其用于在应用层执行相应的所述安全策略。an execution module, which is used for executing the corresponding security policy at the application layer.
  9. 一种计算机设备,其特征在于,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条程序代码,所述程序代码由所述处理器加载并执行以实现如权利要求1至7中任一项所述的智能卡抗侧信道攻击防护方法。A computer device, characterized in that, the computer device includes a processor and a memory, and the memory stores at least one piece of program code, the program code is loaded and executed by the processor to implement claims 1 to 7 The smart card anti-side channel attack protection method according to any one of the above.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有至少一条程序代码,所述程序代码由处理器加载并执行以实现如权利要求1至7中任一项所述的智能卡抗侧信道攻击防护方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores at least one piece of program code, and the program code is loaded and executed by a processor to implement any one of claims 1 to 7. The above-mentioned smart card anti-side channel attack protection method.
PCT/CN2021/104178 2021-04-30 2021-07-02 Smart card protection method and apparatus capable of side channel attack resistance WO2022227273A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110481089.8 2021-04-30
CN202110481089.8A CN113127940A (en) 2021-04-30 2021-04-30 Method and device for protecting smart card against side channel attack

Publications (1)

Publication Number Publication Date
WO2022227273A1 true WO2022227273A1 (en) 2022-11-03

Family

ID=76780723

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/104178 WO2022227273A1 (en) 2021-04-30 2021-07-02 Smart card protection method and apparatus capable of side channel attack resistance

Country Status (2)

Country Link
CN (1) CN113127940A (en)
WO (1) WO2022227273A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113569237B (en) * 2021-07-29 2024-04-02 武汉天喻信息产业股份有限公司 Attack protection method, device, equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888245A (en) * 2012-12-20 2014-06-25 北京握奇数据系统有限公司 S box randomized method and system for smart card
CN103903043A (en) * 2012-12-24 2014-07-02 北京握奇数据系统有限公司 Method and system for three-in-one smart card anti-side-channel-attack protection
CN106203578A (en) * 2015-05-08 2016-12-07 北京数码视讯科技股份有限公司 A kind of smart card, the security service call method of application of IC cards and device
CN108537536A (en) * 2018-06-21 2018-09-14 咪付(广西)网络技术有限公司 A kind of method for secure transactions and system based on strategy mark
US20180316663A1 (en) * 2017-05-01 2018-11-01 Microsoft Technology Licensing, Llc Smart card thumb print authentication

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105763327A (en) * 2014-12-16 2016-07-13 上海华虹集成电路有限责任公司 Safe random number generation method in intelligent card
CN106023162B (en) * 2016-05-12 2018-06-05 江西理工大学 Strawberry image dividing method based on Integrated Strategy harmonic search algorithm
CN110636032A (en) * 2018-06-21 2019-12-31 咪付(广西)网络技术有限公司 Method for generating security policy version

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888245A (en) * 2012-12-20 2014-06-25 北京握奇数据系统有限公司 S box randomized method and system for smart card
CN103903043A (en) * 2012-12-24 2014-07-02 北京握奇数据系统有限公司 Method and system for three-in-one smart card anti-side-channel-attack protection
CN106203578A (en) * 2015-05-08 2016-12-07 北京数码视讯科技股份有限公司 A kind of smart card, the security service call method of application of IC cards and device
US20180316663A1 (en) * 2017-05-01 2018-11-01 Microsoft Technology Licensing, Llc Smart card thumb print authentication
CN108537536A (en) * 2018-06-21 2018-09-14 咪付(广西)网络技术有限公司 A kind of method for secure transactions and system based on strategy mark

Also Published As

Publication number Publication date
CN113127940A (en) 2021-07-16

Similar Documents

Publication Publication Date Title
US11784786B2 (en) Mitigating security vulnerabilities with memory allocation markers in cryptographic computing systems
CN109643359B (en) Verification of control key-value store
US9537656B2 (en) Systems and methods for managing cryptographic keys in a secure microcontroller
Suh et al. AEGIS: A single-chip secure processor
EP3326105B1 (en) Technologies for secure programming of a cryptographic engine for secure i/o
US20200257827A1 (en) Memory write for ownership access in a core
US9418027B2 (en) Secure boot information with validation control data specifying a validation technique
KR102013841B1 (en) Method of managing key for secure storage of data, and and apparatus there-of
US8438658B2 (en) Providing sealed storage in a data processing device
US10491401B2 (en) Verification of code signature with flexible constraints
CN109828827A (en) A kind of detection method, device and relevant device
CN105339912B (en) Measure safety zone
US20090202078A1 (en) Device, system, and method of securely executing applications
US11664970B2 (en) Providing access to a hardware resource based on a canary value
US20150143533A1 (en) Method of generating a structure and corresponding structure
CN105678173A (en) vTPM safety protection method based on hardware transactional memory
Mus et al. Jolt: Recovering tls signing keys via rowhammer faults
WO2022227273A1 (en) Smart card protection method and apparatus capable of side channel attack resistance
US11750389B2 (en) System, method, and computer program product for performing hardware backed symmetric operations for password based authentication
Yalew et al. TruApp: A TrustZone-based authenticity detection service for mobile apps
WO2024036832A1 (en) Method for realizing smart token cryptography application interface on basis of tpm
CN112395631A (en) Secure database system, method and medium based on SGX technology
US20070150754A1 (en) Secure software system and method for a printer
US20220284088A1 (en) Authentication of write requests
US9213864B2 (en) Data processing apparatus and validity verification method

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: 21938741

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE