Slashdot Mirror


A New Vulnerability In RSA Cryptography

romiz writes, "Branch Prediction Analysis is a recent attack vector against RSA public-key cryptography on personal computers that relies on timing measurements to get information on the bits in the private key. However, the method is not very practical because it requires many attempts to obtain meaningful information, and the current OpenSSL implementation now includes protections against those attacks. However, German cryptographer Jean-Pierre Seifert has announced a new method called Simple Branch Prediction Analysis that is at the same time much more efficient that the previous ones, only needs a single attempt, successfully bypasses the OpenSSL protections, and should prove harder to avoid without a very large execution penalty." From the article: "The successful extraction of almost all secret key bits by our SBPA attack against an openSSL RSA implementation proves that the often recommended blinding or so called randomization techniques to protect RSA against side-channel attacks are, in the context of SBPA attacks, totally useless." Le Monde interviewed Seifert (in French, but Babelfish works well) and claims that the details of the SBPA attack are being withheld; however, a PDF of the paper is linked from the ePrint abstract.

108 comments

  1. I got a question... by sam0vi · · Score: 4, Interesting

    When i see this kind of news the following question arises: so what are we supposed to do now? Throw away RSA cryptography is not the best answer i think. What do you, fellow /.ers, would do to by pass this problem?

    --
    When my Karma level reaches 0 I feel in piece with the Universe
    1. Re:I got a question... by Anonymous Coward · · Score: 0

      Add the ability for Security-Critical tasks to disable all but one processor core, and then go back to good ol' cooperative multitasking using that core. You can't produce careful timings if the RSA implementation doesn't let you run during the computation. Oh, and disable branch-prediction, along with every other useful feature of modern processors...

    2. Re:I got a question... by Anonymous Coward · · Score: 3, Informative

      This is not a vulnerability in RSA per se, but rather in the implementation of RSA on modern CPUs. It is possible to run a "spy" process along side cryptographic application, which would "sniff" out private keys. It can do this by making note of how its own instructions are executed and thus predicting what instructions are executed for other processes. I think the important thing is that this type of attack requires local execution of code for this to work.

      I would think this can be circumvented by alternative implementation of the RSA encoding algorithm. Maybe by inserting "noise" instructions into the execution flow.

    3. Re:I got a question... by Eon78 · · Score: 5, Informative

      You just keep on using RSA of course. As the article says: it is possible for a spy application running on your machine to get vital information about an RSA enryption process with OpenSSL. So, as long as you make sure your machine is secure there is nothing to worry about.

      Most of the time when you hear an encryption scheme is cracked or successfully attacked they mean that it has gotten easier to crack, not that the encryption is totally worthless. Which of course doesn't mean that countermeasures should not be taken, but it also doesn't mean that you have to throw out RSA.

    4. Re:I got a question... by maxwell+demon · · Score: 1

      What about just adding small random timing loops into the encryption algorithm? That is, just make so much noise in timing that you simply cannot recognise the signal in it.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    5. Re:I got a question... by Feyr · · Score: 2, Informative

      that's what they refer to with "blinding techniques". and as they said, it doesn't protect against this attack

    6. Re:I got a question... by Anonymous Coward · · Score: 0
      Quick Correction to your ideas...
      You just keep on using RSA of course. As the article says: it is possible for a spy application running on your machine to get vital information about an RSA enryption process with OpenSSL. So, as long as you make sure your machine is secure there is nothing to worry about.

      Either machine... It has to be running on one end. That means that if the host or client gets this bug, the RSA encryption from one point to the other is world reabable. That means, don't use the same username/password pair for every server you have an account incase one of the admins (or you) happen to get spyware.

      Most of the time when you hear an encryption scheme is cracked or successfully attacked they mean that it has gotten easier to crack,

      No, it means:
      1.) It's possible to crack it, which we didn't think would be possible for a few more years.
      2.) There is *at least* one person who can now get the clear text message out of something that is being sent end to end -- if he has his application on either side.

      not that the encryption is totally worthless.

      Right. It's like when MD5 was "cracked" because we are able to manufacture collissions now. It didn't mean that you could use an MD5 for other purposes (being confident that something downloaded or wrote/burned correctly). I mean most package systems still use MD5/SHA-1 hashes and gpg.

      Which of course doesn't mean that countermeasures should not be taken, but it also doesn't mean that you have to throw out RSA.

      Although there are a number of other schemes that have yet to be "broken", and it would be wise to start the switch.
    7. Re:I got a question... by Charles+Dodgeson · · Score: 2, Interesting
      What about just adding small random timing loops into the encryption algorithm?
      Apparently that is already done to thwart what the paper calls "classical timing attacks", but this attack is going after shared information about optimization. That information sharing seems part of the CPU architecture from my brief look at the paper.
      --
      Prime numbers are exactly what Alan Greenspan says they are -S. Minsky
    8. Re:I got a question... by smallfries · · Score: 4, Informative

      RSA isn't the problem. The implementation of RSA on a modern processor is the problem. Moving to another algorithm wouldn't guarantee a lack of side channels. One way around this would be to specialise the algorithm with your own private key. This would unroll all of the loops, and decide the branches statically. If you assume that the machine is not compromised, then this executable could be stored as read-only for your account. If the machine is compromised enough for a non-priviledged process to read your private data then you don't need SBPA - you're toast.

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    9. Re:I got a question... by Beryllium+Sphere(tm) · · Score: 1

      Offboard hardware acceleration would completely sidestep this particular attack.

      Or keep the system so heavily loaded that the spy process can't tell whether it's sharing a BTB with the RSA computation or with one of the other N threads.

      Or use a thread scheduler that assigns separate CPUs to crypto threads and to spyware threads :-)

    10. Re:I got a question... by maxwell+demon · · Score: 4, Interesting
      After now having read the complete article: Shouldn't it be possible to eliminate the branches completely?
      The following loop (adapted from fig. 3 in the paper) should IMHO work as well (although less efficiently):
      S = M
      A = M - 1
      for i from 1 to n-1 do
        S = S * S (mod N)
        C = di /* should be doable without branch by just bit masking and shifting */
        C = C * A
        C = C + 1 /* now if di was 1, C is M, otherwise C is 1 */
        S = S * C (mod N)
      return S
      The only branch here is in the for loop, and that's independent of the key. Unless there are exploitable branches in the multiplication routine, of course.
      --
      The Tao of math: The numbers you can count are not the real numbers.
    11. Re:I got a question... by twenex · · Score: 2, Informative

      Run all of your RSA operations in secure, dedicated HW devices (crypto co-processors such as smart-cards, IBM 4758s, nCipher, etc).

    12. Re:I got a question... by techno-vampire · · Score: 1

      So...what you mean is...run this on a 386?

      --
      Good, inexpensive web hosting
    13. Re:I got a question... by fbjon · · Score: 1

      A-ha. Dynamically compile the key into executable code when it's needed?

      --
      True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
    14. Re:I got a question... by smallfries · · Score: 1

      Yeah that's one way to do it. If you can assume the filesystem hasn't been compromised then you could store the executable on disk, otherwise build it at runtime.

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    15. Re:I got a question... by xquark · · Score: 1

      everyone one of the statements that contain *, mod and + have
      branching. Or did you just think they magically happen?

      --
      Arash Partow's Philosophy: Be a person who knows what they don't know, and not a person who doesn't know.
    16. Re:I got a question... by DrJimbo · · Score: 1
      I think he realizes that, but the essential thing is that the alternatives in the arithmetic branches are not directly related to the bits in the secret key. The multiplications and additions can be implemented as simple loops. The modular arithmetic will have some data dependent branching, but:
      1. The branching is not directly related to the bits in the key, and
      2. The balanced approach I suggested should totally mask any indirect correlations since you will get the same amount of modular calculations regardless of the state of each bit in the key.
      The implementation given in the original paper was vulnerable because the branch in the square-multiply loop directly corresponded to the bits in the private key. The proposed vectorized approach removes this direct correlation. The vectorized and balanced approach removes both the direct correlation and indirect correlations. It wasn't the branches per se that caused the vulnerability, it was the correlation between the branch outcomes and the bits in the private key.

      Another way to see this is to imagine that the spy program were able to actually see all the branch decisions from the crypto code. If simple loops are used for the multiply and add then the only possible place they could glean any information would be from the branches in the modular arithmetic. This should be masked by the balancing but if it is not, the data dependent branches in the modular calculation could also be vectorized and balanced thus eliminating any useful signal in the branch table.

      --
      We don't see the world as it is, we see it as we are.
      -- Anais Nin
    17. Re:I got a question... by maxwell+demon · · Score: 2, Interesting
      everyone one of the statements that contain *, mod and + have
      branching. Or did you just think they magically happen?

      The question is if they have exploitable branching. For example, the only + in that algorithm is the C=C+1, and that can clearly be done without exploitable branching, e.g. with the following x86 assembler code (assuming lsb-first storage, as usual for x86):
      ADD1TOC:
        mov ecx, LENGTH
        mov esi, ADDRC
        mov edi, ADDRC
        clc
      LOOP:
        lodsd
        adc eax, 1
        stosd
        dec ecx
        jnz LOOP
      Note that the only branch here is the jnz for the loop, but that doesn't reveal anything about the key.

      Also multiplication can be implemented without exploitable branches. I'm not completely sure about modulo, but I don't see an immediate reason why it shouldn't be possible as well.

      The fact that internally the processor has to make decisions does not have any relevance for this exploit, because those won't affect the branch predictor (which is only concerned with instruction-level branches, not possible branches in microcode). So yes, from the instruction level view, the addition/multiplication "magically" happen (the "magic" of course being in the microcode and the digital logic of the processor).
      --
      The Tao of math: The numbers you can count are not the real numbers.
    18. Re:I got a question... by akuma(x86) · · Score: 1

      I don't get it.
          C = di /* should be doable without branch by just bit masking and shifting */
          C = C * A
          C = C + 1 /* now if di was 1, C is M, otherwise C is 1 */

      if di was 1, then C - M, but if di was 0, the C - 0
      If C - 0, you get the wrong answer.

    19. Re:I got a question... by arivanov · · Score: 1

      There are a few more alternatives:

      1. Use a most recent Via CPUs (the ones released this year). The C7 has the time consuming parts of RSA accelerated on the CPU which makes this attack considerably less feasible. This is possibly the only cost effective method for limited budget cases where high speed is required. A full motherboard with CPU, SATA and all bells and whistles is around 150 pounds and IIRC is supported by OpenSSL 0.9.8 (and backport patches).
      2. Use (to the full) TPM on your machine (if present). TPM chips can do RSA in hardware. Unfortunately most of them are extremely slow. Same goes for most RSA capable smartcards and tokens like eToken and eToken64. They are sooooooooo slooooooooooooow it is unreal.
      3. Use a proper hardware RSA accelerator. There are several boards/chips which can do that and if you are really paranoid you are likely to be running one anyway.

      --
      Baker's Law: Misery no longer loves company. Nowadays it insists on it
      http://www.sigsegv.cx/
    20. Re:I got a question... by Garridan · · Score: 1

      If di is 1, C*A = M-1; so C = C + 1 is M If di is 0, C*A = 0; so C = C + 1 is 1

    21. Re:I got a question... by maxwell+demon · · Score: 1
      I guess your "-" all should habe been "="?

      For di=0:
      C = di /* now C = 0 */
      C = C * A /* still C = 0 */
      C = C + 1 /* now C = 1 */
      For di=1:
      C = di /* now C = 1 */
      C = C * A /* now C = M-1 */
      C = C + 1 /* now C = M */
      --
      The Tao of math: The numbers you can count are not the real numbers.
    22. Re:I got a question... by xquark · · Score: 1

      THESE ARE BIGINTS!!! they have nothing to do with what an x86 thinks they are, libraries
      are specifically designed to handle bigint numbers that 100+ digits long. that is the
      branching they are talking about in the article nothing else.

      That said, temporal and power cryptography has been known for at least 15 years now. this article
      is yesterdays news. the people writing this stuff are for all intents and purposes burnouts from
      the 90s.

      In short such attack don't work will in multitasking OSs running on multiple execution pipeline
      processors.

      --
      Arash Partow's Philosophy: Be a person who knows what they don't know, and not a person who doesn't know.
    23. Re:I got a question... by maxwell+demon · · Score: 2, Informative
      THESE ARE BIGINTS!!!

      STOP SHOUTING!
      Guess why I used a loop instead of a single increment instruction in my example code? Exactly: Because it's a bigint!

      they have nothing to do with what an x86 thinks they are

      I've used x86 assembly as example because there you can see exactly where a branch occurs. I could also have written some generic C code to do the same which could have been in a bigint library (OTOH I can imagine a bigint library using assembler as well, just in order to speed things up).

      that is the branching they are talking about in the article nothing else.

      What about actually reading the article? They explicitly don't target the multiplication algorithm, but the branch in the SM loop itself.

      In short such attack don't work will in multitasking OSs running on multiple execution pipeline processors.

      Again, RTFA. Their attack specifically works in multitasking OSs running on multiple execution pipeline processors (such as Intel's Hyperthreading). It won't work on multicore processors with only one pipeline per core, however.
      --
      The Tao of math: The numbers you can count are not the real numbers.
    24. Re:I got a question... by smallfries · · Score: 1

      Number 1 seems a bit wrong. The Via Padlock engine does two things - secure PRNG and it has a Montgomery multiplier. The secure PRNG doesn't help as that's not what the spy process is measuring. The multiplier is called either once, or twice, in the exponentation loop depending on a bit in the key. The leakage channel is the branch that decides whether or not to call the second multiplication. Is the Via Padlock that quick that it prevents the branch choice from leaking though the branch table?

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    25. Re:I got a question... by arivanov · · Score: 1

      No idea if it is quick enough (I just got 2 spanking new C7 MBs and was going to build some OpenVPN gateways from them while testing this in the process). It is definitely considerably quicker compared to software-only implementations and that is about as much as I know about it right now. Looking at what they did with AES and RNG it may as well be fast enough. No idea until I try.

      --
      Baker's Law: Misery no longer loves company. Nowadays it insists on it
      http://www.sigsegv.cx/
    26. Re:I got a question... by ecidquad · · Score: 1

      Is this solution heavier or not ?

      S = M
      for i from 1 to n-1 do
        S = S * S (mod N)
        C = (M & di) + (1 & not di)
        S = S * C (mod N)
      return S

    27. Re:I got a question... by ecidquad · · Score: 1

      Oups, I should have read it one more time: this algorithm is wrong (bad use of & di)

  2. Let me be the first to say.. by Anonymous Coward · · Score: 1, Funny

    pWn3d!

  3. Not so bad... by statusbar · · Score: 4, Insightful
    From the Abstract:
    SBPA attacks empower an unprivileged process to successfully attack other processes running in parallel on the same processor

    So it requires a spy proccess to be running on the same processor as the server....

    --jeffk++

    --
    ipv6 is my vpn
    1. Re:Not so bad... by zolf13 · · Score: 1

      Is it ("analyzing the CPU's Branch Predictor states through spying on a single quasi-parallel computation process") possible on modern PC with modern OS? Doesn't switching of the process on CPU also change branch prediction?

    2. Re:Not so bad... by Anonymous Coward · · Score: 0, Funny

      -----BEGIN PGP SIGNED MESSAGE-----

      I love anal.

      Sincerely,

      Robert Malda
      Slashdot Editor in Chief
      malda@slashdot.com

      -----BEGIN PGP SIGNATURE-----
      Version: 2.6.3i
      Charset: noconv

      iQCVAwUBOJ/axSh9+71yA2DNAQFArQP9HIiejXTs 6cj6xftdvGSPZBpJlkI5z1nZ
      zajHnSg81nFUvNgGyw5WS+X7 Yx0YzfY1YS3hbW0bHmIhf8OT3Z3r9RV7LZQBk+pO
      cM+5CV0s vvWJTpQ2doZnjy8/cksNGxWkVRO1l7gQw6dJ3xXUKoYJjwY9C8 SJVfrD
      bgfg+kcbQ2s=
      =DH2k
      -----END PGP SIGNATURE-----

    3. Re:Not so bad... by MK_CSGuy · · Score: 2, Informative

      Reminds me a lecture I attended last year where Adi Shamir talked about one of his latest AES attacks.
      Basically it uses information about the state of the CPU's memory cache and thus attacks processes on the same computer too.
      Here's the paper.

    4. Re:Not so bad... by statusbar · · Score: 1

      cool!

      You can also attack the algorithm by measuring current draw on the cpu, or you can attack it by measuring RF radiation from the system too.

      In order to avoid these attacks, the cpu's ALU's etc need to be designed with complementary logic gates such that no matter what signal is changing, there is always a paired signal changing the other way - so there are always the same number of data and clock transitions of every type on every clock cycle, giving you constant power usage.

      --jeffk++

      --
      ipv6 is my vpn
    5. Re:Not so bad... by SnowZero · · Score: 5, Interesting

      It gets better. The attack requires that the two processes are running on the same core with hyperthreading enabled (i.e. ALU-poor CMP). The "spy" process will be sucking up 100% cpu pretty much continuously. They also simplified the multiplication routine from OpenSSL. Even if you are running such a setup on a P4 with HT turned on (even though its often useless), and you need to run secure processes along with unsecure ones (generally not a good idea anyway), patches already exist for Linux and BSDs to address this. The patches modify the scheduler to prevent processes from different users from running on the same physical core. A half-hearted attempt is made in the paper to say that these attacks to generalize to something remote, but no details are given as to how their attack would compensate for the 100,000 fold decrease in timing accuracy to pull off the attack on even a local LAN.

      Essentially they took a very impractical attack with an unlikely scenario, and created a somewhat practical attack with an unlikely scenario. Avoid the problem scenario which was raised in the prior work last year, and you are still golden.

    6. Re:Not so bad... by Beryllium+Sphere(tm) · · Score: 3, Insightful

      For example, on a shared server at a colo site?

    7. Re:Not so bad... by Anonymous Coward · · Score: 2, Informative

      That's exactly why "Hyper-Threading Technology" is disabled by default on FreeBSD, and probably other systems.

      It's a know issue:
      http://security.freebsd.org/advisories/FreeBSD-SA- 05:09.htt.asc
      http://kerneltrap.org/node/5103

      Cheers.

    8. Re:Not so bad... by Anonymous Coward · · Score: 0

      Redundant Slashdot Club of Redundancy!

    9. Re:Not so bad... by DamnStupidElf · · Score: 2, Interesting

      Even if you are running such a setup on a P4 with HT turned on (even though its often useless), and you need to run secure processes along with unsecure ones (generally not a good idea anyway), patches already exist for Linux and BSDs to address this. The patches modify the scheduler to prevent processes from different users from running on the same physical core.

      The problem is that theoretically the attacker could use javascript or any other locally interpreted language or an ActiveX control under Internet Explorer to run the attacking process as the same user. To get the attacking process scheduled on the same core as the RSA process, just spawn lots of attacker processes. Some of them will get scheduled alongside the crypto process, even on a massively parallel machine.

      The big question will be whether multi-core processors in general will be vulnerable to these attacks using L2 cache timing attacks or something similar.

    10. Re:Not so bad... by WetCat · · Score: 1

      So it looks like in modern dual-core (and more CPU) systems you can avoid this problem by just dedicating one core to OpenSSL.

    11. Re:Not so bad... by Anonymous Coward · · Score: 1, Insightful

      I hope you're being sarcastic. The report discloses how to turn off HTT on FreeBSD systems. Nowhere does it say HTT is off by default. In fact, the fact that they have to tell you how to turn it off means it is probably on by default. Otherwise there would be a report about how to turn it on.

    12. Re:Not so bad... by tmasssey · · Score: 1

      There's a *real* problem with this. Constant power output means *maximum* power output, 100% of the time.

      Think about it...

    13. Re:Not so bad... by delt0r · · Score: 1

      If they can run code as the same user they don't need the attack. Thay can just read the "private" information more or less. Theres only so much you can do, even a simple keylogger attack is going to be easier than this one.

      --
      If information wants to be free, why does my internet connection cost so much?
    14. Re:Not so bad... by Anonymous Coward · · Score: 0

      No I wasn't. This disclosure was announced in May 2005 when HTT was enabled.

      It's disabled since then and, if you want it, you need to enable it with sysctl (machdep.hyperthreading_allowed)
      http://archives.neohapsis.com/archives/freebsd/200 5-05/0037.html

      Cheers.

    15. Re:Not so bad... by statusbar · · Score: 1

      Well, that's the cost of security! If the power output isn't constant, you are leaking security bits!

      I wonder if the 'Trusted Computing' chips do this - If they don't then this could be researched as a work-around for them.

      --jeffk++

      --
      ipv6 is my vpn
    16. Re:Not so bad... by Daniel+Phillips · · Score: 1

      theoretically the attacker could use javascript or any other locally interpreted language or an ActiveX control under Internet Explorer to run the attacking process as the same user. To get the attacking process scheduled on the same core as the RSA process, just spawn lots of attacker processes. Some of them will get scheduled alongside the crypto process, even on a massively parallel machine.

      OK, so obviously the attack can be thwarted by preventing a crypto thread from sharing a core with any untrusted thread. A straightforward kernel scheduler hack, a new core affinity API to expose, crypto applications to amend, and done. I do not belittle the amount of effort implied by what I just suggested, perhaps there is a much easier fix. My proposal does have the advantage of avoiding nasty, performance sucking hacks to obscure the timing information, and it handles a whole class of timing attacks.

      I do agree, the attack vector is valid.

      --
      Have you got your LWN subscription yet?
    17. Re:Not so bad... by DamnStupidElf · · Score: 1

      If they can run code as the same user they don't need the attack. Thay can just read the "private" information more or less. Theres only so much you can do, even a simple keylogger attack is going to be easier than this one.

      Not necessarily. Javascript or any other interpreted language could probably perform this attack and would run as the victim user, but since it's sandboxed the attack couldn't get at the keys directly.

    18. Re:Not so bad... by delt0r · · Score: 1

      I would think that this would be very difficult if even posable. You need to know a lot of details of the implemetation of the javascript. And some implemetations could make it imposible. Don't get me wrong the threat should be taken seriously. But for many its not the weakest link, and theres enough concern over hyperthreading anyway. I wonder if dual cores has some of the same attact vectors....

      --
      If information wants to be free, why does my internet connection cost so much?
  4. What is to be done? by Harmonious+Botch · · Score: 1

    "What do you, fellow /.ers, would do to by pass this problem?

    Get rid of the spyware, perhaps?

  5. Corel Cache by davidwr · · Score: 5, Informative

    Just in case it gets Slashdotted.

    PDF file

    --
    Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
  6. Unsecure computer - no secrets. Big deal ! by medoc · · Score: 1

    If you have a Trojan on your computer you are going to lose your secrets anyway, because, surprise, your private key is probably stored on the disk drive, and you use the keyboard to type passwords, etc. etc. Could someone explain how a local attack can be big news ?

    1. Re:Unsecure computer - no secrets. Big deal ! by Anonymous Coward · · Score: 0

      If you are running at different priveledge levels or as different users. i.e. you gain an unprivledged account on a secure server where you want access to it's private key.

    2. Re:Unsecure computer - no secrets. Big deal ! by maxwell+demon · · Score: 2, Informative

      On a multi-user system, someone may well have the right to run arbitrary code on the same processor, but not to access your data.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    3. Re:Unsecure computer - no secrets. Big deal ! by Cid+Highwind · · Score: 4, Interesting

      Think managed web hosting companies that put dozens of virtual hosts on a single physical server. If this really works from an unprivileged account, one malicious user could steal SSL keys from all the rest.

      --
      0 1 - just my two bits
    4. Re:Unsecure computer - no secrets. Big deal ! by iacp · · Score: 1

      But if he has such priviledged access to CPU, can't we just simply suppose he's also able to "see" what you type on your keyboard ?

    5. Re:Unsecure computer - no secrets. Big deal ! by RAMMS+EIN · · Score: 3, Informative

      ``If you have a Trojan on your computer you are going to lose your secrets anyway,''

      Whose secrets? Multiple people use my computers. If there's a trojan on the system, it can't necessarily access all these people's data.

      ``your private key is probably stored on the disk drive,''

      Password-protected, thank you very much.

      ``and you use the keyboard to type passwords''

      I don't use a keyboard with most computers I use; I communicate with them over SSH. Of course, I use a keyboard on _some_ machine, so if that machine has a keylogger running on my account (or root's), that would be a problem.

      ``Could someone explain how a local attack can be big news ?''

      I haven't RTFA yet, but local attacks are often problematic for systems used by multiple people, especially if not all people know good security practices (or are even completely clueless - you get many of such people when you operate shared web hosts).

      --
      Please correct me if I got my facts wrong.
    6. Re:Unsecure computer - no secrets. Big deal ! by Anonymous Coward · · Score: 1, Insightful
      But if he has such priviledged access to CPU, can't we just simply suppose he's also able to "see" what you type on your keyboard ?
      RTFA. The researchers claim that it does not require privileged access:

      "Moreover, despite sophisticated hardware-assisted partitioning methods such as memory protection, sandboxing or even virtualization, SBPA attacks empower an unprivileged process to successfully attack other processes running in parallel on the same processor."
    7. Re:Unsecure computer - no secrets. Big deal ! by maxwell+demon · · Score: 1

      You don't need a priviledged access to the CPU. A normal shell account and a compiler suffice. That's usually not enough to read someone else's keyboard typing.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    8. Re:Unsecure computer - no secrets. Big deal ! by Beryllium+Sphere(tm) · · Score: 1

      This is a local attack by an unprivileged thread, one that could not install a keylogger, read another user's files, or do much of anything except run its own code and measure the timing.

    9. Re:Unsecure computer - no secrets. Big deal ! by Alsee · · Score: 3, Insightful

      problematic for systems used by multiple people

      And perhaps more signifigantly, it is problematic for idiots who think the definition of "secure/security" is using some DRM scheme hoping to "secure" a computer against its owner.

      The owner of a computer can use the technique in this article to keep an eye on his own computer and track what his computer is doing for him, and to record the DRM-keys being used to "secure" his own data against him.

      -

      --
      - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
    10. Re:Unsecure computer - no secrets. Big deal ! by owlstead · · Score: 1

      "I haven't RTFA yet, but local attacks are often problematic for systems used by multiple people, especially if not all people know good security practices"

      For this special attack, I don't think it would matter too much if the users know good security practices. If you start up SSL, it probably start off with a sequence that can be easily detected (e.g. by simply watching what's running on a machine). Then the spy application would kick in. It's something to be solved by the software implementors more than anything else...

  7. Multi-site servers at risk? by CamoCoatJoe · · Score: 5, Insightful

    Let me get this straight. To use this attack, you need to be running on the same hardware, but you don't need any particular access beyond that? If that's the case, any multi-site server that allows you to run your own server-side scripting is at risk.

    --
    This is not a signature.
  8. VMS by MichaelSmith · · Score: 2, Interesting

    I started working on VAX/VMS systems in 1986. I changed jobs to another DEC site after nine months or so. I got an account, put my username in at the appropriate prompt, hit return and then immediately knew that I had entered my old username, not the new one.

    I had to think for a bit before I knew the reason: VMS searched SYSUAF.DAT for my username before I entered the password. If it found the username it would stop searching. Later versions did the search after the password had been entered and one type of attack became less likely.

    I suppose something like this could be done so that timing can't be used to debug the process runing the algorithm but another way of viewing it is that it is like getting the key from a chip by measuring the amount of power it uses or something. There may be limits to who far protection can go if you have the hardware or are on the same (virtual) machine.

    1. Re:VMS by dk90406 · · Score: 1

      Not a pretty solution, but changning the timing to be consistent in all logins might help. So if user XXzzz logs on and it takes 4 seconds while aAAa only take 0.1, making aAAa logon time 4 seconds would help security but annoy most of the users.

  9. Is this only during key generation? by Anonymous Coward · · Score: 0

    Just wondering. If it is, then who cares? What sort of moron generates new keys while the system's in a user-exposed untrusted phase?

    Oh yeah, the Grid weenies....

    1. Re:Is this only during key generation? by maxwell+demon · · Score: 1

      No, it's during key usage.

      --
      The Tao of math: The numbers you can count are not the real numbers.
  10. Branch predictor as a covert channel by hpa · · Score: 4, Interesting

    This isn't really a flaw in RSA cryptography, but rather the fairly obvious situation that a branch predictor, shared between processes of different privilege levels, can be used as a covert channel and thus can be used to reveal state. The same is true with the cache, for example, and multithreading makes this problem many times worse by increasing the bandwidth of the channel. On architectures which don't have branch predictors, or don't share them, this is not an issue. ARM processors, for example, tend to rely on predication rather than branches (except when running Thumb), and thus don't suffer the same problem.

    This class of problems is only going to grow as CPUs become less and less deterministic.

    1. Re:Branch predictor as a covert channel by Anonymous Coward · · Score: 0
      Is this actually a problem?


      If I have access to your computer and intimate enough knowledge to perform this attack, usually there might be even better ways, I mean I can fire up a debugger and I can probably get 100% of the bits to your secret key when it is decrypted rather than the rate they are getting (506 of 512 bit in the paper) If I know what to look at and when to do it, I can make sure I'm 100% accurate and not just that, I can get the key you used to protect you private key and I can get the session key you used to encrypt your message.


      In a certain type of shared environment I can see this being a problem, it's definitely a result you need to be aware of, particularly with shared systems but it's not that substantial or new. Hell if you use a shared system, such as in a university environment and you keep PGP keys on a system, someone else can get those keys. That's just how it is. There are similar "attacks" that measure the heat given off by the CPU to determine when it's doing certain types of work.


      It seems like the techniques IBM and Sony used on Cell are an attempt to allow these types of calculations to happen in a less trusted environment, basically there is a core in the CPU that is marked secure, code is loaded in and it cannot be looked at, you DMA some data to a portion of memory, let the core do it's thing and then you DMA out a response. Even with Jtag you cannot view what that core is doing once it is marked "secure." Trying to guess things based upon timing become much more difficult and there are ways to deal with that in the code, you can make sure every job takes the exact same amount of time. It seems like the only place this would matter is if you're using trusted hardware like in a console and you have some ability to debug the system but it has protected resources you cannot get at because of hardware, maybe then you could deduce the hardware keys or something. It certainly doesn't affect RSA at large though.

    2. Re:Branch predictor as a covert channel by Anonymous Coward · · Score: 0

      At the same time they are going to be less practical as single-processor systems will become rare. With 2, 4 or more processors there will be little chance to communicate between running processes.

  11. mod parent up by Anonymous Coward · · Score: 1, Informative

    For unmasking the sensationalist headline. This attack only works if you are already logged in to the box and able to run processes on it. Yet from reading the article summary, it looked like I would have to fear for my online banking SSL connections and SSH sessions.

  12. RSA Isn't Broken, And This Is Localhost Only by tqbf · · Score: 4, Informative

    Aciicmez et al are extending an attack they published a few months ago. It's real, but:

    • It targets RSA implementations, not the algorithm, which is fine

    • Attackers need to be on the same host as the victim

    • This specific attack is tuned to the Pentium 4 architecture

    This paper doesn't break SSL.

    We wrote about the attack two months ago. A quick, dumbed-down recap:

    The CPU aggressively caches aspects of what programs do. It doesn't make an exception for RSA. You obviously can't just read key bits out of the cache.

    But caches are finite, and way, way too small to accomodate everything every program does. So operations from one program are constantly evicting cached values from other programs. This makes the other program imperceptably but measurably slower. By writing a program that constantly and carefully measures those time differences, you can watch an RSA operation from another program leave footprints through the cache.

    There are years-old attacks like this against the L1 and L2 caches, and extensions that use hyperthreading to improve the resolution. Some variants, which measure timing differences but don't track cache footprints, are remote attacks. These aren't. You run a "spy" process on the machine; it repeatedly executes a series of operations and measures timing differences. Aciicmez found an overlooked cache which makes Pentium branch prediction work (the BTB). They published back in August.

    From what I can tell, this paper extends the attack; they figured out that the Pentium 4 architecture has two BTB caches, and their original attack wasn't hitting both of them. Their new attack does, and that creates much bigger timing differences, making RSA's footprints much easier to see.

    This is really cool stuff, but from where I stand, they hit game-over back in August with the original BTB attack. This paper reads like a refined exploit for the same vulnerability.

    Since this is localhost-only, and (unlike Bernstein's and Boneh's attacks) can't be extended remote, it's not going to impact SSL or (single-user) SSH. The classic victim of timing attacks is smart cards. For these attacks, another interesting possibility is DRM; these attacks say you can't trust crypto running on the same Pentium 4+ as an attacker.

    1. Re:RSA Isn't Broken, And This Is Localhost Only by asuffield · · Score: 0, Offtopic
      This paper reads like a refined exploit for the same vulnerability.


      Virtually every academic paper ever published will match some statement of the form "a refined X for a known Y". That's what academic papers do. Papers which break new ground come around about once every few decades; most significant developments are actually a sequence of very small steps that the press ignores because it doesn't sound very impressive that way.

      Academic papers are almost never newsworthy. They are for academics to read. If you aren't working in the field (of *research*, or closely related engineering), you aren't interested in them. This one is no exception.

      The normal process, for those editors who have been living in a swamp for the past 500 years, is: discovery, press release (-> news), peer review, paper. Occasionally the second and third are swapped, but not often; researchers rarely feel a desire to keep their work secret after it's finished. For security issues like this one, the press release is called an "advisory", but that's just another name for the same thing.

      There's a good chance that this paper contains nothing new, and is merely the peer-reviewed version of an advisory that was published months ago (I don't remember the advisory, so I can't check). That would be normal. It would mean this article is a dupe, which is also normal.
    2. Re:RSA Isn't Broken, And This Is Localhost Only by wirelessbuzzers · · Score: 1
      This paper doesn't break SSL.

      ...

      Since this is localhost-only, and (unlike Bernstein's and Boneh's attacks) can't be extended remote, it's not going to impact SSL or (single-user) SSH.


      What's more, they didn't break OpenSSL even on the same machine. To quote from the paper:


      We used the RSA implementation from OpenSSL version 0.9.7e as a template and made some modifications to convert this implementation into the simple one as stated above. To be more precise, we changed the window size from 5 to 1, removed the CRT mode, and added the dummy reduction step. (emphasis mine)


      If the window size is 5 by default, most of the bits don't affect branches at all, because the branch is replaced by a lookup table. If it's a sliding window, something like 1 bit in 5 results in a key-dependent branch, and if it's a fixed window, none of them do. Oh, and as a side effect, the signing/decryption will be significantly (~30%) faster. Of course, you can use cache-timing attacks to snoop on the lookup table.

      But now to quote from the OpenSSL changelog:


      Changes between 0.9.7g and 0.9.7h [11 Oct 2005]

      ...

            *) Make a new fixed-window mod_exp implementation the default for
                RSA, DSA, and DH private-key operations so that the sequence of
                squares and multiplies and the memory access pattern are
                independent of the particular secret key. This will mitigate
                cache-timing and potential related attacks.


                BN_mod_exp_mont_consttime() is the new exponentiation implementation,
                and this is automatically used by BN_mod_exp_mont() if the new flag
                BN_FLG_EXP_CONSTTIME is set for the exponent. RSA, DSA, and DH
                will use this BN flag for private exponents unless the flag
                RSA_FLAG_NO_EXP_CONSTTIME, DSA_FLAG_NO_EXP_CONSTTIME, or
                DH_FLAG_NO_EXP_CONSTTIME, respectively, is set.

      (emphasis mine)


      Now, I haven't gone over the latest OpenSSL code with a fine-toothed comb, but I have gone over it with a coarse-toothed one (as part of an analysis of a related attack). The BN_mod_exp_mont_consttime() in 0.9.8d appears (both from code structure and comments) to go to some lengths to avoid key-dependent branches, and I expect that the same is true in the older maintained branch, 0.9.7l. If this is done correctly, it should totally prevent this attack.

      In other words, this attack doesn't work on any real implementation, because existing optimizations hide most of the bits. As to the remaining bits, OpenSSL fixed this over a year ago as part of a patch to a different localhost-only attack (the "Hyperthreading considered harmful" attack). To make their attack, these guys used a year-old version of the code, and even then they had to rewrite it to be more vulnerable.

      Of course, their paper has some value: it shows once again that if you use a naive implementation of RSA, you can be hacked. It improves a previous attack, and demonstrates that one obvious defense doesn't prevent the attack. But the real world, at least the UNIX side, has moved on from there.
      --
      I hereby place the above post in the public domain.
    3. Re:RSA Isn't Broken, And This Is Localhost Only by tqbf · · Score: 2, Insightful

      You didn't even read the article.

  13. Closed and open. by CCFreak2K · · Score: 1

    ...the current OpenSSL implementation now includes protections against those attacks.

    This really hits the mark. What if OpenSSL, an arguably widely-used crypto layer, were closed instead of open? According to what I hear on Slashdot, we would have no idea if "ClosedSSL" would have protection against this kind of thing, but because OpenSSL is, uh, open, we can verify that these kinds of attacks are indeed mitigated.

    --
    "Beware of he who would deny you access to information, for in his heart he dreams himself your master."
    1. Re:Closed and open. by rduke15 · · Score: 1

      but because OpenSSL is, uh, open, we can verify that these kinds of attacks are indeed mitigated.

      In fact, if I understood the article correctly, this particular attack is NOT mitigated by the protections that were implemented in OpenSSL.

    2. Re:Closed and open. by nicuramar · · Score: 1

      Right. The attacks that are mitigated in the current OpenSSL are some earlier, simpler ones; not the main one described in the paper.

  14. Translation of the article published by Le Monde by jackjeff · · Score: 4, Informative

    Better than BabelFish I hope.. human made, so prone to errors ;)

    ====

    The confidence users have in Internet and in the capacity of the system to secure data has always been relative. And it could collapse if the microprocessor manufacturers and cryptography software editors were to be unable to cope against a new type of attack, fearsomely efficient, discovered by the team directed by the German cryptographer Jean-Pierre Seifert (universities of Haifa and Innsbruck). Electronic commerce could be threatened, but also, more broadly, everything that enables the dematerialization of exchanges, which rely on asymmetrical cryptography applications, would it be ciphers, digital signatures or message integrity checks.

    In the still confidential article, the researcher and his colleagues describe the procedure they used to, gather a nearly entire cipher key of 512 bits (a series of as many of 0s and 1s) in a single attempt, that's to say in a few milliseconds. For comparison, the greatest public key that has been broken so far is 640 bits long, and as announced in November 2005, the process involved the usage of 80 microprocessors running at 2.2 Ghz for 3 months.

    Since the announcement made this summer, on the International Association of Cryptology Research (IACR), that such an attack was theoretically feasible, microprocessors producers were on their nerves: the chips of nearly all of the computers, world wide, are vulnerable. So much that the head of Intel security, the number 1 microprocessor manufacturer, when confronted with the issue declared that he would be "unavailable for a few weeks". This is because the usual fix against classical attacks on public key cryptography - to increase the size of the keys - will not work this time.

    Jean-Pierre Seifert was in fact able to affect the systems from the ground up. As most of the security relies on the incapacity to mathematically deduce the private key, kept secret, from the public one, he chose to study how the microprocessors was reading these confidential data.

    He found out that the mode of operation or the chip itself, optimized for calculation speed, was making it vulnerable. "Security was sacrificed for the sake of performance", estimated the researcher.

    The attack principle can be summed up as such: to go faster and faster, the microprocessor parallelizes operations and uses a branch prediction system to predict the result of the current operation. If the prediction is good, the computation time is greatly decreased. If not, the processor must go back and start again the elementary operation. It is "sufficient" to measure the computation time when the processor goes through the line of 0s and 1s that constitute the cipher key to able able to deduce it.

    This threat, called "Branch Prediction Analysis" (BPA) was already known. It was thought a lot of attempts was necessary to statistically deduce the cipher key, thus making the attack not-practicable. The technique discovered by Jean-Pierre Seifert make it possible to break the key in a single attempt. It relies on the fact that the prediction process, essential to increase the processor speed, is not protected.

    A spyware could then be made to listen to the chip discreetly, and send back the key to hackers, foreign intelligence services or competitors.

    "A MATTER OF WEEKS"

    We are not yet there though. "We have not made a turn key application that would be available online" argues Jean-Pierre Seifert. But he estimates that once the method is made public, in early 2007 during the next RSA conference - RSA, being one of the most popular ciphers -, the making of such software would be "a matter of weeks".

    Cryptography specialists confirm that the threat is serious. One of the best world wide public key experts anonymously sums up the situation: "The real solution is to review the conception of the microprocessors itself - a long and difficult process. A short term solution would be to forbid normal applications to run in para

  15. Re: DRM? by jackjeff · · Score: 1

    Yep localhost only... so who is the primary user of localhost public key cryptography techniques?

    DRMs! yep yep!...
    I would love to see Vista DRMs cracked before the OS even make it to the market... :)

    ok.. i'm probably dreaming, but still it feels good.

  16. It All Depends On Simple Branch Prediction by PavementPizza · · Score: 1

    Now I have no idea what this means exactly, so I'll let Steve Jobs explain this RSA attack. I called him up and asked him how it worked. Jobs said, "I dunno what it does. It predicts...branches. It's a good thing!"

    --
    Viper is the preferred editor of the Emacs operating system.
  17. Run it on the GPU by creysoft · · Score: 1, Interesting

    This seems to rely on spy software watching your particular RSA application decrypt things, and thus said spy software would need to be running on the same hardware. Wouldn't it make sense to start writing RSA implementations that use the computer's GPU whenever possible? Using the GPU as a coprocessor has been discussed on Slashdot previously, and the main disadvantage was that the GPU isn't typically optimized for general purpose computing. However, since most GPU's are optimized for massive number crunching, I would think that RSA would play to its strengths. Obviously, whether or not the GPU is "good" at it, it would still come with the advantage of moving the implementation off the main CPU, and thus foiling any malware. (At least until they design malware that runs on the GPU...)

    --
    Formerly GNU/Anonymous Coward. This message has been determined to cause cancer in laboratory animals.
    1. Re:Run it on the GPU by Anonymous Coward · · Score: 0

      1) The GPU isn't optimized for "massive number crunching" exactly; it is good at floating point math (and fairly specific kinds of floating point math I believe). It is a massively bad idea to assume that every problem can be run well on a GPU, and an even more massively bad idea to asssume that this is a good idea even if you can (say goodbye to any sort of cross platform programming).

      2) There are easier ways to fix this problem. For example: change the OS so that two processes owned by different users do not run on the same core at the same time. I believe a patch to do this is working its way into the Linux kernel if it already isn't there.

      3) This attack seems like it would be extremely difficult to put into actual practice. The only reason that it is news is that there is a possibility that it will be easier to put this into practice than to break RSA.

    2. Re:Run it on the GPU by Antique+Geekmeister · · Score: 1

      Using GPU's for general purpose computing has been tried for years: it's never really gotten effective, especially since GPU's vary enough that it's difficult to write robust low-level drivers and compilers, then to get them accepted.

      No, if you're doing a lot of SSL work and are worried about this, take a look at SSL accelerator cards. They range from $100 to $1000, and seem quite useful for website hosting that will be doing a lot of encrypted traffic.

  18. Virtualization by tqbf · · Score: 1

    You're thinking too small. The real problem moving forward is virtualization; the industry is converging to a state where hosted servers will transparently share underlying hardware; the new threat model is VM-to-VM, which is why the earlier commenter who dismissed "overly complex local-only problem scenarios" (paraphrase) is off base.

  19. What about virtualization? by Mawbid · · Score: 1

    Can the spy process do its job from a different virtual machine? If so, and if virtualization methods can't be tweaked to defeat all such attacks while maintaining reasonable performance, that might spell doom for the virtual server market.

    --
    Fuck the system? Nah, you might catch something.
  20. Re: DRM? by Alsee · · Score: 2, Interesting

    I would love to see Vista DRMs cracked before the OS even make it to the market... :)

    No no no! I hate when researchers do that!

    Not long ago someone published a way to load unsigned kernal drivers in Vista (Vista's DRM mechanisms criticially rely on owners being strictly forbidden to do that). So what happened? Microsoft patched Vista to prevent that mechanism from working... before the OS even made it to market. So the discovery and all that work went entirely to waste.

    No, when someone finds an anti-DRM method the best thing to do is not just wait until release, but wait until the DRM scheme has had time to build up a critical usage base. If you find two or more methods at the same time, then only reveal them one at a time. Wait till they release the inevitable new lockdown patch, then wait maybe a week or two, then reveal the next one. (Revealing the second one on the very day they patch may be more fun and impressive, but I think it much better to drag out the value and effect of the multiple techniques over a period of weeks or months.)

    -

    --
    - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
  21. It only needs the public key by wwnexc · · Score: 1

    From the paper, it sounds as though the attack only relies on the public key. Does this mean that all pgp / gpg secret keys can be compromised this way?

  22. PGP / GPG: It only needs the public key! by wwnexc · · Score: 1

    The paper seems to describe a process where only the public key has to be on the "spied upon" machine. Everybody can get access to almost everybody's public pgp key. Does this mean, that all RSA pgp / gpg keys can be compromised using this method, even if one keeps the secret key on a computer with only a floppy drive (to get the data which will be decrypted onto the machine) and no connection to any kind of a network (ideally...)? Is it really this scary, or do they infact need to spy on the machine with the secret key on it?

  23. here's how it works (from the paper) by yppiz · · Score: 2, Informative
    Here's the key part from the paper (pdf):


    Also a spy process is executed simultaneously with the
    cipher and it continuously does the following:
    1. continuously executes a number of branches, and
    2. easures the overall execution time of all its branches
    in such a way that all of these branches map to the same BTB set which also stores the
    specific conditional branch determined by the secret key bits of the crypto process. This
    requires that the number of branches in the spy process needs to be equal to the associativity
    of the underlying BTB, i.e., to its number of ways. Recall that it is easy to understand the
    properties of the BTB using simple benchmarks as explained in [MMK].
    Let's analyze what's happening if the adversary starts the spy process before the cipher.
    It simply means that when the cipher starts the encryption (= signing), the CPU cannot find
    the target address of the target branch in the BTB and the prediction must be not-taken, cf.
    [She]. Furthermore, we can distinguish two cases depending on the currently processed secret
    key bit:
    • If the branch turns out to be taken, then a misprediction will occur and the target address
      of the branch needs to be stored in BTB. Then, one of the spy branches has to be evicted
      from the BTB so that the new target address can be stored in. When the spy-process
      re-executes its branches, it will encounter a misprediction on the branch that has just
      been evicted. As the spy-process also measures the execution time of all its branches, it
      can simply detect whenever the cipher modified the BTB, meaning that the execution
      time of these spy branches takes a little longer than usual.
    • If the branch turns out to be not taken, then no misprediction will occur and the BTB
      does not need to be updated. When the spy-process re-executes its branches, measures
      the execution time of all its branches, it can simply infer that the cipher had not modified
      the BTB, and the target branch was not taken by the crypto process.
    Thus, the adversary can simply determine the complete execution flow of the cipher
    process by continuously performing the above very simple spy strategy, i.e., just executing
    spy branches and measuring their overall execution time. Therefore, the spy process will see
    the complete prediction/misprediction trace of the target branch, and is able to infer the
    secret key. Following [OST06], this kind of attack was named an asynchronous attack, as the
    adversary-process needs no synchronization at all with the simultaneous crypto process --
    it is just following his own paradigm: continuously execute spy branches and measure their
    overall execution time.
    1. Re:here's how it works (from the paper) by Anonymous Coward · · Score: 0

      copy-paste karma-whore

  24. Redundant ? by udippel · · Score: 2, Interesting
    Even though this might be redundant after so many comments, it might be summarized again that the good prof has not broken RSA. Actually, the vulnerability has little to nothing to do with RSA.

    The whole thing - as critical as it is - spies on the processes running on the machine. It is an indirect attack, checking on the resources used while performing some not broken algorithmic calculations.
    When you disable pipelining and cache while doing the calculations, there is not much to spy on and nothing to gain. Just prevent the wanna-be intruder from seeing cache, pipelines, CPU from working makes you safe.
    The problem is, that this isn't very practical.

    I wished the editors used less misleading headlines. There is no vulnerability in RSA cryptography per se. It is rather that you observe Men At Work and from what you see you can guess what the're doing.
    And in principle this applies to any other cryptography just as well. Inclusive DRM (which makes me giggle).

  25. Been There, Done that by Anonymous Coward · · Score: 0

    This type of attack has been mentioned before per DJ Bernstein's paper on "Cache-timing Attacks on AES":

    http://cr.yp.to/papers.html#cachetiming

    PDF format:
    http://cr.yp.to/antiforgery/cachetiming-20050414.p df

    PS format:
    http://cr.yp.to/antiforgery/cachetiming-20050414.p s

  26. Nobody uses binary exponentiation by lgalfaso · · Score: 2, Interesting

    Hi, This paper is based on the wrong assumption that the algorithm that is used is binary exponentiation. This is false as every single respectable implementation uses N-ary multiplication or sliding windows in the worst case scenario. In both of these cases, the attack as shown in the paper would only be able to predict minimal information. Also, the claimed statement that you can do nothing with this type of attack is completely false (even in the case of binary exponentiation.) Just do this: - If you have a 1, do as usual - If you have a 0, do as in the case you have a 1, but ignore the last value, and use the result of the squaring. Regards, LG

  27. Great idea! by DrJimbo · · Score: 4, Interesting
    That is a clever vectorization of the square-multiply loop. It sure looks to me like it would work (I used RSA encryption as the final project in a University assembly language class I taught). The slight decrease in efficiency of your routine will be not be noticed. The timing of the entire process is totally dominated by the N-byte x N-byte multiplications. An extra N-byte x 1-byte multiplication will cause less than a 1% slowdown, probably much less.

    A slight improvement to your idea might be to balance the loop anyway, using D = 1 - di, etc., essentially a vectorized version of figure 4. This would slow it down by a factor of two but it would make it resistant to conventional timing attacks.

    --
    We don't see the world as it is, we see it as we are.
    -- Anais Nin
  28. predication is your friend by YH · · Score: 1

    get rid of those pesky branches...

  29. Multi-Processors by Plutonite · · Score: 1

    Any thoughts, or did I miss somebody's comments?

  30. I can't login to my Slashdot account! by Anonymous Coward · · Score: 1, Funny

    Somehow, my password had been changed by someone even though I have always login using HTTPS. I wonder why...

  31. Re: DRM? by Anonymous Coward · · Score: 0

    Good thinking. That could be a very practical use for this technique - hacking your own machine. I wanted to mod you up, but as the other poster remarked, DRM countermeasures should be secret until the DRM is widely deployed.

    Another technique that I'd like to chip in with is the possibility of using differential power analysis on your own hardware. Apparently it is not possible to completely prevent power analysis on a piece of hardware: there are plenty of things that can be tried, such as using balanced data paths and executing extra obfuscating operations, but these just make the attack slower - not impossible. We may end up using power analysis to extract the secret keys from our trusted computing modules in the future. However, this will require sensitive measuring equipment: a software-only attack would be much easier!

  32. Maybe, maybe not by jd · · Score: 1
    First, once upon a time, there were no real alternatives to RSA. These days, I know of at least five other major categories of public-key encryption and there are undoubtedly more. This makes the idea of dropping RSA - at least in the really sensitive stuff where any known vulnerability is really bad news - a definite possibility.


    Second, these are timing-based attacks that perform branch prediction. This requires no changes to OpenSSL or any other source to completely mask. You first mix the optimization methods when compiling, and then use the real-time scheduler, to ensure that as many branches as possible (preferably all) take the same length of time within the margin of error of any observation. You can't choose between that which you cannot distinguish.


    Finally, this is specific to an implementation. If OpenSSL had multiple branches for the same algorithm (just a different implementation which it could select at random for any block of data), or if you had multiple OpenSSL installations which differed sufficiently in implementation that the computer could again select at random, you'd make it a lot harder for an attacker.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  33. Solution to: Branch predictor as a covert channel by Terje+Mathisen · · Score: 3, Interesting

    From the linked article:

    R0 = 1; R1 = M
    for i from 0 to n-1 do
        if d[i] then
            R1 = R0 * R1 mod N
            R0 = R0 * R0 mod N
        else
            R0 = R0 * R1 mod N
            R1 = R1 * R1 mod N
    return R0

    The key-dependent if statement is the key here, if we can remove all such branches, then there's no Branch Target Buffer entry that depends on it, and no timing channel attack either:


    R0 = 1; R1 = M;
    for (i = 0; i < n; i++) {
        mask = 0 - d[i]; // Either 0 or -1
        nmask = mask ^ -1; // -1 or 0
        T0 = R0 & mask; // Either 0 or R0
        T0 += R1 & nmask; // At this point T0 will point to the value to be squared, R0 or R1!

        T1 = R0 * R1 mod N;
        T0 = T0 * T0 mod N; // Now we move the correct values back into R0 & R1
        R1 = T1 & mask;
        R0 = T0 & mask;
        R0 += T1 & nmask;
        R1 += T0 & nmask;
    }
    return R0;


    There are at least three interesting issues here:

    a) Most modern cpus have hw support for conditional operations, on x86 this is in the form of CMOVcc which is a (constant-time!) conditional move into a register, but as shown above, it really isn't needed here.

    b) The perforance impact of the above branch removal can be negative!
    On a P4 a branch miss costs about 20 clock cycles, and since a key-dependent branch will miss 50% of the time, the average cost is 10 cycles. My replacement code above takes around 5 cycles or less on any current cpu.

    c) A final possible timing-channel attack would be due to the memory alignment of the R0 and R1 values:
    By allocating them at the same address modulo the cpu page size, i.e. at 4 KB offset, the cache lines hit will be the same for both.

    When I worked on the asm version of DFC, one of the AES also-rans, I removed a similar timing attack from a core 128-bit modular multiplication operation, using very similar techniques.

    Terje

    --
    "almost all programming can be viewed as an exercise in caching"
  34. MOD PARENT UP by Nicolay77 · · Score: 1

    This kind of comments are what keeps slashdot above digg and all the rest.

    --
    We are Turing O-Machines. The Oracle is out there.
  35. I was wrong about the speed by DrJimbo · · Score: 1
    The vectorized version will, of course, run 25% slower than the non-vectorized version because the second multiply is performed twice as often. The vectorized version will run faster than the balanced version but a vectorized and balanced version will run slowest of all.

    Balancing may not be needed at all with the vectorized version. Certainly the same top level calls are made each time through the loop regardless of the bits in the private key so the need to balance is totally dependent on the implementations of the arithmetic functions, particular the modulus. If the control flow in all these functions is data independent then there would be no need to balance the vectorized version. It will be immune from both branch table and timing attacks (I think). If the control flow in those functions is data dependent then it would probably more efficient to vectorize them rather than balance the top loop.

    --
    We don't see the world as it is, we see it as we are.
    -- Anais Nin
  36. Peter Gutmann on the Seifert Paper by Ararat · · Score: 1

    Widely-respected Australian cryptographer Peter Gutmann offered a concise analysis of the Seifert's achievement on the Cryptography Mailing List yesterday. It offers both detail and useful perspective.

    Udhay Shankar N had just summarized the scary rumors about the Seifert's attack:

    "... German cryptographer Jean-Pierre Seifert has announced [1]a new method called Simple Branch Prediction Analysis that is at the same time much more efficient that the previous ones, only needs a single attempt, successfully bypasses the OpenSSL protections, and should prove harder to avoid without a very large execution penalty."

    Gutmann replied with a magisterial air:

    "That's not quite accurate. What it did was succeed against a an old version of OpenSSL that (a) didn't have the protections present yet and (b) had been specially modified to make it vulnerable to the attack. It's a nice attack, but based on what's been published so far the claims of RSA's demise are considerably exaggerated.

    "What it does is rely on the fact that on a HT P4, if you saturate the branch target buffer (BTB) from a second thread running in the same pipeline (i.e. on the same HT CPU), you can see when BTB misses occur in the RSA thread and therefore observe whether it's branching on a one or zero bit.

    "To do this, they had to use (as mentioned above) a rather old version of OpenSSL that doesn't employ any protection against this type of attack. In addition they reduced the modexp window size from 5 to 1 (to make sure you get a branch for each bit, with the standard window size 5 the branches are replaced by a table lookup), and they disabled the CRT code (to force use of the textbook-mode RSA operation that, in practice, no software implementation ever uses).

    "This isn't to say that the paper doesn't point out a potential vulnerability. However, saying "we broke RSA" or "we broke OpenSSL" is pushing things a bit."

    Peter.
    1. Re: Peter Gutmann on the Seifert Paper by Ararat · · Score: 1

      Opps. My apologies. Peter Gutmann is a New Zealander, not an Australian. Again, humble apologies.

  37. Re:Solution to: Branch predictor as a covert chann by Anonymous Coward · · Score: 0

    thats me again. i wrote to one author of the paper. this method is known but is slower, he says. true because i always perform all calculation. but i cant believe its 4times slower. for me its 1.5 times slower and 2 times at worst, and prolly not because as terje said it removes pipe flush.