【问题标题】:RSA-2048 bit in algorithm算法中的 RSA-2048 位
【发布时间】: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 年的算法?

问候。

【问题讨论】:

    标签: algorithm rsa


    【解决方案1】:

    2048 是指密钥的位长,这意味着对于 2048 位示例中的公钥,大数 n 将介于 2204722048

    所涉及的数学与使用较小键的示例相同

    【讨论】:

    • @thanks Cameron 但是你能用我上面提到的 p n 1 值的例子来解释一下吗?如果我将 p 设为 50 并且 q 43 n = (50-1)*(43-1) ; 49*42 = 2058
    • 不,你不能用一个例子来解释它,因为所涉及的数字是如此之大,我们正在谈论其中超过 500 位数字的数字。似乎您误解了“2048”,“2048”不是密钥,这是密钥的大小(以位为单位)。就像我说的那样,我们正在查看大约 2 到 2047 次方的数字
    • 其实模数预计在2^2047.5和2^2048之间
    • @Cameron 我明白了,你能不能让我在选择 e,d 时说清楚一点。当我得到 n 值时,可以说 3016 。那么我怎么知道 e 应该是一个不能被 n 整除的素数,而 d 应该是 e 的一个互素数。
    • 1:求n的欧拉总和:φ(3016) = 1344。 2:选e,由你决定,我们再用17。 3:计算 d = 1265 4:检查 (d * e) mod φ(n) = 1 对于本例,即 1265*17 mod 1344 = 1。就计算 φ(n) 和一个数的模乘逆,网上和网上计算器也有很多方法解释。 en.wikipedia.org/wiki/Euler%27s_totient_function 和模乘逆 en.wikipedia.org/wiki/Modular_multiplicative_inverse
    猜你喜欢
    • 2017-11-20
    • 1970-01-01
    • 1970-01-01
    • 2021-01-14
    • 2018-01-18
    • 1970-01-01
    • 2012-12-09
    • 2017-07-11
    • 1970-01-01
    相关资源
    最近更新 更多