Evaluating The Security of Logic Encryption Algorithms
Evaluating The Security of Logic Encryption Algorithms
I. I NTRODUCTION
Considerations of capital costs and economies of scale
dictate that semiconductor manufacturing is now reliant on
offshore foundries that are organizationally separate and geographically distant
from the design houses that design and
validate integrated circuits (ICs). This has led to increased
concerns of IC counterfeiting, piracy and unauthorized overproduction by the
contract foundry [7, 16, 23]. The financial
risk due to counterfeit and unauthorized ICs was estimated to
be over $169 billion a year by IHS Technology [11]. Besides
financial losses, this issue potentially has national security
implications. The Semiconductor Industry Association (SIA)
estimates that 15% of all spare and replacement semiconductors purchased by the
Pentagon are counterfeit [20].
Tamper-Proof Memory
Key Inputs
Inputs
Circuit
Outputs
c
978-1-4673-7421-7/15/$31.00 #2015
IEEE
shown in Figure 1. Additional logic is introduced to the IC and
is connected to a set of newly introduced inputs, called key
inputs, as well as some parts of the original IC. The key inputs
are connected to a tamper-proof memory and the modified
IC produces the correct output only if the key inputs are set
correctly. This correct value is not revealed to the foundry. The
foundry manufactures the IC and returns the fabricated units
to the design house. The design house loads the tamper-proof
memory with the correct key value, “activating” the IC and
the activated IC is marketed to end-users.
A. Attacks on Logic Encryption
Logic encryption rests upon the assumption that the foundry
does not know and cannot compute the correct values of the
key inputs. Otherwise, the foundry could just program these
values and overproduction could not be prevented.
1) Attack Model: Considering a malicious foundry, we
assume the attacker has access to layout and mask information.
The gate-level netlist can be reverse-engineered from this [22].
We also assume that the attacker has access to an activated
IC on which to apply input patterns and observe outputs. This
could be obtained by purchasing an activated IC from the open
market. The components of our attack model are therefore: (i)
a gate-level netlist of the encrypted IC and (ii) a means for
applying arbitrary input patterns and observing the resultant
outputs on an activated IC.2
2) Potential Attacks: Given the above attack model, an
attack is possible when an attacker can determine the correct
values of the key inputs. Let us consider potential attacks.
The naı̈ve idea of brute-force search does not work. If the
circuit has M inputs and L key inputs, this requires 2M
observations from an activated IC and O(2M +L ) computations
on the encrypted design. Clearly, this is not practical.
Rajendran et al. [17] propose using automatic test pattern
generation (ATPG) tools [3] to generate input patterns that
expose the value of a key input. In Figure 2(b), when the input
is a = b = c = 0, the output is y = ¬k1 . Therefore, an ATPG
tool can find such patterns to reveal keys. But in Figure 2(c), no
input pattern can expose k1 if k2 is also unknown. The solution
is to first attack k2 with the pattern a = b = c = 1. From this
we deduce k2 = 0. Now attacking k1 is possible. But even this
strategy does not guarantee a successful attack. For the circuit
in Figure 2(d), there is no single input pattern that can reveal
the value of either k1 or k2 . Therefore, if logic encryption is
done carefully, the fault-analysis attack is ineffective.
2 We note that other attacks are possible. For example, an attacker may
evade/subvert the tamper-resistant packaging and probe the signals corresponding to
the key inputs.
137
a
b
c
a
y
b
c
k1
k2
a
k2
a
b
c
k1
y b
c
k1
(d)
Yet
another
encrypted version with
key (k1 , k2 ) = (1, 1).
138
2015 IEEE International Symposium on Hardware Oriented Security and Trust (HOST)
# is set to a correct key
of the unencrypted circuit when K
# Y
# ) ⊆ BM +N is the
value, which may not be unique. CO (X,
input/output relation for the unencrypted circuit. The attacker
cannot construct the relation CO but can apply input patterns
and observe the outputs on an activated IC. We model this
through the black-box function eval : BM #→ BN . For an
input vector #X1 , eval (#X1 ) = #Y1 if and only if #Y1 would be the
output obtained when the input pattern #X1 is applied on an
activated IC: eval (#X1 ) = #Y1 ⇐⇒ CO (#X1 , #Y1 ).
B. Problem Statement
# = K#C such that for all inputs
The attacker’s goal is to find K
#
#
# . This is equivalent to
#
#
#
X: C(X, KC , Y ) ⇐⇒ eval (X) = Y
#
#
#
#
# ) ∧ CO (X,
# Y
# ), but of
solving the QBF: ∃K ∀X C(X, K, Y
course, the attacker cannot construct the formula for CO . For a
practical attack, eval can be evaluated only on a small number
of input patterns, i.e., only small number of input/output
observations can be made on the activated IC.
C. Algorithm Overview
Given a set of input vectors #X1 , #X2 , . . . #Xp and the corresponding output
observations #Y1 , #Y2 , . . . , #Yp , determining a key
value that is consistent with these p observations is straightforward. One just
needs to use a SAT solver to find a satisfying
# #Yj ). However,
# in the formula ∧p C(#Xj , K,
assignment to K
j=1
suppose we now make a new observation eval(#Xp+1 ) = #Yp+1 .
We have no guarantee that a satisfying assignment to K for the
# #Yj ) will also be a satisfying assignment
formula ∧pj=1 C(#Xj , K,
# # #
to K for the formula ∧p+1
j=1 C(Xj , K, Yj ). This is just a formal
restatement of the observation we made in §I-A2. Although
the SAT solver can find a key value that is consistent with the
observations seen thus far, this value may not be correct. Even
if the solver finds the correct key, verifying this apparently
requires checking all 2M input/output patterns.
Our algorithm is able to resolve these problems through two
insights. First, instead of considering key values individually,
let us consider equivalence classes of keys. Let us define two
# 1 and K
# 2 to be equivalent, denoted as K
#1 ≡ K
# 2 , if and
keys K
#
only if for each input value Xi , the encrypted circuit produces
# 1 and K
# 2 . Precisely
#i for both keys K
the same output value Y
#
#
#
#
#
#
# 2, Y
#i ).
#
stated: K1 ≡ K2 iff ∀Xi : C(Xi , K1 , Yi ) ∧ C(Xi , K
The intuition is that instead of finding the correct key, we
are looking for a member of the equivalence class of keys
which produces the correct output for all input patterns. To
“zero-in” on the correct equivalence class, we will iteratively
rule out equivalence classes which produce the wrong output
value for at least one input pattern. Given two key values #K1
and #K2 , define the input pattern #Xd as a distinguishing input
pattern if the encrypted circuit outputs different values #Yd1 and
#Yd2 when the key inputs are set to #K1 and #K2 respectively. More
precisely, #Xd is a distinguishing input pattern for #K1 and #K2 iff
C(#Xd , #K1 , #Yd1 ) ∧ C(#Xd , #K2 , #Yd2 ) ∧ (#Yd1 = #Yd2 ).
The second insight is that if a distinguishing input pattern
#Xd is found, then we can examine the output of the activated
IC for input #Xd and use this to rule out one (or both) of #K1
and #K2 as not being in the equivalence class of correct keys.
2015 IEEE International Symposium on Hardware Oriented Security and Trust (HOST)
139
the few circuits that do not converge quickly, algorithms that
can extract partial information about key values by analyzing
subsets of the circuit (called “slices”) are desirable.
A. Finding Suitable Circuit Slices
The first task here is finding suitable “slices.” We define
a slice of a circuit as a subset of the outputs of the circuit
along with all the nodes in their transitive fanin cones. Slices
required for the partial-break algorithm must satisfy the following properties.
1) For each output that is included in the slice, all the gates
in its transitive fanin cone are also included in the slice.
2) The slice contains at least one key input such that all the
outputs that are in the transitive fanout cone of the key
are also included.
3) No more than the fraction P of the gates in the circuit
are included in the slice. (P = 0.3 in our experiments.)
The first requirement defines a well-formed slice. The
second condition ensures that at least one key input’s “effect”
on the circuit is fully-defined. The third requirement results in
small slices. We find such slices by formulating the above
requirements as constraints in an Integer Linear Program
(ILP). The objective of the ILP is to maximize the number
of key inputs included in the slice.
B. Extracting Key Values From Circuit Slices
At first glance, it may seem that we can run Algorithm 1
on a slice and then directly use the resultant key values in
the larger circuit. But this is not possible because the key
value returned by Algorithm 1 is a member of an equivalence
class that is defined in terms of the subset of circuit outputs
in the slice. But this equivalence class may be further refined
by the outputs not part of the slice. And so this key value
may be incorrect in the context of the full circuit. Instead, the
insight behind the partial-break algorithm is to examine the
input/output observations generated while running Algorithm 1
and determine whether these necessarily imply something
about the values of the key variables in the full circuit.
Let us define Cslice as the input/output relation of the
slice under consideration. Suppose we run Algorithm 1 on
the slice and it converges after
# λ iterations. We now
# have
λ input/output observations: (#Xd1 , #Yd1 ), . . . , (#Xdλ , #Ydλ ) . Now
# #Yd ). G encodes
consider the formula: G = ∧λi=1 Cslice (#Xdi , K,
i
exactly the constraints on the key input variables imposed by
# is a key
the λ input/output observations. Now suppose kj ∈ K
input, and that G =⇒ kj . This means that kj is a backbone
of G, i.e., all satisfying assignments to G must have kj = 1,
or equivalently for the input/output observations to hold, we
must have kj = 1. Therefore, kj can be generalized to the full
circuit. A symmetric argument applies when G =⇒ ¬kj .
This leads to the complete procedure shown in Algorithm 2.
Line 2 invokes Algorithm 1. However we do not use the return
value ##KCslice but instead examine
the input/output observa#
tions (#Xd1 , #Yd1 ), . . . , (#Xdλ , #Ydλ ) . We use the probing algorithm
from [24] to find backbones.
140
IV. E VALUATION
Our attack algorithms apply to all combinational logic
encryption schemes. Therefore, we evaluated the attack by
implementing six state-of-the-art combinational logic encryption algorithms in our
framework. EPIC [19] is the orginal
proposal for logic encryption and it inserts XOR and XNOR
gates at randomly chosen locations in the IC. We refer to this
as “RND” in the results. Baumgarten et al. [1] (“DTC’10/LUT”)
insert a set of lookup tables (LUTs) to the IC such that
every path from an input to an output goes through a lookup
table. The values stored in the lookup tables are effectively
the key inputs. Rajendran et al. [17] (“DAC’12”) propose an
algorithm to insert XOR/XNOR gates at carefully chosen
locations in the circuit so that the encrypted circuit is not
vulnerable to the fault-analysis attack. Rajendran et al. [18]
also propose two algorithms that insert XOR (“ToC’13/xor”)
and MUX (“ToC’13/mux”) gates at locations which maximize
the Hamming distance between correct and incorrect outputs.
Dupuis et al. [8] (“IOLTS’14”) propose an encryption scheme
which attempts to minimize low-controllability locations in the
circuit by inserting AND and OR gates. When performing the
encryption for ToC’13/mux and IOLTS’14, we estimated signal
probabilities using the algorithm from [15].
A. Methodology
For the algorithms IOLTS’14, ToC’13/mux, ToC’13/xor, RND,
and DAC’12, we generated four sets of encrypted circuits
corresponding to an area overhead of 5%, 10%, 25% and 50%
for logic encryption for each benchmark circuit. We believe an
area overhead of 5% is a realistic budget for logic encryption,
10% may be acceptable for sensitive designs, and the values of
25% and 50% overhead are unrealistic but help us understand
the limits of our attack. DTC’10/LUT does not describe a method
to “tune” the overhead due to logic encryption. Hence we
generated only one version of the encrypted circuits for this
algorithm. In total, we generated 21 encrypted circuits from
each benchmark circuit. When generating the benchmarks, we
only considered the area overhead and did not consider the
impact on timing, which may rule out certain encryptions. As
a result, our evaluation is a pessimistic estimate of the strength
of the attack algorithm and provides an upper bound on the
security of the logic encryption algorithms.
Our benchmark circuits are listed in Table I. They consist
of the ISCAS’85 benchmarks and the combinational circuits
from the Microelectronics Center of North Carolina (MCNC)
2015 IEEE International Symposium on Hardware Oriented Security and Trust (HOST)
Fig. 3: Distributions of execution time (left) and number of input/output
observations (right). Legend for both graphs is the
same, each color represents a different encryption algorithm while the marker
symbols show different area overheads.
(b) MCNC circuits
#in
41
5
33
233
50
36
41
178
32
207
60
#out
32
2
25
140
22
7
32
123
32
108
26
#gates
546
6
880
1193
1669
160
202
2307
2416
3512
383
Circuit
apex2
apex4
dalu
des
ex1010
ex5
i4
i7
i8
i9
k2
seq
#in
39
10
75
256
10
8
192
199
133
88
46
41
#out
3
19
16
245
10
63
6
67
81
63
45
35
#gates
610
5360
2298
6473
5066
1055
338
1315
2464
1035
1815
3519
2015 IEEE International Symposium on Hardware Oriented Security and Trust (HOST)
141
circuits encrypted with DAC’12 and RND and 15 circuits encrypted with ToC’13/xor.
The maximum execution time for
a successful attack was about 8 hours and the maximum
number of observations needed was 15981. In total, 418 (95%)
of the 441 encrypted circuits were decrypted. 397 of these
(90%) needed fewer than 250 input/output observations. These
numbers suggest that the attack is feasible and easy to perform
on all encryption schemes and almost all encrypted circuits.
Insertion of AND, OR and MUX gates as in IOLTS’14 and
ToC’13/mux is less secure than the insertion of XOR/XNOR
gates. XOR/XNOR gates result in clauses that are harder
to satisfy with the DPLL algorithm used in modern SAT
solvers [21]. The targeted placement of XOR/XNOR gates
done by DAC’12 and ToC’13/xor is more secure than RND.
Figure 4 shows a “box plot” of the distribution of the
time taken to decrypt the different encrypted versions of each
benchmark circuit using Algorithm 1. The benchmark circuits
are shown on the x-axis and are sorted by size. The leftmost
circuit is the smallest and the rightmost is the largest. For
each circuit, we consider the vector consisting of the time-todecrypt values for
each of its 21 different encrypted versions. If
a particular circuit could not be decrypted, its time-to-decrypt
value is set to the time limit of 10 hours (3.6 × 104 seconds).
The box shows the 25%-75% percentile distribution of this
vector, the red horizontal line shows the median value of
this vector, and the two black lines show the minimum and
maximum values. We expect that larger circuits will take more
time to decrypt, and we can see from the plot that this is largely
true. But we also observe that the strength of the encryption
has a significant impact on the runtime of Algorithm 1. For
weak encryption schemes, or when the number of key inputs is
small, Algorithm 1 completes execution in just a few seconds
for even the largest circuits in our benchmark suite. And
conversely, when the number key inputs is very large and
if these key inputs are placed strategically, the decryption of
small circuits can also be challenging.
C. Partial-Break Algorithm Results
Fig. 5: Percentage of keys decrypted with the partial-break algorithm and the
fault-analysis attack. All circuits are encrypted
with 50% area overhead for encryption.
Figure 5 shows the results of the partial-break algorithm
from Section III. We consider the two most challenging
142
2015 IEEE International Symposium on Hardware Oriented Security and Trust (HOST)
small loop-free programs using a simulation oracle. Fujita et
al. [9] propose an algorithm for partial synthesis in the scenario
where parts of a circuit have been replaced by lookup tables.
This is useful in implementing engineering change orders
(ECOs), debugging logical bugs etc. Both algorithms are based
on generating candidate solutions and then counterexamples to
these candidates. Algorithm 1 directly generates the equivalent
of counterexamples. Fujita et al. [9] use a slightly more
complex formulation to generate the counterexamples, they
encode the equality of outputs across two candidate solutions.
We avoid this by directly asserting the output values as
concrete Boolean values (see line 6).
VI. C ONCLUSION
In this paper, we used SAT-based techniques to investigate
the security of logic encryption. We presented a SAT-based
attack on logic encryption that allows an attacker to infer the
correct values of the key inputs using only a small number of
input/output observations taken from an activated IC. We also
presented a “partial-break” algorithm that allows an attacker to
infer the values of some of the key inputs even when the full
attack is not successful. We performed a thorough evaluation
of these attacks by investigating the security of six different
proposals for logic encryption. We found all these proposals
are vulnerable to our attacks. Out of 441 encrypted circuits
we examined, we could decrypt 418 (95%). Among these
397 circuits (90%) required only 250 or fewer input/output
observations. We discussed the strengths and weaknesses of
our attacks and suggested some directions towards provablysecure logic encryption
algorithms.
R EFERENCES
[1] A. Baumgarten, A. Tyagi, and J. Zambreno. Preventing IC
Piracy Using Reconfigurable Logic Barriers. IEEE Design and
Test, 27(1), Jan 2010.
[2] A. Biere. Lingeling, Plingeling and Treengeling. In A. Balint,
A. Belov, M. Heule, and M. Järvisalo, editors, Proceedings of
the SAT Competition, 2013.
[3] M. Bushnell and V. Agrawal. Essentials of Electronic Testing
for Digital, Memory and Mixed-Signal VLSI Circuits. Springer
Publishing Company, 2013.
[4] R.S. Chakraborty and S. Bhunia. Hardware Protection and Authentication Through
Netlist Level Obfuscation. In IEEE/ACM
International Conference on Computer-Aided Design, 2008.
[5] S. A. Cook and D. G. Mitchell. Finding Hard Instances of
the Satisfiability Problem: A Survey. In Proceedings of the
DIMACS Workshop on Satisfiability Problems, 1997.
[6] Decryption tool binaries and benchmark circuits. https://
bitbucket.org/spramod/host15-logic-encryption, 2015.
[7] Defense Science Board Task Force on High Performance Microchip Supply.
http://www.acq.osd.mil/dsb/reports/
ADA435563.pdf, 2005.
[8] S. Dupuis, P.-S. Ba, G. Di Natale, M.-L. Flottes, and
B. Rouzeyre. A Novel Hardware Logic Encryption Technique
2015 IEEE International Symposium on Hardware Oriented Security and Trust (HOST)
143