Stealthy Opaque Predicates in Hardware - Obfuscating Constant Expressions at Negligible Overhead Max Hoffmann, Christof Paar Ruhr University Bochum, Horst-Görtz Institute for IT-Security, Germany CHES 2018 | Amsterdam 10.09.2018
Obfuscation Source: www.constructionknowledge.net Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 2
Why Obfuscation? “easy” High-level Finished Description Product “not that easy” Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 3
Why Obfuscation? “easy” aes.c High-level Finished Description Product aes.vhd “not that easy” Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 4
Why Obfuscation? 01010100101 “easy” 01000100101 aes.c 01110101010 01101010010 High-level Finished Description Product aes.vhd “not that easy” Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 5
Why Obfuscation? Obfuscation “easy” High-level Finished Description Product “insanely difficult” Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 6
Software Obfuscation • One target in software is control flow obfuscation. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 7
Software Obfuscation • One target in software is control flow obfuscation. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 8
Software Obfuscation • Opaque Predicates are used as a basic building block. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 9
Software Obfuscation • Opaque Predicates are used as a basic building block. • An opaque predicate: – is an expression Example: – looks like having a dynamic value (x * (x + 1)) % 2 == 0 – evaluates to a constant, known value Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 10
Software Obfuscation • Opaque Predicates are used as a basic building block. • An opaque predicate: – is an expression Example: – looks like having a dynamic value (x * (x + 1)) % 2 == 0 – evaluates to a constant, known value • Meant to harden against static analysis. Static Analysis : analysis performed solely on a static data, e.g., a binary. • Dynamic Analysis : analysis performed during operation, e.g., while • executing a binary. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 11
Example: Software Opaque Predicates if ((x * (x + 1)) % 2 == 0): foo() else bar() “True” control flow graph: • • Control flow graph of a static analyzer: … … check (x*(x+1))%2 =0 ≠0 foo() foo() bar() Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 12
A Software Obfuscation Technique in Hardware? • How can a software obfuscation technique help in hardware? • Obfuscation should harden against reverse engineering. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 13
A Software Obfuscation Technique in Hardware? • How can a software obfuscation technique help in hardware? • Obfuscation should harden against reverse engineering. • Reverse engineers rarely analyze an entire design. • Mostly: small parts of a design. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 14
A Software Obfuscation Technique in Hardware? • How can a software obfuscation technique help in hardware? • Obfuscation should harden against reverse engineering. • Reverse engineers rarely analyze an entire design. • Mostly: small parts of a design. • Goal : hide as much information as possible. reduces starting points for reverse engineers. makes understanding of any component harder. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 15
Example: Hardware Reversing if a = "0110" then if a = b then vs. output <= ‘1’; output <= ‘1’; end if; end if; Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 16
Example: Hardware Reversing if a = "0110" then if a = b then vs. output <= ‘1’; output <= ‘1’; end if; end if; Use OPs to hide information introduced by constant signals. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 17
P REVIOUS W ORK Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 18
Translation to Hardware • Only one prior work on opaque predicates. • Sergeichik et al. presented LFSR-based OPs in 2014 [1]. <feedback logic> 1 0 1 1 0 1 0 … OR 1 [1] Sergeichik and Ivaniuk. "Implementation of opaque predicates for fpga designs hardware obfuscation." (JICMS, 2014). Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 19
Stealthiness • Problem : Easy to detect, uncommon structure <feedback logic> • Removal via static analysis demonstrated in [1] . 1 0 1 1 0 1 0 … OR 1 [1] Wallat, Fyrbiak, Schlögel, and Paar . “A Look at the Dark Side of Hardware Reverse Engineering – A Case Study” ( IVSW , 2017) Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 20
Stealthiness • Problem : Easy to detect, uncommon structure <feedback logic> • Removal via static analysis demonstrated in [1] . 1 0 1 1 0 1 0 … OR 1 • Desired Metric : “ Stealthiness “ – Impossible (?) to measure – Human factor plays a role – Different in hardware and software [1] Wallat, Fyrbiak, Schlögel, and Paar . “A Look at the Dark Side of Hardware Reverse Engineering – A Case Study” ( IVSW , 2017) Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 21
O PAQUE P REDICATES IN H ARDWARE Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 22
Hardware OPs – Idea • Stealthiness: use common structures. • Try to use existing circuitry. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 23
Hardware OPs – Idea • Stealthiness: use common structures. • Try to use existing circuitry. • Observation : – Signals are changing constantly. – A signal’s value is only important while evaluated. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 24
Hardware OPs – Idea • Stealthiness: use common structures. • Try to use existing circuitry. • Observation : – Signals are changing constantly. – A signal’s value is only important while evaluated. → Use an existing signal which 1. has the required state whenever we need it 2. switches “randomly” when not needed. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 25
Example: Hardware OPs Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 26
Example: Hardware OPs • Constant value required in Work1 , Work2 , and Work3 . • Multiple options to use the state of an FSM as an OP. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 27
Example: Hardware OPs • Constant value required in Work1 , Work2 , and Work3 . • Multiple options to use the state of an FSM as an OP. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 28
Example: Hardware OPs • Constant value required in Work1 , Work2 , and Work3 . • Multiple options to use the state of an FSM as an OP. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 29
Hardware OPs • Example: – Constant 1101000 2 to be obfuscated. – 5-bit FSM passes 3 states during the processing period. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 30
Hardware OPs • 1 st State: 1 0 1 0 0 1 1 0 1 0 0 0 Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 31
Hardware OPs • 2 nd State: 1 1 0 0 0 1 1 0 1 0 0 0 Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 32
Hardware OPs • 3 rd State: 1 1 1 0 0 1 1 0 1 0 0 0 Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 33
Hardware OPs • 4 th State: 0 1 1 0 0 0 0 0 0 0 0 0 Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 34
Hardware OPs • Very stealthy: existing FSMs are used. • Zero additional gates (in theory…) Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 35
Hardware OPs • Very stealthy: existing FSMs are used. • Zero additional gates (in theory…) • Applicable to nearly all designs. • Considerably increases reversing effort: Reversing of control- and data-path required for identification of constants. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 36
Hardware OPs • Very stealthy: existing FSMs are used. • Zero additional gates (in theory…) • Applicable to nearly all designs. • Considerably increases reversing effort: Reversing of control- and data-path required for identification of constants. • Applicable to ASICs and FPGAs. • Forces a reverse engineer to apply dynamic analysis. Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 37
Hardware OPs • If no suitable FSM available, add a new FSM-like module. – Make it reset outside of the processing period. – Make it stabilize in a known state after some cycles. – Generate OP value from stable state. • Still stealthy (FSMs are common). • Stabilizing FSMs are also common (DONE state). Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 38
C ASE S TUDIES Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 39
Scenario Stealthy Opaque Predicates in Hardware | CHES 2018 | 10.09.2018 40
Recommend
More recommend