Fault Attack
Fault Attack
1
Introduction
Neural Public
Network Key
Automotive PQC
Introduction Laser-FI
Neural Public
Row-Hammer
Network Key
EM-FI
Clock-Glitch
Voltage-Glitch
Automotive PQC
Fault Attacks on RSA
• Only decryption is subject to attacks Dan Boneh, Richard A. DeMillo, Richard J. Lipton:
On the Importance of Checking Cryptographic
• Assume: Protocols for Faults (Extended
1. Attacker can flip a single bit in key d Abstract). EUROCRYPT 1997: 37-51
= 𝑆 𝑑 𝑚𝑜𝑑 𝑁
𝑀
• If di = 0 then Mˆ M = S 2 mod N
i
𝑡−1 𝑖
= 𝑆 2 𝑑𝑡−1+⋯+2 𝑑𝑖+⋯+𝑑0 𝑚𝑜𝑑 𝑁
• If di = 1 then Mˆ M =1 S 2 mod N
i
4
Fault Attacks on RSA
• Assume that the attacker flips randomly a bit in d.
• Example: (e,N)=(7,77), d=43 d5d4d3d2d1d0 = 1010112
• Ciphertext=37 producing M=9 if no fault is injected and
Mˆ = 67 if a fault is injected
• Search for i such that 9 = (67 372 ) mod 77 i=3 (d3 = 1) since
i
5
Differential Fault Analysis (DFA) of AES
PlainText
SubBytes
SubBytes
ShiftRows Repeat
Nr -1 ShiftRows
MixColumns
Round RoundKey AddRoundKey
RoundKey AddRoundKey
CipherText
7
Plaintext
Block
Secret Key
XOR key
AES-128
Encryption
Byte Substitution
Loop 10 times
Shift Rows
9
Illustration of a DFA
PLAIN TEXT PLAIN TEXT
FAULT
INDUCTION
ENCRYPTION ENCRYPTION
ALGORITHM ALGORITHM
ANALYSIS
10
A Fault Injection Set-Up
12
Single Byte Faults in known DFAs
• Single Byte Fault
• Attacker induces fault at the input of the 8th round in
a single byte
• Fault value should be non-zero but can be arbitrary
• Relaxing the requirements make the attack more
practical
• No knowledge required of the fault value
• Lesser bytes needed to be faulty
• Lesser faulty cipher texts required
13
A Practical Scenario:
An Iterated AES Architecture
STATE REG
PLAINTEXT
STATE REG
CIPHERTEXT
AES Round
14
Principle: Propagation of Fault Induced
f f’ f’ 2f’
f’
f’
3f’
15
The Patterns Gives the Following Equations
• ISB(x1+K1)+ISB(x1+F1+K1)=
2[ISB(x2+K2)+ISB(x2+F2+K2)]
• ISB(x2+K2)+ISB(x2+F2+K2)=
ISB(x3+K3)+ISB(x3+F3+K3)
• ISB(x4+K4)+ISB(x4+F4+K4)=
3[ISB(x2+K2)+ISB(x2+F2+K2)]
16
Important Points
• No dependency on the fault value.
• Finds out the key using two faulty encryptions
with a probability of almost one.
• Rest of the cases a third faulty cipher text is
needed
• Time Complexity is 216.
• One byte fault reveals 4 key bytes.
• To obtain the entire key, 4 faulty cipher texts needed.
17
When the Fault is Induced in the 8 th Round…
• Fault is induced at the input of 8th round.
• A one byte disturbance creates a 4 byte fault at
the input of the 9th round.
• Let us trace the disturbance through the last 3
rounds.
• Equations are of similar nature.
18
Propagation of Fault Induced at 8th Round Input
f f’ f’ 2f’
f’
f’
3f’
9th Round
8th Round 8th round 8th Round ByteSub
Byte Sub ShiftRow MixColumnF1
F2
F3
10th Round 10th Round 9th Round F4 9th Round
Shift Row Byte Sub MixColumn ShiftRow
A1 A2 A3 A4 A1 A2 A3 A4 2F1 F4 F3 3F2 F1
A6 A7 A8 A5 A5 A6 A7 A8 F1 F4 3F3 2F2 F2
A11 A12 A9 A10 A9 A10 A11 A12 F1 3F4 2F3 F2 F3
A16 A13 A14 A15 A13 A14 A15 A16 3F1 2F4 F3 F2 F4 19
The Patterns Gives the
Following Equations
Here, ISB stands for
• ISB(x1+K00)+ISB(x1+A1+K00)= inverse of the SubBytes
2[ISB(x8+K13) +ISB(x8+A5+K13)] operation.
• ISB(x8+K13)+ISB(x8+A5+K13)=
ISB(x11+K22)+ISB(x11+A9+K22)
• ISB(x14+K31)+ISB(x14+A13+K31)=
3[ISB(x8+K13)+ISB(x8+A5+K13)]
20
Similar equations are derived for the other key bytes
21
Conclusions
A random one byte fault at the input of 8th round of AES can reduce the key size drastically
References:
1. Debdeep Mukhopadhyay:An Improved Fault Based Attack of the Advanced Encryption Standard.
AFRICACRYPT 2009: 421-434
2. Gilles Piret, Jean-Jacques Quisquater:A Differential Fault Attack Technique against SPN Structures, with
Application to the AES and KHAZAD. CHES 2003: 77-88
22
Can the Attack Work with One Faulty
Ciphertext?
• With one faulty cipher text:
• Number of possible values per 4 bytes of the key is
around 28.
• There are 232 possible candidates for 128 bits of the
AES key.
• Brute force key is thus possible!
23
Improvement of the Attack
• Current research shows that the AES key size can
be reduced from 232 to 28 for a single byte fault.
Michael Tunstall, Debdeep Mukhopadhyay, S,Ali, Differential Fault Analysis of the Advanced
Encryption Standard using a Single Fault, Cryptology ePrint Archive: Report 2009/575, WISTP 2011
24
Reducing the Search space
25
Reducing the search space
26
Reducing the Search space
28
▪Find 232 candidates K10
Differential Equation
▪Find 232 Candidates of K9 using keyschedule
▪ Reduce K9 to 28 candidates
keyschedule
232
2f' ' = S9
( 0, 0 )
Differential Equation
f ' = S9
( 0 ,1)
f ' = S9
( 0, 2 )
3f ' = S9
( 0 , 3)
2128
27
Tallying the Differentials
AES key expansion
9th Round Key can be derived as:
The full set of
expanded equations
Reducing the Search space
28
▪Find 232 candidate K10
Differential Equation
▪Find 232 Candidates of K9 using keyschedule
▪ Reduce K9 to 28 candidates
keyschedule ▪Get the master key by 28 brute-force search
232
2f' ' = S9
( 0, 0 )
Differential Equation
f ' = S9
( 0 ,1)
f ' = S9
( 0, 2 )
3f ' = S9
( 0 , 3)
2128
39
Summary of the DFA of AES
• Requires 28 brute-force search.
40
Reducing Time Complexity
• Existing DFA required to test 232 candidates of K10 by the 8th round
differential equation.
2f' ' = S9 (1)
( 0, 0 )
f ' = S9
( 0, 2 )
(3)
3f ' = S9
( 0,3)
(4)
• Equations (2) and (3) does not contain key byte k0 and k1
41
First and the fourth quartets
Reducing Time
Complexity (Cont.)
Test by equation (2) and (3)
42
Reducing Time Complexity (Cont.)
• From first phase of the attack we have four quartets
{k0 , k13 ,k10 ,k7 }, {k12 ,k9 ,k6 ,k3 },{k8 ,k5 ,k2 ,k15} and
{k4 ,k1 ,k14 , k11 } each of size 28
• Split the first and fourth quartets in to two list of size
27
➢ L1 contains k0
➢ L2 contains k13, k10, k7.
➢ L3 contains k1
➢ L4 contains k4, k14, k11
• The second and third quartet are represented
by two lists L5 and L6 each of size 28
43 43
Reducing Time Complexity (Cont.)
• Equation (2) and (3)require list L2 ,L4 ,L5 , and L6 .
• Number of possible keys required 27 x 27 x 28 x 28 =230 .
• 222 candidates satisfy the equation (2) and (3).
• Combine each of 222 candidates to four values of k0 and k1 from lists
L1 and L2.
• Number of candidates increased to 224 .
• Reduce 224 candidates to 28 by equation (1) and (4).
44
Results
45
Countermeasures and
Improved Attacks
Differential Fault Intensity Attack (DFIA)
47
Countering Fault Attacks
50
Hardware Redundancy
51
Time Redundancy As number of cycles
are halved, the extra
Double-Data-Rate (DDR) is an alternative strategy
cycles can be used for
suitable for pipelined datapaths, targeting operations
redundancy.
which are not the critical path of the design.
Pipelined
32-bit D1 D2 D3 D4
Time redundancy SBox
computes the same
function twice, but
using the same
hardware. Naturally,
there is negligible area D1,D2 D3,D4 D1,D2 D3,D4 Rows of State
overhead, but Matrix of AES
throughput is affected. D1,D2 D3,D4 D1,D2 D3,D4
Overhead P(AESRound(S))=AESRound(P(S))
around 20%
54
Parity-based Code for AES
• Operations operate on bytes so byte-level parity is natural
• ShiftRows: Rotating the parity bits
• AddRoundKey: Add parity bits of state to those of key
• SubBytes: Expand Sbox to 2569 – add output parity bit; to propagate
incoming errors (rather than having to check) expand to 5129 – put Transformation Input
incorrect parity bit for inputs with incorrect parity Parity Bit(s) (input state matrix)
• MixColumns: The expressions are:
p 0, j = p 0, j p 2, j p 3, j S 0( ,7j) S1(,7j)
Parity Prediction Transformation
p1, j = p 0, j p1, j p 3, j S (7)
1, j S (7)
2, j
p 2, j = p 0, j p1, j p 2, j S 2( 7, j) S3(,7j)
Predicted Transformation Result
p 3, j = p1, j p 2, j p 3, j S3(,7j) S 0( ,7j)
Parity Bit(s) (output state matrix)
(7)
where si , j is the msb of the state byte in position i,j Source : Koren and Krishna,
Morgan-Kaufman 2007
55
Does Detection Always Guarantee Security?
The Time Redundancy Countermeasure
Fault Distribution
Distinguishers used :
Hamming Distance (HD)
Squared Euclidean Imbalance (SEI)
Make a key hypothesis k and evaluate the
distinguishers
Correct hypothesis gives minimum
and maximum values respectively
69
Simulations-1 Number of
ciphertexts required
to guess the AES key
with 99% accuracy
• Identical faults introduced into both
original and redundant rounds
• Target byte chosen at random
Simulation results
• Same fault for original and redundant
computations
• Each fault injection yields a useful
ciphertext
• Attacks simulated on rounds 8 and 9
• Performed separately for each fault
model
Simulations-2
• Vary the degree of bias in the fault model
• Control the variance of the fault probability distribution
• Observe the number of fault injections to get a faulty ciphertext
• Two adversarial models:
• Type 1: Perfect control over target byte
• Type 2: No control over target byte
71
Simulations-2 (contd.)
Perfect Control on Byte
Faulted
72
Experimental Results
Useful Total Fault
ciphertexts Injections
73
Comments on Detection Schemes
• Bias of a fault model can be quantified in terms of the variance of
fault probability distribution
• Detection based countermeasures are vulnerable against biased fault
attacks that are practically achievable
75
Ineffective Faults P
• Example:
Round 2
• Consider a stuck-at-0 fault.
• No corruption happens if the
value of the target bit is 0.
• Ciphertext is faulty if the value Round n-1
of the target bit is 1.
• In the former case, we call the Round n
fault as ineffective fault.
C
Statistical Ineffective Fault Analysis
A “not so intuitive” intuition
• The correct state space under the influence of
faults is biased for biased faults.
• Example:
• Consider the stuck-at-0 fault at the MSB of
a 4-bit state. State distribution w/o faults
• If value of the faulted state belongs to the
first 8 table entries the ciphertext is correct.
• The distribution of the state for correct
values only assumes 8 possible values
among 16.
Correct State distribution with faults
• Works for many other biased fault models.
Statistical Ineffective Fault Analysis
A “not so intuitive” intuition
• The correct state space under the influence of
faults is biased for biased faults.
• Example:
• Consider the stuck-at-0 fault at the MSB of
a 4-bit state. State distribution w/o faults
• If value of the faulted state belongs to the
first 8 table entries the ciphertext is correct.
• The distribution of the state for correct
values only assumes 8 possible values
among 16.
Correct State distribution with faults
• Works for many other biased fault models.
SIFA analyzes correct ciphertexts instead of
faulty ones
Statistical Ineffective Fault Analysis
A “not so intuitive” intuition
• The correct state space under the influence of
faults is biased for biased faults.
• Example:
• Consider the stuck-at-0 fault at the MSB of
a 4-bit state. State distribution w/o faults
• If value of the faulted state belongs to the
first 8 table entries the ciphertext is correct.
• The distribution of the state for correct
values only assumes 8 possible values
among 16.
Correct State distribution with faults
• Works for many other biased fault models.
SIFA analyzes correct ciphertexts instead of
faulty ones
C. Dobraunig, M. Eichlseder, T. Korak, S. Mangard, F. Mendel,
R. Primas, “SIFA: Exploiting Ineffective Fault Inductions on
Symmetric Cryptography”. TCHES 2018
FA Templates: Exploiting Fault Propagation?
• Fault propagation through combinational net is data dependent.
• In the case of masking, fault propagation is dependent on actual unmasked values.
• What is the consequence?? Can we do powerful attacks??
Fault propagation through AND gate depends on We can get the values of all
the value of the unfaulted inputs unfaulted inputs just by knowing if
the output is correct or faulty.
…
…
• Constructs a template .
• : Set containing the outcome of some
function over attacker observables and fault
locations.
• : Part of the secret
• Template Matching (Online):
• Attacker injects faults at some predefined locations
and extract secret by using the template.
Fault Template Attack Template Matching
Two Phases:
• Template Building (Offline):
• Attacker has full access to a device similar to
[F, NF, F F] 0
the target
[F, F, NF F] 1
• Knows the key and the mask.
[F, NF, F NF] 4
• Constructs a template .
…
…
• : Set containing the outcome of some
function over attacker observables and
fault locations.
• : Part of the secret
• Template Matching (Online):
• Attacker injects faults at some predefined
locations and extract secret by using the
template.
Fault Template Attack
Attacker capabilities:
• No ciphertext access.
• Only knows if the output is faulty or not.
• Works for all FA countermeasures using
detection
• Can fix the plaintext to some (unknown)
value.
• Inject one fault per encryption at a specific
location.
• Access to plaintext leads to similar attacks
• Maybe little easier
Fault Template Attack
Attacker capabilities:
• No ciphertext access.
1
• Only knows if the output is faulty or not.
• Works for all FA countermeasures using
detection
• Can fix the plaintext to some (unknown)
value.
• Inject one fault per encryption at a specific
location.
• Access to plaintext leads to similar attacks
• Maybe little easier
Fault Template Attack
Attacker capabilities: F, if
• No ciphertext access. C, if
1
• Only knows if the output is faulty or not.
• Works for all FA countermeasures using
detection
• Can fix the plaintext to some (unknown)
value.
• Inject one fault per encryption at a specific
location.
• Access to plaintext leads to similar attacks
• Maybe little easier
Fault Template Attack
Attacker capabilities: F, if
• No ciphertext access. C, if 1
• Only knows if the output is faulty or not.
• Works for all FA countermeasures using
detection
• Can fix the plaintext to some (unknown)
value.
• Inject one fault per encryption at a specific
location.
• Access to plaintext leads to similar attacks
• Maybe little easier
Fault Template Attack
Attacker capabilities: F, if
• No ciphertext access. C, if 1
• Only knows if the output is faulty or not.
• Works for all FA countermeasures using
detection
• Can fix the plaintext to some (unknown)
value.
• Inject one fault per encryption at a specific
location.
• Access to plaintext leads to similar attacks
• Maybe little easier
Fault Template Attack
Attacker capabilities:
• No ciphertext access.
• Only knows if the output is faulty or not.
• Works for all FA countermeasures using
detection
• Can fix the plaintext to some (unknown)
value.
• Inject one fault per encryption at a specific
location. 1
• Access to plaintext leads to similar attacks
• Maybe little easier
F, if
C, if
Fault Template Attack
Attacker capabilities:
• No ciphertext access.
• Only knows if the output is faulty
or not.
• Works for all FA
countermeasures using 1
detection State
• Can fix the plaintext to some F/C F/C F/C F/C
F, if
(unknown) value.
C, if
• Inject one fault per encryption at a
specific location.
• Access to plaintext leads to similar
attacks
• Maybe little easier
Fault Template Attack
Attacker capabilities: Fault Correct
• No ciphertext access.
• Only knows if the output is faulty or
not.
• Works for all FA countermeasures
using detection
• Can fix the plaintext to some
(unknown) value.
• Access to plaintext leads to similar
attacks • Extracts an intermediate state (for fixed plaintext).
• Maybe little easier • Recovery of two consecutive intermediate states leads to
a middle round attack.
Fault Template Attack
Masking:
• SCA countermeasure.
• Also effective against some classes of FAs
• BFA/Safe Error
• Makes power consumption independent of processed
data
• Requires fresh randomness at every execution.
• Split a value into multiple shares
such that .
• Function is split into functions
such that .
• Splitting is trivial for linear functions.
• Nonlinear functions require special attention.
Fault Template Attack
FTA on Masking:
• Faulting linear terms (XORs) in the logic
does not work.
• Mask changes at each execution
• Attack is only possible if all shares are
faulted together
• Multi-bit faults
• For non-linear functions we exploit the
effect of fault propagation.
• Fault only propagates through AND
gates if one input is faulted and other
inputs are 1.
Fault Template Attack
stuck-at/ flip
FTA on Masking:
• Faulting linear terms (XORs) in the logic
does not work.
• Mask changes at each execution
• Attack is only possible if all shares are
faulted together
Actual output:
• Multi-bit faults
: Faulted
• For non-linear functions we exploit the
: Correct
effect of fault propagation.
• Fault only propagates through AND
gates if one input is faulted and other
inputs are 1.
Automatic Leakage
Assessment for Faults
96
Testing Block Ciphers for Fault Attacks
• General idea:
• Mutual Information (MI)
https://www.barnesandnoble.com/w/the-perfect-
between the secrets and the secret-rob-buyea/1127870628
observables should be zero
• Plaintext variable must be kept fixed
• Violating of any of these two
conditions indicates leakage
• We use the first one in this work.
ALAFA
• Formalization of leakage due to faults
• General test for leakage assessment
based on non-interference
o Simple
o Statistical
o Similar to well-accepted Side-
Channel Leakage assessment
method TVLA
• Simulation-based
• Algorithm-agnostic
• Easy to verify
• Equality of distributions can be justified in
many ways.
ALAFA: Automatic Leakage Assessment
The t-test
• DFA (Differential Fault Analysis) works by combining differential cryptanalysis with faults
• A random one byte fault at the input of 8th round of AES can reduce the key size drastically:
validation/testing.
108