SlideShare una empresa de Scribd logo
1 de 56
Descargar para leer sin conexión
• All Principal Security Analyst @Riscure
• Cristofaro Mune
• Keywords: Software, Reversing, Exploit, Fault Injection…
• Previous work on Mobile and Embedded Exploitation
• Eloi Sanfelix
• Keywords: Software security, RE, Exploiting, SCA/FI, CTF
• Job de Haas
• Keywords: Embedded, Side Channel Analysis, Fault Injection
• All-round from network pentester to SoC evaluator
Who are we?
• White-Box cryptography  Protect keys in untrusted
environment
• Increasingly relevant in security solutions
• The idea: Porting Hardware attacks to Software…
…it works! Extremely effective approach
• Relevant not only on WBC:
• Potentially applicable to all Software-based crypto solution
What and why…
Introduction
Key recovery attacks
Conclusion
Introduction
Key recovery attacks
Conclusion
Black-Box Security
Encrypt Decrypt
Observe
Alter
Gray-Box Security
Encrypt Decrypt
Observe
Alter
Sign of the times…
Sign of the times…
White-Box Security
Encrypt Decrypt
Observe
Alter
White-Box Security
Encrypt Decrypt
Observe
Alter
• Protection against key extraction in the white-box security
model
• A technique that allows merging a key into a given crypto
algorithm:
• Described for the first time in 2002 by S. Chow et al.
• Available for AES and DES
• Lookup tables used for applying mathematical transforms
to data
• Remove the distinction between keys and crypto algorithm
code.
White-Box Cryptography
Software in the White-Box context
Crypto
Input
Output
Business
logic
keyI/O Direct access
Can be modified
at will
Software Protection
Obfuscation
• Control-flow obfuscation
• Data obfuscation
Anti-analysis and anti-tamper
• Detect debugger/emulator
• Detect hooks and modifications
Device binding
• Bind code to current device
WBC
Input
Output
Protected binary
Focus on this part only
Business
logic
I/O
How does WBC work?
Image source: whiteboxcrypto.com
WBC Construction: partial evaluation
in
key
out
T
in
out
S
WBC Construction: encoding
T’
in
out
T
in
out
DECODE
ENCODE
Internal encoding
Example code
Source: https://doar-e.github.io/
External encoding
WB AESE(INPUT) E’(OUTPUT)
DECODE
ENCODE
Sn
DECODE
ENCODE
S2
DECODE
ENCODE
S1
DECODE
ENCODE
…
Sending
Process
Receiving
Process
ENCODE DECODE
Data manipulation – Fault Injection (FI)
Modify data here
Potential attacks on WBC (I)
and observe changes
to the output
Process manipulation – Fault injection (FI)
Potential attacks on WBC (II)
Modify code flow here
and observe changes
to the output
Side channel analysis (SCA) / intermediate data analysis
Observe data here
Potential attacks on WBC (III)
and compare it to
expected data here
• Attacks for all academic WBC proposals
• Focus on key extraction
• Type of transformations assumed known
• Concrete transformation and key unknown
• In real life…
• we do not know much about the design!
• Not many publicly documented SCA/FI on WBC
• Implementation-specific DFA paper in 2002 [2]
• Recent generic DPA-like attack in [3]*
WBC attack literature
* Authors coined the term Differential Computational Analysis
Key recovery attacks
Introduction
Conclusion
Fault Injection Attacks
…on WBC
Differential Fault Analysis
Correct result
Faulty result
Correct result
Faulty result
Correct result
Faulty result
Correct result
Faulty result
DFA computation for DES
L16R16
R15L15
R16 = F(R15 , K16)  L15
K16
K15
R’15
L’16R’16
DFA computation for DES
L15
R16 = F(R15 , K16)  L15
R’16 = F(R’15 , K16)  L15
R16  R’16 = F(R15 , K16)  F(R’15 , K16)
XOR
K16
K15
Divide and conquer
K16L15’
Independent
6-bit sub-keys
Independent
6-bit search
How to port DFA to WBC?
1. Location of fault injection point
2. Fault injection and ciphertext collection
o Multiple options available
3. Fault analysis
o We use our own tools
o Some AES DFA examples on GitHub
DFA attack process
• Binary DES encryption WBC
• Challenge posted at whiteboxcrypto.com
• DES key hidden within lookups
• Key value is 0x30 0x32 0x34 0x32 0x34 0x36 0x32 0x36
• We’ll demo all our attacks on this target
Example target: wbDES
Red: writes
Green: reads
STEP 1: Locating the injection point
Event counter
Stackspace
Target area
STEP 2: Fault injection
1. Select target event within target region
2. Modify data read by that event
If event id within target region
Invert a random bit
STEP 3: Analysis
DEMO
Summary DFA results
Implementation Fault injection Results
Wyseur (DES) Unicorn script Broken in 40 faults
Hack.lu 2009
(AES)
Debugger script Broken in 90 faults
SSTIC 2012 (DES)
Modified lifted
code
Broken in 60 faults
Karroumi (AES)
Modified source
code
Broken in 80 faults
NSC 2013
(encoded AES)
N/A
Not broken –
encoding makes
DFA not feasible
Side Channel Attacks
…on WBC
Differential Power Analysis attack
First proposed ~1998 by Paul Kocher to attack on smart cards:
 Measuring power consumption of a crypto execution
 Take multiple measurements for different inputs
 Infer information about the key from the difference of these
What is a DPA attack?
Differential trace
0
0
0
0
1
1
1
1
Group by known data Average trace
Subtract
Differential trace
Hypothesis testing
Divide and conquer
K1L1
Independent
6-bit sub-keys
Independent
6-bit search
Generalization of differential SCA attacks
Take multiple “measurements” of
behavior of crypto operations for
different data
Predict behavior for sub keys based
on the same data and “leakage”
model
Apply statistical methods to distinguish the “best” sub key
• Difference of means
• Correlation
• Mutual Information analysis, Linear regression
analysis, …
Find correct guesses for all sub keys to determine key
To our surprise….
It works on White Box Crypto out-of-the-box!!!
SCA attack process
1. Instrument WBC to collect “measurements”
• Again:
2. Execute WBC with random inputs multiple times
3. Collect “measurement – input/output pairs” in useable
form
4. SCA Analysis
STEP1: Capture measurement
• Grab the data using any method that fits your target
• Instrument execution (eg. PIN, Valgrind)
• Capture stack snapshots per crypto round (Hooking,
debugger)
• Use emulators and record (QEMU, Unicorn, PANDA)
• Capture any information during execution that might leak
• All reads/writes to memory
• Lower bits of addresses of memory accesses
• All register contents
STEP2+3: Execute + Collect
• Provide/inject random input data, capture output data
• Program arguments
• Use instrumentation from STEP 1
• Store it in a way that allows testing key guesses
• Store as single bit samples
• Assure alignment between multiple captures
STEP 4: SCA Analysis
Same target as for DFA: wbDES
Same hidden key: 0x30 0x32 0x34 0x32 0x34 0x36 0x32 0x36
DEMO
Summary SCA results
Implementati
on
Attacked
intermediate
Results
Results
NXP [3]
Wyseur
(DES)
Round output
Broken in 75
traces
Broken in 65
traces
Hack.lu 2009
(AES)
S-Box output
Broken in 16
traces
Broken in 16
traces
SSTIC 2012
(DES)
Round output
Broken in 16
traces
Broken in 16
traces
Karroumi
(AES)
S-Box and
GF(256)
inverse
Broken in
~2000 traces
Broken in
~500 traces
NSC 2013
(encoded
AES)
N/A Not broken
Not broken –
encoding
makes DPA
not feasible
What does it mean?
No detailed knowledge required
• Of WBC implementation
• Where the WBC is processed exactly
No manipulation required
 A secret random input/output encoding is the only barrier
But:
These random encodings do not work for many real world
applications
Introduction
Key recovery attacks
Conclusion
Is WBC broken and useless?
• SCA/FI on standard WBC very effective:
• Very limited knowledge required
• RE skills might be needed
• Countermeasures and risk mitigation required
• Broken several open-source and commercial WBC
• Commercial implementations typically require more RE skills
• But…
• Not regular software crypto  more complex attacks
• Software protection layers can be a deterrent
• With renewability it can be good enough
How to make it stronger?
WBC
Input
Output
Protected binary
Robustness against
key extraction attacks
(SCA, FI, algebraic, …)
Business
logic
Robustness against
advanced SW RE
Side Channel Analysis attacks
• Must prevent statistical dependence between intermediates
and key
• Typical countermeasures based on randomness difficult in
white-box scenario
Differential Fault Analysis attacks
• Double-checks on encoded data  might be bypassed if
detected!
• Carry redundant data along computation?
• Break fault models by propagating faults?
Do you have any other ideas?
But how?
Thank you!!
eloi@riscure.com
@esanfelix
mune@riscure.com
@pulsoid
dehaas@riscure.com
References
[1] http://crypto.stanford.edu/DRM2002/whitebox.pdf
[2] http://crypto.stanford.edu/DRM2002/drm1.pdf
[3] https://eprint.iacr.org/2015/753
[4] https://www.cosic.esat.kuleuven.be/publications/thesis-152.pdf
[5] https://www.cosic.esat.kuleuven.be/publications/thesis-235.pdf

Más contenido relacionado

Similar a Unboxing the White-Box: Practical Attacks Against Obfuscated Ciphers

Eloi Sanfelix - Hardware security: Side Channel Attacks [RootedCON 2011]
Eloi Sanfelix - Hardware security: Side Channel Attacks [RootedCON 2011]Eloi Sanfelix - Hardware security: Side Channel Attacks [RootedCON 2011]
Eloi Sanfelix - Hardware security: Side Channel Attacks [RootedCON 2011]RootedCON
 
Bypassing Secure Boot using Fault Injection
Bypassing Secure Boot using Fault InjectionBypassing Secure Boot using Fault Injection
Bypassing Secure Boot using Fault InjectionRiscure
 
Common crypto attacks and secure implementations
Common crypto attacks and secure implementationsCommon crypto attacks and secure implementations
Common crypto attacks and secure implementationsTrupti Shiralkar, CISSP
 
PANDEMONIUM: Automated Identification of Cryptographic Algorithms using Dynam...
PANDEMONIUM: Automated Identification of Cryptographic Algorithms using Dynam...PANDEMONIUM: Automated Identification of Cryptographic Algorithms using Dynam...
PANDEMONIUM: Automated Identification of Cryptographic Algorithms using Dynam...CODE BLUE
 
Using Static Binary Analysis To Find Vulnerabilities And Backdoors in Firmware
Using Static Binary Analysis To Find Vulnerabilities And Backdoors in FirmwareUsing Static Binary Analysis To Find Vulnerabilities And Backdoors in Firmware
Using Static Binary Analysis To Find Vulnerabilities And Backdoors in FirmwareLastline, Inc.
 
Mykhailo Zarai "Be careful when dealing with C++" at Rivne IT Talks
Mykhailo Zarai "Be careful when dealing with C++" at Rivne IT TalksMykhailo Zarai "Be careful when dealing with C++" at Rivne IT Talks
Mykhailo Zarai "Be careful when dealing with C++" at Rivne IT TalksVadym Muliavka
 
CapTech Talks Webinar Feb 2023 Rick Hansen.pptx
CapTech Talks Webinar Feb 2023 Rick Hansen.pptxCapTech Talks Webinar Feb 2023 Rick Hansen.pptx
CapTech Talks Webinar Feb 2023 Rick Hansen.pptxCapitolTechU
 
Leverage the Network to Detect and Manage Threats
Leverage the Network to Detect and Manage ThreatsLeverage the Network to Detect and Manage Threats
Leverage the Network to Detect and Manage ThreatsCisco Canada
 
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slapDEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slapFelipe Prado
 
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...Alexandre Moneger
 
Creating Your Own Threat Intel Through Hunting & Visualization
Creating Your Own Threat Intel Through Hunting & VisualizationCreating Your Own Threat Intel Through Hunting & Visualization
Creating Your Own Threat Intel Through Hunting & VisualizationRaffael Marty
 
SAST, CWE, SEI CERT and other smart words from the information security world
SAST, CWE, SEI CERT and other smart words from the information security worldSAST, CWE, SEI CERT and other smart words from the information security world
SAST, CWE, SEI CERT and other smart words from the information security worldAndrey Karpov
 
Secure Coding Practices for Middleware
Secure Coding Practices for MiddlewareSecure Coding Practices for Middleware
Secure Coding Practices for MiddlewareManuel Brugnoli
 
Stream ciphers presentation
Stream ciphers presentationStream ciphers presentation
Stream ciphers presentationdegarden
 
Reverse Engineering Malware - A Practical Guide
Reverse Engineering Malware - A Practical GuideReverse Engineering Malware - A Practical Guide
Reverse Engineering Malware - A Practical Guideintertelinvestigations
 
BlueHat v17 || KERNELFAULT: R00ting the Unexploitable using Hardware Fault In...
BlueHat v17 || KERNELFAULT: R00ting the Unexploitable using Hardware Fault In...BlueHat v17 || KERNELFAULT: R00ting the Unexploitable using Hardware Fault In...
BlueHat v17 || KERNELFAULT: R00ting the Unexploitable using Hardware Fault In...BlueHat Security Conference
 
Sullivan white boxcrypto-baythreat-2013
Sullivan white boxcrypto-baythreat-2013Sullivan white boxcrypto-baythreat-2013
Sullivan white boxcrypto-baythreat-2013Cloudflare
 
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022lior mazor
 
Building Your Application Security Data Hub - OWASP AppSecUSA
Building Your Application Security Data Hub - OWASP AppSecUSABuilding Your Application Security Data Hub - OWASP AppSecUSA
Building Your Application Security Data Hub - OWASP AppSecUSADenim Group
 

Similar a Unboxing the White-Box: Practical Attacks Against Obfuscated Ciphers (20)

Eloi Sanfelix - Hardware security: Side Channel Attacks [RootedCON 2011]
Eloi Sanfelix - Hardware security: Side Channel Attacks [RootedCON 2011]Eloi Sanfelix - Hardware security: Side Channel Attacks [RootedCON 2011]
Eloi Sanfelix - Hardware security: Side Channel Attacks [RootedCON 2011]
 
Bypassing Secure Boot using Fault Injection
Bypassing Secure Boot using Fault InjectionBypassing Secure Boot using Fault Injection
Bypassing Secure Boot using Fault Injection
 
Common crypto attacks and secure implementations
Common crypto attacks and secure implementationsCommon crypto attacks and secure implementations
Common crypto attacks and secure implementations
 
PANDEMONIUM: Automated Identification of Cryptographic Algorithms using Dynam...
PANDEMONIUM: Automated Identification of Cryptographic Algorithms using Dynam...PANDEMONIUM: Automated Identification of Cryptographic Algorithms using Dynam...
PANDEMONIUM: Automated Identification of Cryptographic Algorithms using Dynam...
 
Using Static Binary Analysis To Find Vulnerabilities And Backdoors in Firmware
Using Static Binary Analysis To Find Vulnerabilities And Backdoors in FirmwareUsing Static Binary Analysis To Find Vulnerabilities And Backdoors in Firmware
Using Static Binary Analysis To Find Vulnerabilities And Backdoors in Firmware
 
Mykhailo Zarai "Be careful when dealing with C++" at Rivne IT Talks
Mykhailo Zarai "Be careful when dealing with C++" at Rivne IT TalksMykhailo Zarai "Be careful when dealing with C++" at Rivne IT Talks
Mykhailo Zarai "Be careful when dealing with C++" at Rivne IT Talks
 
CapTech Talks Webinar Feb 2023 Rick Hansen.pptx
CapTech Talks Webinar Feb 2023 Rick Hansen.pptxCapTech Talks Webinar Feb 2023 Rick Hansen.pptx
CapTech Talks Webinar Feb 2023 Rick Hansen.pptx
 
Leverage the Network to Detect and Manage Threats
Leverage the Network to Detect and Manage ThreatsLeverage the Network to Detect and Manage Threats
Leverage the Network to Detect and Manage Threats
 
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slapDEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
DEF CON 27 - CHRISTOPHER ROBERTS - firmware slap
 
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
 
Creating Your Own Threat Intel Through Hunting & Visualization
Creating Your Own Threat Intel Through Hunting & VisualizationCreating Your Own Threat Intel Through Hunting & Visualization
Creating Your Own Threat Intel Through Hunting & Visualization
 
SAST, CWE, SEI CERT and other smart words from the information security world
SAST, CWE, SEI CERT and other smart words from the information security worldSAST, CWE, SEI CERT and other smart words from the information security world
SAST, CWE, SEI CERT and other smart words from the information security world
 
Secure Coding Practices for Middleware
Secure Coding Practices for MiddlewareSecure Coding Practices for Middleware
Secure Coding Practices for Middleware
 
nabdullin_brcrdu_dark
nabdullin_brcrdu_darknabdullin_brcrdu_dark
nabdullin_brcrdu_dark
 
Stream ciphers presentation
Stream ciphers presentationStream ciphers presentation
Stream ciphers presentation
 
Reverse Engineering Malware - A Practical Guide
Reverse Engineering Malware - A Practical GuideReverse Engineering Malware - A Practical Guide
Reverse Engineering Malware - A Practical Guide
 
BlueHat v17 || KERNELFAULT: R00ting the Unexploitable using Hardware Fault In...
BlueHat v17 || KERNELFAULT: R00ting the Unexploitable using Hardware Fault In...BlueHat v17 || KERNELFAULT: R00ting the Unexploitable using Hardware Fault In...
BlueHat v17 || KERNELFAULT: R00ting the Unexploitable using Hardware Fault In...
 
Sullivan white boxcrypto-baythreat-2013
Sullivan white boxcrypto-baythreat-2013Sullivan white boxcrypto-baythreat-2013
Sullivan white boxcrypto-baythreat-2013
 
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
 
Building Your Application Security Data Hub - OWASP AppSecUSA
Building Your Application Security Data Hub - OWASP AppSecUSABuilding Your Application Security Data Hub - OWASP AppSecUSA
Building Your Application Security Data Hub - OWASP AppSecUSA
 

Último

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Último (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

Unboxing the White-Box: Practical Attacks Against Obfuscated Ciphers

  • 1.
  • 2. • All Principal Security Analyst @Riscure • Cristofaro Mune • Keywords: Software, Reversing, Exploit, Fault Injection… • Previous work on Mobile and Embedded Exploitation • Eloi Sanfelix • Keywords: Software security, RE, Exploiting, SCA/FI, CTF • Job de Haas • Keywords: Embedded, Side Channel Analysis, Fault Injection • All-round from network pentester to SoC evaluator Who are we?
  • 3. • White-Box cryptography  Protect keys in untrusted environment • Increasingly relevant in security solutions • The idea: Porting Hardware attacks to Software… …it works! Extremely effective approach • Relevant not only on WBC: • Potentially applicable to all Software-based crypto solution What and why…
  • 8. Sign of the times…
  • 9. Sign of the times…
  • 12. • Protection against key extraction in the white-box security model • A technique that allows merging a key into a given crypto algorithm: • Described for the first time in 2002 by S. Chow et al. • Available for AES and DES • Lookup tables used for applying mathematical transforms to data • Remove the distinction between keys and crypto algorithm code. White-Box Cryptography
  • 13. Software in the White-Box context Crypto Input Output Business logic keyI/O Direct access Can be modified at will
  • 14. Software Protection Obfuscation • Control-flow obfuscation • Data obfuscation Anti-analysis and anti-tamper • Detect debugger/emulator • Detect hooks and modifications Device binding • Bind code to current device WBC Input Output Protected binary Focus on this part only Business logic I/O
  • 15. How does WBC work? Image source: whiteboxcrypto.com
  • 16. WBC Construction: partial evaluation in key out T in out S
  • 19. External encoding WB AESE(INPUT) E’(OUTPUT) DECODE ENCODE Sn DECODE ENCODE S2 DECODE ENCODE S1 DECODE ENCODE … Sending Process Receiving Process ENCODE DECODE
  • 20. Data manipulation – Fault Injection (FI) Modify data here Potential attacks on WBC (I) and observe changes to the output
  • 21. Process manipulation – Fault injection (FI) Potential attacks on WBC (II) Modify code flow here and observe changes to the output
  • 22. Side channel analysis (SCA) / intermediate data analysis Observe data here Potential attacks on WBC (III) and compare it to expected data here
  • 23. • Attacks for all academic WBC proposals • Focus on key extraction • Type of transformations assumed known • Concrete transformation and key unknown • In real life… • we do not know much about the design! • Not many publicly documented SCA/FI on WBC • Implementation-specific DFA paper in 2002 [2] • Recent generic DPA-like attack in [3]* WBC attack literature * Authors coined the term Differential Computational Analysis
  • 26. Differential Fault Analysis Correct result Faulty result Correct result Faulty result Correct result Faulty result Correct result Faulty result
  • 27. DFA computation for DES L16R16 R15L15 R16 = F(R15 , K16)  L15 K16 K15
  • 28. R’15 L’16R’16 DFA computation for DES L15 R16 = F(R15 , K16)  L15 R’16 = F(R’15 , K16)  L15 R16  R’16 = F(R15 , K16)  F(R’15 , K16) XOR K16 K15
  • 29. Divide and conquer K16L15’ Independent 6-bit sub-keys Independent 6-bit search
  • 30. How to port DFA to WBC?
  • 31. 1. Location of fault injection point 2. Fault injection and ciphertext collection o Multiple options available 3. Fault analysis o We use our own tools o Some AES DFA examples on GitHub DFA attack process
  • 32. • Binary DES encryption WBC • Challenge posted at whiteboxcrypto.com • DES key hidden within lookups • Key value is 0x30 0x32 0x34 0x32 0x34 0x36 0x32 0x36 • We’ll demo all our attacks on this target Example target: wbDES
  • 33. Red: writes Green: reads STEP 1: Locating the injection point Event counter Stackspace Target area
  • 34. STEP 2: Fault injection 1. Select target event within target region 2. Modify data read by that event If event id within target region Invert a random bit
  • 36. Summary DFA results Implementation Fault injection Results Wyseur (DES) Unicorn script Broken in 40 faults Hack.lu 2009 (AES) Debugger script Broken in 90 faults SSTIC 2012 (DES) Modified lifted code Broken in 60 faults Karroumi (AES) Modified source code Broken in 80 faults NSC 2013 (encoded AES) N/A Not broken – encoding makes DFA not feasible
  • 38. Differential Power Analysis attack First proposed ~1998 by Paul Kocher to attack on smart cards:  Measuring power consumption of a crypto execution  Take multiple measurements for different inputs  Infer information about the key from the difference of these What is a DPA attack?
  • 39. Differential trace 0 0 0 0 1 1 1 1 Group by known data Average trace Subtract Differential trace
  • 41. Divide and conquer K1L1 Independent 6-bit sub-keys Independent 6-bit search
  • 42. Generalization of differential SCA attacks Take multiple “measurements” of behavior of crypto operations for different data Predict behavior for sub keys based on the same data and “leakage” model Apply statistical methods to distinguish the “best” sub key • Difference of means • Correlation • Mutual Information analysis, Linear regression analysis, … Find correct guesses for all sub keys to determine key
  • 43. To our surprise…. It works on White Box Crypto out-of-the-box!!!
  • 44. SCA attack process 1. Instrument WBC to collect “measurements” • Again: 2. Execute WBC with random inputs multiple times 3. Collect “measurement – input/output pairs” in useable form 4. SCA Analysis
  • 45. STEP1: Capture measurement • Grab the data using any method that fits your target • Instrument execution (eg. PIN, Valgrind) • Capture stack snapshots per crypto round (Hooking, debugger) • Use emulators and record (QEMU, Unicorn, PANDA) • Capture any information during execution that might leak • All reads/writes to memory • Lower bits of addresses of memory accesses • All register contents
  • 46. STEP2+3: Execute + Collect • Provide/inject random input data, capture output data • Program arguments • Use instrumentation from STEP 1 • Store it in a way that allows testing key guesses • Store as single bit samples • Assure alignment between multiple captures
  • 47. STEP 4: SCA Analysis Same target as for DFA: wbDES Same hidden key: 0x30 0x32 0x34 0x32 0x34 0x36 0x32 0x36 DEMO
  • 48. Summary SCA results Implementati on Attacked intermediate Results Results NXP [3] Wyseur (DES) Round output Broken in 75 traces Broken in 65 traces Hack.lu 2009 (AES) S-Box output Broken in 16 traces Broken in 16 traces SSTIC 2012 (DES) Round output Broken in 16 traces Broken in 16 traces Karroumi (AES) S-Box and GF(256) inverse Broken in ~2000 traces Broken in ~500 traces NSC 2013 (encoded AES) N/A Not broken Not broken – encoding makes DPA not feasible
  • 49. What does it mean? No detailed knowledge required • Of WBC implementation • Where the WBC is processed exactly No manipulation required  A secret random input/output encoding is the only barrier But: These random encodings do not work for many real world applications
  • 51.
  • 52. Is WBC broken and useless? • SCA/FI on standard WBC very effective: • Very limited knowledge required • RE skills might be needed • Countermeasures and risk mitigation required • Broken several open-source and commercial WBC • Commercial implementations typically require more RE skills • But… • Not regular software crypto  more complex attacks • Software protection layers can be a deterrent • With renewability it can be good enough
  • 53. How to make it stronger? WBC Input Output Protected binary Robustness against key extraction attacks (SCA, FI, algebraic, …) Business logic Robustness against advanced SW RE
  • 54. Side Channel Analysis attacks • Must prevent statistical dependence between intermediates and key • Typical countermeasures based on randomness difficult in white-box scenario Differential Fault Analysis attacks • Double-checks on encoded data  might be bypassed if detected! • Carry redundant data along computation? • Break fault models by propagating faults? Do you have any other ideas? But how?
  • 56. References [1] http://crypto.stanford.edu/DRM2002/whitebox.pdf [2] http://crypto.stanford.edu/DRM2002/drm1.pdf [3] https://eprint.iacr.org/2015/753 [4] https://www.cosic.esat.kuleuven.be/publications/thesis-152.pdf [5] https://www.cosic.esat.kuleuven.be/publications/thesis-235.pdf