Live data from Hacker News

ECDSA Key Extraction from Mobile Devices via Nonintrusive Physical Side Channels

eprint.iacr.org

51–56 of 56 posts

Re: ECDSA Key Extraction from Mobile Devices via Nonintrusive Physical Side Channels

#51
post #45
post #41

Earlier quoted context omitted.

Again: Ed25519 isn't ECDSA. Not just different curves, but different signature constructions. Curve25519 and ECDSA are orthogonal. I'd have disagreed with your comment even if you had said "Ed25519" instead of "Curve25519", but I especially disagree with the comment you actually wrote.

Thanks for the clarification. While I am aware that Curve25519 is not Ed25519 is not ECDSA, they all at least belong into the field of Elliptic Curve Cryptography. It is hard for an outsider to tell how wide a certain sub-field is, and how far the related work research should go. I merely took the hints from the paper, which addressed ECC in some places, and wrongfully concluded that DJB's research would be still on…

The field is huge, what djb has done is a part of it. Obviously not relevant here.

Re: ECDSA Key Extraction from Mobile Devices via Nonintrusive Physical Side Channels

#52
post #23

Earlier quoted context omitted.

That parenthetical sounds extremely important! Won't executing the same instructions on different data use different amounts of power and emit different amounts of EM? For example, I would think (naively, I'm only familiar with the most basic of hardware whatnot) that multiplying 0 and 0 would not use the same amount of power and emit the same EM as multiplying 0xffffffff by 0xffffffff.

Yes, this exactly the basis of differential power analysis. This was first demonstrated back in 1999 by Kocher et al [0] [0]: https://www.cis.upenn.edu/~nadiah/courses/cis800-02-f13/read...

and in a video: https://www.youtube.com/watch?v=gbqNCgVcXsM

Re: ECDSA Key Extraction from Mobile Devices via Nonintrusive Physical Side Channels

#53
post #42

This work is very important. Some might dismiss it because it is no surprise that these implementations would have serious sidechannel vulnerabilities, and --indeed-- in Bitcoin Core we stopped using OpenSSL for signing two years ago for this reason. But, as cryptographers ourselves, our choices aren't all that representative of application authors in general. I've found it to be difficult to get parties to stop usin…

What was the process of learning about side channels and techniques for mitigating them when developing libsecp256k1?

It's an area I'd love to better understand.

Re: ECDSA Key Extraction from Mobile Devices via Nonintrusive Physical Side Channels

#54

Silly question based on my layman's understanding of the attack: Can you impede the extraction process simply by having your phone/tablet/laptop generate interference while the decryption process is happening? For instance, if your laptop is simultaneously playing music through its speakers, would the analysis still let them definitively pick out the signing key?

To me this sounds similar to the problem of how to execute a timing-based attack over a network with variable latency. The key is to make lots of requests very quickly. You can then statistically narrow down very small variations even though they're built on top of a larger trend signal like the network latency or a piece of music.

As another commenter suggested, there may also be signal processing techniques to "mod out" the interference from the music (perhaps measured with a probe on the audio output?) and measure only what's left.

Re: ECDSA Key Extraction from Mobile Devices via Nonintrusive Physical Side Channels

#55
post #53
post #42

This work is very important. Some might dismiss it because it is no surprise that these implementations would have serious sidechannel vulnerabilities, and --indeed-- in Bitcoin Core we stopped using OpenSSL for signing two years ago for this reason. But, as cryptographers ourselves, our choices aren't all that representative of application authors in general. I've found it to be difficult to get parties to stop usin…

What was the process of learning about side channels and techniques for mitigating them when developing libsecp256k1? It's an area I'd love to better understand.

For us it was an iterative process that started with making a commitment to do our best to do the right thing-- accepting that we don't control how the users us the software and that to do a good job we must defend against a very broad class of attacks... and that it's a good investment of time to really refine the tools here so that the users have the least time lost to worrying about the details of the underlying behavior. The earlier work on cache sidechannel attacks against OpenSSL also helped convince other people that this was important.

Pieter did a cache timing attack project against DES at his university in 2004. I had experience with modeling fine scale algorithm delays as part of ultra-low latency audio codec work. So we had a little bit of additional background beyond regular systems programming and mathematical experience.

We spent time studying other implementations and academic papers on the subject-- just a product of searching and following citations-- and we implemented and measured (both in timing form and 'read the assembly' form). Pieter had to do some algebraic work to adapt a 'unified' group law approach to our curve and coordinate system. [Then all of this also presented additional verification work to validate that the new group law was algebraically correct.]

Because we accepted that this was going to be a considerable amount of work, we didn't refrain from trying multiple ideas and throwing things away. The libsecp256k1 codebase is written in a clean (IMO), typesafe, heavily tested way that makes iteration easier.

We initially implemented a bit-slicing approach to achieve memory access uniformity. After we thought we were at least a strict improvement over OpenSSL, we contacted an outside expert (Yuval Yarom, one of the authors of this paper, in fact) and they were kind enough to give our implementation a look-- and pointed out some additional research that showed our particular bit slicing approach was not quite constant time on common hardware. So we fixed that too.

I don't consider our work done on this-- we are likely vulnerable to differential power analysis on at least some hardware. We've implemented a basic level of blinding to harden against that-- but without a good measurement setup it's hard to tell if our efforts are helping (or maybe hurting, though that's unlikely). I loaned Thomas Daede a USRP, and he's been attempting to set up a DPA continuous integration rig for us (https://bitcointalk.org/index.php?topic=1319848.0); but it's effort that is competing with a lot of other projects for attention for all of us. Similarly some (now uncommon) hardware has things like data-variable time multipliers, and on that hardware little can be done beyond blinding; but again, without more analysis it's hard to know exactly where that stands.

Re: ECDSA Key Extraction from Mobile Devices via Nonintrusive Physical Side Channels

#56
post #23

Earlier quoted context omitted.

They are highly correlated. The best way to achieve constant time is making your code paths data independent, that is, it always execute the same instructions, whatever the data. This code will also use constant power and have constant EM emission. (Except for low level optimizations in hardware, that may break any of those characteristics.)

That parenthetical sounds extremely important! Won't executing the same instructions on different data use different amounts of power and emit different amounts of EM? For example, I would think (naively, I'm only familiar with the most basic of hardware whatnot) that multiplying 0 and 0 would not use the same amount of power and emit the same EM as multiplying 0xffffffff by 0xffffffff.

That depends on the specifics. The fastest implementation of most integer instructions use constant time.

Constant power and EM depend on some extra factors, but when there is variance, it is normally very small (a transistor or two not switching for each bit of difference).

Post reply on HN