旁道分析攻击与对策
1. 始终平方和乘法算法
在RSA实现中,存在一种简单功率分析(SPA)攻击,它利用了平方和乘法算法中仅当密钥位为1时才进行乘法运算的特点。为了应对这种攻击,提出了始终平方和乘法算法。
设 $n = pq$ 是两个不同奇素数的乘积,$d \in Z_{\varphi(n)}^*$ 是RSA的私钥,我们要计算 $a^d \bmod n$(其中 $a \in Z_n$)。
有右到左和左到右两种始终平方和乘法算法,具体如下:
算法4.6:右到左始终平方和乘法算法
Input: n, a, d // n ∈ Z, n ≥ 2; a ∈ Zn; d ∈ Zϕ(n) has bit length 𝓁d
Output: ad mod n
1 result = 1, t = a
2 for i = 0, i < 𝓁d, i ++ do
// ith bit of d is 1
3 if di = 1 then
// mutiply by a2i
4 result = result ∗ t mod n
5 else
// ith bit of d is 0, compute multiplication and discard the result
6 tmp = result ∗ t mod n
// t = a2i+1
7 t = t ∗ t mod n
8 return result
<
超级会员免费看
订阅专栏 解锁全文
29

被折叠的 条评论
为什么被折叠?



