作为一个非密码学家,有一件事总是让我震惊:为什么使用质数如此重要?是什么让它们在密码学中如此特别?
有人能简单解释一下吗?(我知道有很多入门知识,应用密码学是圣经,但如我所说:我不打算实现我自己的加密算法,我发现的东西只是让我的大脑爆炸-请不要十页的数学公式)。
作为一个非密码学家,有一件事总是让我震惊:为什么使用质数如此重要?是什么让它们在密码学中如此特别?
有人能简单解释一下吗?(我知道有很多入门知识,应用密码学是圣经,但如我所说:我不打算实现我自己的加密算法,我发现的东西只是让我的大脑爆炸-请不要十页的数学公式)。
当前回答
Cryptographic algorithms generally rely for their security on having a "difficult problem". Most modern algorithms seem to use the factoring of very large numbers as their difficult problem - if you multiply two large numbers together, computing their factors is "difficult" (i.e. time-consuming). If those two numbers are prime numbers, then there is only one answer, which makes it even more difficult, and also guarantees that when you find the answer, it's the right one, not some other answer that just happens to give the same result.
其他回答
这里有一个非常简单和常见的例子。
RSA加密算法通常用于安全的商业网站,它是基于这样一个事实:取两个(非常大的)素数并将它们相乘很容易,而做相反的事情则非常困难——这意味着:取一个非常大的数,给定它只有两个素数因子,并找到它们。
因为没有人知道一个快速的算法把一个整数分解成质因数。然而,检查一组质因数是否乘以某个整数是非常容易的。
我不是数学家或密码学家,所以这里有一个外行的观察(没有花哨的方程,抱歉)。
这整个线程充满了关于如何在密码学中使用质数的解释,很难在这个线程中找到任何人以简单的方式解释为什么使用质数…很可能是因为每个人都认为这些知识是理所当然的。
只有从外部看问题才能产生这样的反应;但是如果他们使用两个质数的和,为什么不创建一个列表,列出任何两个质数可以产生的所有可能的和呢?
在这个网站上有一个455,042,511个质数的列表,其中最高的质数是9,987,500,000(10位数字)。 已知的最大素数(截至2015年2月)是2的257,885,161 - 1次方,即17,425,170位数字。这意味着保留所有已知质数的列表是没有意义的,更不用说所有它们可能的和了。取一个数并检查它是否是质数更容易。
计算大质数本身就是一项艰巨的任务,所以密码学家和数学家都会说,反向计算两个相互相乘的质数已经足够困难了……今天。
我认为在密码学中重要的不是质数本身,而是质因数分解问题的难点
假设你有一个非常非常大的整数,已知是两个质数m和n的乘积,要找出m和n是什么并不容易。RSA等算法就是基于这个事实。
顺便说一下,有一篇发表的算法论文可以在可接受的时间内使用量子计算机“解决”这个质因数分解问题。因此,当量子计算机问世时,新的密码学算法可能不再依赖质因数分解的“困难”:)
Cryptographic algorithms generally rely for their security on having a "difficult problem". Most modern algorithms seem to use the factoring of very large numbers as their difficult problem - if you multiply two large numbers together, computing their factors is "difficult" (i.e. time-consuming). If those two numbers are prime numbers, then there is only one answer, which makes it even more difficult, and also guarantees that when you find the answer, it's the right one, not some other answer that just happens to give the same result.