我正在阅读有关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年的算法吗?
问候。
答案 0 :(得分:1)
2048指的是密钥的位长度,这意味着对于2048位示例中的公钥,大数字n将在 2 2047 和 2 2048
所涉及的数学与具有较小键
的示例相同