Formal verification of a program obfuscation based on mixed Boolean-arithmetic expressions

The insertion of expressions mixing arithmetic operators and bitwise boolean operators is a widespread protection of sensitive data in source programs. This recent advanced obfuscation technique is one of the less studied among program obfuscations even if it is commonly found in binary code. In this paper, we formally verify in Coq this data obfuscation. It operates over a generic notion of mixed boolean-arithmetic expressions and on properties of bitwise operators operating over machine integers. Our obfuscation performs two kinds of program transformations: rewriting of expressions and insertion of modular inverses. To facilitate its proof of correctness, we define boolean semantic tables, a data structure inspired from truth tables. Our obfuscation is integrated into the CompCert formally verified compiler where it operates over Clight programs. The automatic extraction of our program obfuscator into OCaml yields a program with competitive results.

[1]  Ninon Eyrolles,et al.  Obfuscation with Mixed Boolean-Arithmetic Expressions : reconstruction, analysis and simplification tools. (Obfuscation par expressions mixtes arithmético-booléennes : reconstruction, analyse et outils de simplification) , 2017 .

[2]  Christine Paulin-Mohring,et al.  The coq proof assistant reference manual , 2000 .

[3]  Xavier Leroy,et al.  A Formally Verified Compiler Back-end , 2009, Journal of Automated Reasoning.

[4]  Roberto Giacobazzi,et al.  Towards a formally verified obfuscating compiler , 2012 .

[5]  Pascal Junod,et al.  Obfuscator-LLVM -- Software Protection for the Masses , 2015, 2015 IEEE/ACM 1st International Workshop on Software Protection.

[6]  Stephen Drape,et al.  Specifying Imperative Data Obfuscations , 2007, ISC.

[7]  Christian S. Collberg,et al.  Surreptitious Software - Obfuscation, Watermarking, and Tamperproofing for Software Protection , 2009, Addison-Wesley Software Security Series.

[8]  Louis Goubin,et al.  Defeating MBA-based Obfuscation , 2016, SPRO@CCS.

[9]  Sandrine Blazy,et al.  Formal verification of control-flow graph flattening , 2016, CPP.

[10]  Xavier Leroy,et al.  Formal verification of a realistic compiler , 2009, CACM.

[11]  Yuan Xiang Gu,et al.  Information Hiding in Software with Mixed Boolean-Arithmetic Transforms , 2007, WISA.

[12]  Christian S. Collberg,et al.  Watermarking, Tamper-Proofing, and Obfuscation-Tools for Software Protection , 2002, IEEE Trans. Software Eng..

[13]  Xavier Leroy,et al.  Mechanized Semantics for the Clight Subset of the C Language , 2009, Journal of Automated Reasoning.