SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
LEDGER
Bitcoin wallets security
Erring on the hardware side
About the speaker
Nicolas Bacca, CTO of Ledger (previously BTChip),
designing hardware wallets (Ledger Wallet,
USB smartcard being the first)
15 years smartcard / embedded security industry experience
Engineer by day, reverse engineer by night
Jailbreaking things since 2002
Risks, threats and mitigations
Theft => encrypted USB drives, BIP 38
Bad crypto
Programming errors => audits ...
Brittle RNGs => RFC 6979
Malware => multi signature, BIP 70
Dumb (sweeping private keys)
Smart
Adapting to your environment
Abusing crypto
What’s needed
Protection against physical theft
Protection against malware
Protection of the private keys, critical asset
Validation of what is getting signed, in a trusted
environment
Protection against bad cryptography
Trustworthy RNG
Side channel resistant implementation
Hardware Wallet
Physical device offering those guarantees
Or isolated enclave offering those guarantees
Attacks on hardware wallets
Programming error (resulting in code execution)
Non invasive (SPA / DPA)
Slightly invasive (glitching)
Destructive (chip reverse engineering)
#TLDR protection profile
Hardware Wallet should not leak secrets on the go
with a not too intrusive attack
An attacker that did his homework previously should not
be able to run a SPA / glitching attack in a shop
Hardware Wallet should take some time to leak secrets
when borrowed, preferably only using a highly intrusive
method
Value of acceptable time may vary, let’s say 1 day
Sample programming error
Textbook stack overflow, leading to arbitrary code
execution, in TREZOR 1.2.0
https://github.com/trezor/trezor-
mcu/commit/524f2a957afb66e6a869384aceaca1cb7f9cba60
Reported, fixed quickly, no harm done
Future mitigation with stack protection at compiler level
Simple Power Analysis (SPA)
Based on direct mapping between CPU instructions +
operand and current consumption
Non invasive, non detectable
Easy, low cost, and fast (once calibrated)
Basically allows to read the code flow on oscilloscope
SPA apllied to Bitcoin
ECC Scalar multiplication (also consider Modular inversion, Montgomery mult)
Input: scalar k, P point k = {kn-1...k0}, kn-1 == 1
Output: R=k.P
R = ϑ
for i = n-1 to 0
R = R²
if ki == 1 R = R+P
end
s = kinv (h + r.d) => d = (s.k - h) . rinv
1 0 1 1 ….
Differential Power Analysis (DPA)
Non invasive, non detectable attack
Direct mapping between CPU instruction + operand and
current consumption
Not so easy, middle cost, longer time to set up
Retrieve secret value through mathematical analysis of
multiple high precision oscilloscope acquisitions
Differential Power Analysis (DPA)
Need to be able to fix all input value except one in attacked
code
In theory, ECDSA signature no really DPA vulnerable due to
random k
BUT: RFC 6979 make ECDSA DPA vulnerable at two levels:
we control all in first step of RFC, except x which is the
secret key
K = HMAC_K(V || 0x00 || int2bytes(x) || bits2bytes(h1))
s = kinv (h + r.d) : kinv is not known but always fixed for
the same input
Lack of real world attacks on this, anyone interested ?
Fault Injections Vulnerabilities
Invasive, hard to detect attack, unless hardware helps
Hard, high cost for bus/memory modifications
Hard, low/middle cost for clock/Vcc glitching on non secure
chips
Retrieve secret value through mathematical analysis of
multiple correct and incorrect computation (or fail chain)
Main type of attack:
C Safe Error
M Safe Error
Differential Fault Analysis (DFA)
A fail chain (and how to avoid it)
Read The Fine Chip Datasheets
Use your Open Source libraries with a large amount of salt
The “many eyes” paradigm doesn’t scale well for
complex (OpenSSL) or boring (X-Win) security issues
Read them more
A fail chain (and how to avoid it)
STM32 flash memory interface
A fail chain (and how to avoid it)
Typical implementation in libopencm3 (along with a warning.
in the source code.)
A fail chain (and how to avoid it)
Consequence : free lunch if a flash operation fails and
no status check (glitch it in the most unsubtle way possible,
keep running happily)
A fail chain (and how to avoid it)
Read The Fine Chip Datasheets (think I mentioned that
already)
Design your code with glitching in mind
Isolate critical operations and recheck them
Use appropriate Hamming distance for your critical
constants (no, 0 for False, everything else for True
doesn’t cut it)
Use appropriate hardware (if it can run with arbitrary clock
and voltage, or offers JTAG+lolfuse, good luck)
Sampling security in 2 minutes
PIN/passwords with limited attempts implementations are
nice to check and allow trivial attacks.
Timing attacks when comparing (SPA)
memcmp fail
Easy glitching attacks (Fault injection)
increase attempts after check fail
insecure check fail
sector
erase
sector
erase
sector
write
sector erase ...
Gentle trigger event from HW
sector
erase
starts
chip reset sequence ...
chip reset sequence ...
sectore erase
starts
Minimal chip voltage reached,
chip reset is triggered by HW.
Why smartcards help
Designed to prevent trivial clock / voltage glitching
Hardware validation of code paths
Usually come with cryptographic libraries that are
SPA/DPA/DFA resistant
Including patent licensing …
Small attack surface, being a dedicated hardware
component
Quick word about other enclaves
Pioneered by Hal Finney for Bitcoin
https://bitcointalk.org/index.php?topic=154290.0
Security to be probed (vendor dependant, RAM isolation
can be tricky,…)
Open source can happen
See Open TEE https://github.com/OP-TEE
Jailowning could be the new Jailbreaking
Commercial approach, see Rivetz talk
Conclusion
More eyes and hands needed
Consider hardware & software together
Break more hardware !
Failsafes
If the hardware can’t hodl by design, fail gracefully
(passphrases on microcontrollers based hardware
wallets)
LEDGER
Questions ?
nicolas@ledger.fr

Contenu connexe

Tendances

Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Zoltan Balazs
 

Tendances (20)

IoT Security
IoT SecurityIoT Security
IoT Security
 
Electronic Access Control Security / Безопасность электронных систем контроля...
Electronic Access Control Security / Безопасность электронных систем контроля...Electronic Access Control Security / Безопасность электронных систем контроля...
Electronic Access Control Security / Безопасность электронных систем контроля...
 
IoT Security: Cases and Methods [CON5446]
IoT Security: Cases and Methods [CON5446]IoT Security: Cases and Methods [CON5446]
IoT Security: Cases and Methods [CON5446]
 
Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu
 
IoT Saturday PN 2019 - Eurotech
IoT Saturday PN 2019 - EurotechIoT Saturday PN 2019 - Eurotech
IoT Saturday PN 2019 - Eurotech
 
Scaling IoT Deployments: DevOps for the Internet of Things
Scaling IoT Deployments: DevOps for the Internet of ThingsScaling IoT Deployments: DevOps for the Internet of Things
Scaling IoT Deployments: DevOps for the Internet of Things
 
Lesson 9- NodeMCU with Arduino UNO (UART)
Lesson 9- NodeMCU with Arduino UNO (UART)Lesson 9- NodeMCU with Arduino UNO (UART)
Lesson 9- NodeMCU with Arduino UNO (UART)
 
KazHackStan Doing The IoT Penetration Testing - Yogesh Ojha
KazHackStan Doing The IoT Penetration Testing - Yogesh OjhaKazHackStan Doing The IoT Penetration Testing - Yogesh Ojha
KazHackStan Doing The IoT Penetration Testing - Yogesh Ojha
 
Iot Security
Iot SecurityIot Security
Iot Security
 
IoT security zigbee -- Null Meet bangalore
IoT security zigbee -- Null Meet bangaloreIoT security zigbee -- Null Meet bangalore
IoT security zigbee -- Null Meet bangalore
 
Securing the Internet of Things
Securing the Internet of ThingsSecuring the Internet of Things
Securing the Internet of Things
 
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
 
IoT Security – Executing an Effective Security Testing Process
IoT Security – Executing an Effective Security Testing Process IoT Security – Executing an Effective Security Testing Process
IoT Security – Executing an Effective Security Testing Process
 
RSA2015: Securing the Internet of Things
RSA2015: Securing the Internet of ThingsRSA2015: Securing the Internet of Things
RSA2015: Securing the Internet of Things
 
IoT Security by Sanjay Kumar
IoT Security by Sanjay KumarIoT Security by Sanjay Kumar
IoT Security by Sanjay Kumar
 
[2.2] Hacking Internet of Things devices - Ivan Novikov
[2.2] Hacking Internet of Things devices - Ivan Novikov[2.2] Hacking Internet of Things devices - Ivan Novikov
[2.2] Hacking Internet of Things devices - Ivan Novikov
 
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
 
Your Thing is Pwned - Security Challenges for the IoT
Your Thing is Pwned - Security Challenges for the IoTYour Thing is Pwned - Security Challenges for the IoT
Your Thing is Pwned - Security Challenges for the IoT
 
IOT privacy and Security
IOT privacy and SecurityIOT privacy and Security
IOT privacy and Security
 
IoT security-arrow-roadshow #iotconfua
IoT security-arrow-roadshow #iotconfuaIoT security-arrow-roadshow #iotconfua
IoT security-arrow-roadshow #iotconfua
 

En vedette

Jaque Mate mes de octubre 2012
Jaque Mate mes de octubre 2012Jaque Mate mes de octubre 2012
Jaque Mate mes de octubre 2012
ComiteOlimpicoG
 
Competitors landscape
Competitors landscapeCompetitors landscape
Competitors landscape
Paola Cretico
 
Construccion de ciudadania -Camila 3º A
Construccion de ciudadania -Camila 3º AConstruccion de ciudadania -Camila 3º A
Construccion de ciudadania -Camila 3º A
leandraspinosa
 
CV_Carlos_Prieto_Lopez_2016_ES_VF (2)
CV_Carlos_Prieto_Lopez_2016_ES_VF (2)CV_Carlos_Prieto_Lopez_2016_ES_VF (2)
CV_Carlos_Prieto_Lopez_2016_ES_VF (2)
Carlos Prieto
 

En vedette (20)

Blue Planet Technologies2010 V03 Short
Blue Planet Technologies2010 V03 ShortBlue Planet Technologies2010 V03 Short
Blue Planet Technologies2010 V03 Short
 
3 codigo ascii ≈ [×bern@chea m×™]
3 codigo ascii ≈ [×bern@chea m×™]3 codigo ascii ≈ [×bern@chea m×™]
3 codigo ascii ≈ [×bern@chea m×™]
 
Play station 4
Play station 4Play station 4
Play station 4
 
Best Practices for File Sharing
Best Practices for File SharingBest Practices for File Sharing
Best Practices for File Sharing
 
Super catarina y los super insectos
Super catarina y los super insectosSuper catarina y los super insectos
Super catarina y los super insectos
 
Illuminati sociedad que controla el mundo
Illuminati sociedad que controla el mundoIlluminati sociedad que controla el mundo
Illuminati sociedad que controla el mundo
 
Jaque Mate mes de octubre 2012
Jaque Mate mes de octubre 2012Jaque Mate mes de octubre 2012
Jaque Mate mes de octubre 2012
 
Emerging City Report - Brasilia (2014)
Emerging City Report - Brasilia (2014)Emerging City Report - Brasilia (2014)
Emerging City Report - Brasilia (2014)
 
Formato hoja vida_juan_sebastian
Formato hoja vida_juan_sebastianFormato hoja vida_juan_sebastian
Formato hoja vida_juan_sebastian
 
Arias antiguas
Arias antiguasArias antiguas
Arias antiguas
 
especialidades del INWTD
especialidades del INWTDespecialidades del INWTD
especialidades del INWTD
 
FahrradJäger
FahrradJägerFahrradJäger
FahrradJäger
 
Proposal TTI
Proposal TTIProposal TTI
Proposal TTI
 
Catalyst Group's Latest Environment, Health and Safety Project
Catalyst Group's Latest Environment, Health and Safety ProjectCatalyst Group's Latest Environment, Health and Safety Project
Catalyst Group's Latest Environment, Health and Safety Project
 
Competitors landscape
Competitors landscapeCompetitors landscape
Competitors landscape
 
6 secrets of persuasive writing
6 secrets of persuasive writing6 secrets of persuasive writing
6 secrets of persuasive writing
 
Programa de Dirección en Big Data - IE Business School
Programa de Dirección en Big Data - IE Business School Programa de Dirección en Big Data - IE Business School
Programa de Dirección en Big Data - IE Business School
 
Construccion de ciudadania -Camila 3º A
Construccion de ciudadania -Camila 3º AConstruccion de ciudadania -Camila 3º A
Construccion de ciudadania -Camila 3º A
 
CV_Carlos_Prieto_Lopez_2016_ES_VF (2)
CV_Carlos_Prieto_Lopez_2016_ES_VF (2)CV_Carlos_Prieto_Lopez_2016_ES_VF (2)
CV_Carlos_Prieto_Lopez_2016_ES_VF (2)
 
Frases Acuarelas Musica Ir
Frases Acuarelas Musica IrFrases Acuarelas Musica Ir
Frases Acuarelas Musica Ir
 

Similaire à Bitcoin hardware wallets security

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
 
Sudhir tms 320 f 2812
Sudhir tms 320 f 2812 Sudhir tms 320 f 2812
Sudhir tms 320 f 2812
vijaydeepakg
 
1300 david oswald id and ip theft with side-channel attacks
1300 david oswald   id and ip theft with side-channel attacks1300 david oswald   id and ip theft with side-channel attacks
1300 david oswald id and ip theft with side-channel attacks
Positive Hack Days
 
Georgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software securityGeorgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software security
DefconRussia
 
amrapali builders@@sub way hacking.pdf
amrapali builders@@sub way hacking.pdfamrapali builders@@sub way hacking.pdf
amrapali builders@@sub way hacking.pdf
amrapalibuildersreviews
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
chiportal
 

Similaire à Bitcoin hardware wallets security (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]
 
BalCCon2k18 - Towards the perfect cryptocurrency wallet
BalCCon2k18 - Towards the perfect cryptocurrency walletBalCCon2k18 - Towards the perfect cryptocurrency wallet
BalCCon2k18 - Towards the perfect cryptocurrency wallet
 
Hardware backdooring is practical : slides
Hardware backdooring is practical : slidesHardware backdooring is practical : slides
Hardware backdooring is practical : slides
 
CheapSCAte: Attacking IoT with less than $60
CheapSCAte: Attacking IoT with less than $60CheapSCAte: Attacking IoT with less than $60
CheapSCAte: Attacking IoT with less than $60
 
Hacking RF based IoT devices
Hacking RF based IoT devicesHacking RF based IoT devices
Hacking RF based IoT devices
 
Sudhir tms 320 f 2812
Sudhir tms 320 f 2812 Sudhir tms 320 f 2812
Sudhir tms 320 f 2812
 
Tools for Practical Attacks on Analog-to-Digital Conversion
Tools for Practical Attacks on Analog-to-Digital ConversionTools for Practical Attacks on Analog-to-Digital Conversion
Tools for Practical Attacks on Analog-to-Digital Conversion
 
Arduino
ArduinoArduino
Arduino
 
1300 david oswald id and ip theft with side-channel attacks
1300 david oswald   id and ip theft with side-channel attacks1300 david oswald   id and ip theft with side-channel attacks
1300 david oswald id and ip theft with side-channel attacks
 
Georgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software securityGeorgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software security
 
Best-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbaiBest-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbai
 
amrapali builders@@sub way hacking.pdf
amrapali builders@@sub way hacking.pdfamrapali builders@@sub way hacking.pdf
amrapali builders@@sub way hacking.pdf
 
OT Security - h-c0n 2020
OT Security - h-c0n 2020OT Security - h-c0n 2020
OT Security - h-c0n 2020
 
Tinkercad Workshop PPT, Dept. of ECE.pptx
Tinkercad Workshop PPT, Dept. of ECE.pptxTinkercad Workshop PPT, Dept. of ECE.pptx
Tinkercad Workshop PPT, Dept. of ECE.pptx
 
Cryptography and secure systems
Cryptography and secure systemsCryptography and secure systems
Cryptography and secure systems
 
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical
 
Iot Workshop NITT 2015
Iot Workshop NITT 2015Iot Workshop NITT 2015
Iot Workshop NITT 2015
 
side-channel-kevin2600
side-channel-kevin2600side-channel-kevin2600
side-channel-kevin2600
 
presentation_sas2016_V3
presentation_sas2016_V3presentation_sas2016_V3
presentation_sas2016_V3
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
 

Dernier

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 

Dernier (20)

KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 

Bitcoin hardware wallets security

  • 2. About the speaker Nicolas Bacca, CTO of Ledger (previously BTChip), designing hardware wallets (Ledger Wallet, USB smartcard being the first) 15 years smartcard / embedded security industry experience Engineer by day, reverse engineer by night Jailbreaking things since 2002
  • 3. Risks, threats and mitigations Theft => encrypted USB drives, BIP 38 Bad crypto Programming errors => audits ... Brittle RNGs => RFC 6979 Malware => multi signature, BIP 70 Dumb (sweeping private keys) Smart Adapting to your environment Abusing crypto
  • 4. What’s needed Protection against physical theft Protection against malware Protection of the private keys, critical asset Validation of what is getting signed, in a trusted environment Protection against bad cryptography Trustworthy RNG Side channel resistant implementation
  • 5. Hardware Wallet Physical device offering those guarantees Or isolated enclave offering those guarantees Attacks on hardware wallets Programming error (resulting in code execution) Non invasive (SPA / DPA) Slightly invasive (glitching) Destructive (chip reverse engineering)
  • 6. #TLDR protection profile Hardware Wallet should not leak secrets on the go with a not too intrusive attack An attacker that did his homework previously should not be able to run a SPA / glitching attack in a shop Hardware Wallet should take some time to leak secrets when borrowed, preferably only using a highly intrusive method Value of acceptable time may vary, let’s say 1 day
  • 7. Sample programming error Textbook stack overflow, leading to arbitrary code execution, in TREZOR 1.2.0 https://github.com/trezor/trezor- mcu/commit/524f2a957afb66e6a869384aceaca1cb7f9cba60 Reported, fixed quickly, no harm done Future mitigation with stack protection at compiler level
  • 8. Simple Power Analysis (SPA) Based on direct mapping between CPU instructions + operand and current consumption Non invasive, non detectable Easy, low cost, and fast (once calibrated) Basically allows to read the code flow on oscilloscope
  • 9. SPA apllied to Bitcoin ECC Scalar multiplication (also consider Modular inversion, Montgomery mult) Input: scalar k, P point k = {kn-1...k0}, kn-1 == 1 Output: R=k.P R = ϑ for i = n-1 to 0 R = R² if ki == 1 R = R+P end s = kinv (h + r.d) => d = (s.k - h) . rinv 1 0 1 1 ….
  • 10. Differential Power Analysis (DPA) Non invasive, non detectable attack Direct mapping between CPU instruction + operand and current consumption Not so easy, middle cost, longer time to set up Retrieve secret value through mathematical analysis of multiple high precision oscilloscope acquisitions
  • 11. Differential Power Analysis (DPA) Need to be able to fix all input value except one in attacked code In theory, ECDSA signature no really DPA vulnerable due to random k BUT: RFC 6979 make ECDSA DPA vulnerable at two levels: we control all in first step of RFC, except x which is the secret key K = HMAC_K(V || 0x00 || int2bytes(x) || bits2bytes(h1)) s = kinv (h + r.d) : kinv is not known but always fixed for the same input Lack of real world attacks on this, anyone interested ?
  • 12. Fault Injections Vulnerabilities Invasive, hard to detect attack, unless hardware helps Hard, high cost for bus/memory modifications Hard, low/middle cost for clock/Vcc glitching on non secure chips Retrieve secret value through mathematical analysis of multiple correct and incorrect computation (or fail chain) Main type of attack: C Safe Error M Safe Error Differential Fault Analysis (DFA)
  • 13. A fail chain (and how to avoid it) Read The Fine Chip Datasheets Use your Open Source libraries with a large amount of salt The “many eyes” paradigm doesn’t scale well for complex (OpenSSL) or boring (X-Win) security issues Read them more
  • 14. A fail chain (and how to avoid it) STM32 flash memory interface
  • 15. A fail chain (and how to avoid it) Typical implementation in libopencm3 (along with a warning. in the source code.)
  • 16. A fail chain (and how to avoid it) Consequence : free lunch if a flash operation fails and no status check (glitch it in the most unsubtle way possible, keep running happily)
  • 17. A fail chain (and how to avoid it) Read The Fine Chip Datasheets (think I mentioned that already) Design your code with glitching in mind Isolate critical operations and recheck them Use appropriate Hamming distance for your critical constants (no, 0 for False, everything else for True doesn’t cut it) Use appropriate hardware (if it can run with arbitrary clock and voltage, or offers JTAG+lolfuse, good luck)
  • 18. Sampling security in 2 minutes PIN/passwords with limited attempts implementations are nice to check and allow trivial attacks. Timing attacks when comparing (SPA) memcmp fail Easy glitching attacks (Fault injection) increase attempts after check fail insecure check fail
  • 20. sector erase starts chip reset sequence ... chip reset sequence ... sectore erase starts Minimal chip voltage reached, chip reset is triggered by HW.
  • 21. Why smartcards help Designed to prevent trivial clock / voltage glitching Hardware validation of code paths Usually come with cryptographic libraries that are SPA/DPA/DFA resistant Including patent licensing … Small attack surface, being a dedicated hardware component
  • 22. Quick word about other enclaves Pioneered by Hal Finney for Bitcoin https://bitcointalk.org/index.php?topic=154290.0 Security to be probed (vendor dependant, RAM isolation can be tricky,…) Open source can happen See Open TEE https://github.com/OP-TEE Jailowning could be the new Jailbreaking Commercial approach, see Rivetz talk
  • 23. Conclusion More eyes and hands needed Consider hardware & software together Break more hardware ! Failsafes If the hardware can’t hodl by design, fail gracefully (passphrases on microcontrollers based hardware wallets)