简体   繁体   English

浏览器中的大数字算术,速度快得令人怀疑?

[英]Arithmetic with big numbers in browser, suspiciously fast?

I am trying to learn Diffie-Hellman, and the reason for its security should be because the computations needed to brute-force it should be so expensive that it would just not be worth it.我正在尝试学习 Diffie-Hellman,其安全性的原因应该是因为蛮力所需的计算应该非常昂贵,以至于不值得。 However typing但是打字

(2n**2048n-1n)%(2n**2048n)

in Google Chrome gives an instant result.在谷歌浏览器中给出了即时结果。 How come?怎么来的?

2n**2048n is "only" 617 digits in decimal: 2n**2048n是“仅”617 位十进制数:

% isn't a particularly difficult operation, even on a pair of numbers that large. %并不是一个特别困难的操作,即使是在这么大的一对数字上也是如此。

I think it's the sheer number of computations, not the difficulty of one of them, that's the key thing in Diffie-Hellman (though I have to admit not being a crypto guy).我认为这是计算的绝对数量,而不是其中一个的难度,这是 Diffie-Hellman 的关键(尽管我不得不承认不是加密专家)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM