【发布时间】:2016-04-22 05:16:57
【问题描述】:
我正在阅读有关 RSA 算法及其工作原理的信息。我想知道它是如何计算第 2048 位的。它需要两个素数 p 和 q,那么我的数字将以 2048 位加密结束吗?
例如:
Choose two distinct prime numbers, such as
p = 61 and q = 53
Compute n = pq giving
n = 61*53 = 3233
Compute the totient of the product as φ(n) = (p − 1)(q − 1) giving
phi(3233) = (61 - 1)(53 - 1) = 3120
Choose any number 1 < e < 3120 that is coprime to 3120. Choosing a prime number for e leaves us only to check that e is not a divisor of 3120.
Let e = 17
Compute d, the modular multiplicative inverse of e (mod φ(n)) yielding,
d = 2753
Worked example for the modular multiplicative inverse:
(d * e) mod phi(n) = 1
2753 * 17 mod 3120 = 1
公钥是 (n = 3233, e = 17)。对于一个填充明文消息m,加密函数为:
c(m) = m power 17 mod 3233
私钥是 (d = 2753)。对于一个加密的密文c,解密函数为:
m(c) = c power 2753 mod 3233
例如,为了加密 m = 65,我们计算:
c = 65 power 17 mod 3233 = 2790
要解密 c = 2790,我们计算:
m = 2790 power 2753 mod 3233 = 65
我想计算 2048 年。谁能帮我推导出 2048 年的算法?
问候。
【问题讨论】: