Remote Timing Attacks are Still Practical
Billy Brumley Nicola Tuveri
Aalto University School of Science, Finland {bbrumley,ntuveri}@tcs.hut.fi
Remote Timing Attacks are Still Practical Billy Brumley Nicola - - PowerPoint PPT Presentation
Remote Timing Attacks are Still Practical Billy Brumley Nicola Tuveri Aalto University School of Science, Finland {bbrumley,ntuveri}@tcs.hut.fi Synopsis New remote timing attack vulnerability in OpenSSLs implementation of Montgomerys
Aalto University School of Science, Finland {bbrumley,ntuveri}@tcs.hut.fi
◮ Scalar multiplication method computing [k]G. ◮ Proposed for performance reasons, speeding up ECM.
/* find top most bit and go one past it */ i = scalar->top - 1; j = BN_BITS2 - 1; mask = BN_TBIT; while (!(scalar->d[i] & mask)) { mask >>= 1; j--; } mask >>= 1; j--; /* if top most bit was at word break, go to next word */ if (!mask) { i--; j = BN_BITS2 - 1; mask = BN_TBIT; } for (; i >= 0; i--) { for (; j >= 0; j--) { if (scalar->d[i] & mask) { if (!gf2m_Madd(group, &point->X, x1, z1, x2, z2, ctx)) goto err; if (!gf2m_Mdouble(group, x2, z2, ctx)) goto err; } else { if (!gf2m_Madd(group, &point->X, x2, z2, x1, z1, ctx)) goto err; if (!gf2m_Mdouble(group, x1, z1, ctx)) goto err; } mask >>= 1; } j = BN_BITS2 - 1; mask = BN_TBIT; }
◮ Denote the time required to process one scalar bit and compute one
◮ t is independent of any given ki bit value. ◮ The preceding while loop finds the MSB of k and optimizes the
◮ So there are exactly ⌈lg(k)⌉ − 1 ladder step executions. ◮ The execution time is precisely t(⌈lg(k)⌉ − 1).
500 1000 1500 2000 2500 Frequency Time <= 3 4 5 6 7 8 9 10 >= 11
n 111111...
3 1?????... 4 1?????... 5 1?????... 6 1?????... 7 1?????... 8 1?????... 1/2 9 1?????... 10 1?????... 11 1?????... 12 1?????... 13 1?????... 14 1?????... 15 1?????... 16 1?????...
18 01????... 19 01????... 20 01????... 1/4 21 01????... 22 01????... 23 01????... 24 01????...
26 001???... 1/8 27 001???... 28 001???...
1/16 30 0001??...
1/32
n 111111...
3 1?????... 4 1?????... 5 1?????... 6 1?????... 7 1?????... 8 1?????... 1/2 9 1?????... 10 1?????... 11 1?????... 12 1?????... 13 1?????... 14 1?????... 15 1?????... 16 1?????...
18 01????... 19 01????... 20 01????... 1/4 21 01????... 22 01????... 23 01????... 24 01????...
26 001???... 1/8 27 001???... 28 001???...
1/16 30 0001??...
1/32
n 111111...
2 00000?... 3 00000?... 4 00000?... 5 00000?... 6 00000?... 7 00000?... 8 00000?... 9 00000?... 10 00000?... 11 00000?... 12 00000?... 13 00000?... 14 00000?... 15 00000?... 16 00000?... 17 00000?... 18 00000?... 19 00000?... 20 00000?... 21 00000?... 22 00000?... 23 00000?... 24 00000?... 25 00000?... 26 00000?... 27 00000?... 28 00000?... 29 00000?... 30 00000?... 31 00000?...
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 30 40 50 60 70 80 Success probability Signature count bound: 156 bound: 157
43
43
1e-16 1e-14 1e-12 1e-10 1e-08 1e-06 0.0001 0.01 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Pr (subset without ’false positives’) Number of ’false positives’ in the filtered set. (e)
◮ Practical timing attack in both local and remote scenarios. ◮ What is a “remote” attack these days? ◮ Applies to all OpenSSL ≤ 1.0.0d. You might be affected if you do
◮ Ladder is not a silver bullet. ◮ Cryptography engineering still isn’t easy.