Side-channel attacks impose a serious threat to cryptographic algorithms, including widely employed ones, such as AES and RSA. These attacks take advantage of the algorithm implementation in hardware or software to extract secret information via side channels. Software masking is a mitigation approach against power side-channel attacks aiming at hiding the secret-revealing dependencies from the power footprint of a vulnerable implementation. However, this type of software mitigation often depends on general-purpose compilers, which do not preserve non-functional properties. Moreover, microarchitectural features, such as the memory bus and register reuse, may also leak secret information. These abstractions are not visible at the high-level implementation of the program. Instead, they are decided at compile time. To remedy these problems, security engineers often sacrifice code efficiency by turning off compiler optimization and/or performing local, post-compilation transformations. This paper proposes Secure by Construction Code Generation (SecCG), a constraint-based compiler approach that generates optimized yet secure against power side channels code. SecCG controls the quality of the mitigated program by efficiently searching the best possible low-level implementation according to a processor cost model. In our experiments with twelve masked cryptographic functions up to 100 lines of code on Mips32 and ARM Thumb, SecCG speeds up the generated code from 75% to 8 times compared to non-optimized secure code with an overhead of up to 7% compared to non-secure optimized code at the expense of a high compilation cost. In summary, this paper proposes a formal model to generate power side channel free low-level code.
翻译:侧通道攻击对加密算法构成严重威胁,包括广泛使用的加密算法,如AES和RSA。这些攻击利用硬件或软件的算法执行,通过侧渠道获取秘密信息。软件遮掩是针对电侧通道攻击的一种缓解办法,目的是将秘密移动依赖从脆弱执行的电力足迹隐藏起来。然而,这种软件的缓解往往取决于一般用途编译器,这些编译器并不保存不起作用的特性。此外,诸如记忆总线和登记册再利用等微分解功能也可能泄露秘密信息。这些抽象内容在硬件或软件的高级执行中看不到。相反,这些抽象内容是在编译时决定的。为了解决这些问题,安全工程师往往会牺牲代码效率,办法是关闭编译器的优化和/或进行本地的、拼凑后转换。本文提议由建筑代码生成安全,一种基于制约性的编译方法,既能优化又能保证对电路边节码的特性。SecG控制减制程序的质量,方法是高效地搜索最高级版本的不透明版本,在Semar32至高级版本的节码上,用Seam-C将一个最低级的节码到高级代码到高级代码。