Cryptography
Cryptography
Cryptography
2.1 Introduction
2.1.2 Keys
2.2.3 Authentication
2.3.3 Authentication
Forged in USA
Gathering entropy
Computing a random seed
Compute a pseudorandom number
stream from the seed
2.7 Numbers
2.7.2 Exponentiation
A straightforward implementation of
the algorithm in §2.7.2
Exponentiation is an opportunity for
a side-channel attack, because the im-
plementation would behave differ-
ently on each bit of the exponent, de-
pending on whether the bit was a 0 or
a 1. An implementation can avoid pro-
viding a side-channel by behaving the
same way on each bit. For instance, it
could always implement step 2 (multi-
plying the intermediate value by a),
saving both the result of step 1 and of
step 2, and then discard the result of
step 1 if the bit was a 1 or discard the
result of step 2 if the bit was a 0.
308÷112 = 2 remainder 84
112÷84 = 1 remainder 28
84÷28 = 3 remainder 0
109÷25 = 4 remainder 9
25÷9 = 2 remainder 7
9÷7 = 1 remainder 2
7÷2 = 3 remainder 1
2÷1 = 2 remainder 0
9=1×a–4×b.
7=–2×a+9×b.
2=3×a–13×b.
1=–11×a+48×b.
2.8 Homework