非对称密钥加密算法如何保持单向解密和加密功能?

发布于 2024-12-04 03:56:57 字数 1459 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

春风十里 2024-12-11 03:56:57

这样想吧。一些数学运算是可逆的。例如,考虑“乘以非零实数”的运算。修复非实数s并考虑由x ->定义的运算f(x) x * s 。那么这个操作是可逆的。事实上,如果采用 t = 1 / s,则由 g(x) = x * t 定义的运算 g(x)g(f(x)) = x 的性质使得 f 是可逆的。将 x 视为消息,s 视为公钥,f 视为加密算法,t 视为私钥和 g 作为解密算法。当然,这是一个糟糕的算法,但这就是非对称加密的全部内容:找到参数化的可逆数学运算。参数提供公钥,“逆参数”提供私钥。

当然,通过加密,我们希望更难找到逆矩阵。事实上,RSA 的数学是最著名的非对称密钥算法,是相当复杂的。它依赖于这样一个事实:某些数学问题被认为是极其困难的。

Think of it like this. Some mathematical operations are invertible. Consider, for example, the operation "multiplication by a non-zero real number." Fix a non-real number s and consider the operation f(x) defined by x -> x * s. Then this operation is invertible. In fact, if you take t = 1 / s then the operation g(x) defined by g(x) = x * t has the property that g(f(x)) = x so that f is invertible. Think of x as the message, s as the public key, f as the encryption algorithm, t as the private key and g as the decryption algorithm. Of course, this is a terrible algorithm, but this is all there is to asymmetric encryption: find a parameterized invertible mathematical operation. The parameter provides the public key, and the "inverse parameter" provides the private key.

Of course, with encryption we want it to be harder to find the inverse. In fact, the mathematics of RSA, the most well-known of the asymmetric key algorithms, are quite sophisticated. It relies on the fact that a certain mathematical problem is thought to be extremely hard.

完美的未来在梦里 2024-12-11 03:56:57

非对称密钥的核心总是存在一些计算上难以处理的数学恒等式。典型的例子是 RSA 算法。它的数学基础是存在数字bmn使得(b^m)^n = b代码>(模算术)。也就是说,如果 b 是我的消息,并且 mn 是非对称密钥的两个部分,那么一个密钥就可以解密某些内容另一个密钥已加密。也就是说,b^mb^n 充当密文,可以通过将它们分别求幂来解密。这些是安全密码的原因是,从 b^m 获取 b 在计算上是不可行的(即使您知道值 m*n >,也需要公开)。因此(m, mn)(n, mn)对构成非对称密钥对。

作为不知道私人秘密但仍在两方之间共享另一个秘密的另一个示例,请考虑 Diffie-Hellman 密钥交换:这里 Alice 和 Bob 保留秘密数字 xy分别是,没有人知道。然后,Alice 告诉 Bob c^x,Bob 告诉 Alice c^y,以获得某个公共值 c。现在双方都可以计算出c^xy的值,但是双方都不知道对方的秘密,也没有任何窃听者知道c^xy的值。这里的数学基础是,即使您现在使用 c,从 c^x 获得 x 在计算上也是不可行的。

At the very heart of asymmetric keys there is always some mathematical identity which is computationally intractable. The classic example would be the RSA algorithm. Its mathematical foundation is that there are numbers b, m, n such that (b^m)^n = b (in modular arithmetic). That is, if b is my message, and if m and n are the two parts of an asymmetric key, then one key can decipher something that the other key encrypted. That is, b^m, and also b^n, serve as cipher texts which can be deciphered by raising them to the respective other power. The reason that those are secure ciphers is that it is computationally infeasible to obtain b from b^m (even if you know the value m*n, which needs to be public, too). Thus the pairs (m, mn) and (n, mn) constitute an asymmetric key pair.

As another example of not knowing a private secret but still sharing another secret between two parties, consider Diffie-Hellman key exchange: Here Alice and Bob keep a secret number x and y, respectively, that nobody else knows. Then Alice tells Bob c^x, and Bob tells Alice c^y, for some public value c. Now both sides can compute the value c^xy, but neither side knows the other party's secret, nor does any eavesdropper know the value of c^xy. Here the mathematical foundation is that it is computationally infeasible to obtain x from c^x, even if you now c.

情深已缘浅 2024-12-11 03:56:57

您可以在此处找到有关公钥加密的相当好的解释。这并没有详细介绍所涉及的数学,因为它非常复杂并且无法用简单的术语解释。您可能还想查看此相关问题的答案:

You can find a fairly good explanation of public key cryptography here. That doesn't go into much detail about the math involved, since it is quite complex and impossible to explain in simple terms. You might also want to take a look at the answers to this related question:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文