这样想吧。一些数学运算是可逆的。例如,考虑“乘以非零实数”的运算。修复非实数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 作为解密算法。当然,这是一个糟糕的算法,但这就是非对称加密的全部内容:找到参数化的可逆数学运算。参数提供公钥,“逆参数”提供私钥。
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.
非对称密钥的核心总是存在一些计算上难以处理的数学恒等式。典型的例子是 RSA 算法。它的数学基础是存在数字b、m、n使得(b^m)^n = b代码>(模算术)。也就是说,如果 b 是我的消息,并且 m 和 n 是非对称密钥的两个部分,那么一个密钥就可以解密某些内容另一个密钥已加密。也就是说,b^m 和 b^n 充当密文,可以通过将它们分别求幂来解密。这些是安全密码的原因是,从 b^m 获取 b 在计算上是不可行的(即使您知道值 m*n >,也需要公开)。因此(m, mn)和(n, mn)对构成非对称密钥对。
作为不知道私人秘密但仍在两方之间共享另一个秘密的另一个示例,请考虑 Diffie-Hellman 密钥交换:这里 Alice 和 Bob 保留秘密数字 x 和 y分别是,没有人知道。然后,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.
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:
发布评论
评论(3)
这样想吧。一些数学运算是可逆的。例如,考虑“乘以非零实数”的运算。修复非实数
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 operationf(x)
defined byx -> x * s
. Then this operation is invertible. In fact, if you taket = 1 / s
then the operationg(x)
defined byg(x) = x * t
has the property thatg(f(x)) = x
so thatf
is invertible. Think ofx
as the message,s
as the public key,f
as the encryption algorithm,t
as the private key andg
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.
非对称密钥的核心总是存在一些计算上难以处理的数学恒等式。典型的例子是 RSA 算法。它的数学基础是存在数字
b
、m
、n
使得(b^m)^n = b
代码>(模算术)。也就是说,如果b
是我的消息,并且m
和n
是非对称密钥的两个部分,那么一个密钥就可以解密某些内容另一个密钥已加密。也就是说,b^m
和b^n
充当密文,可以通过将它们分别求幂来解密。这些是安全密码的原因是,从b^m
获取b
在计算上是不可行的(即使您知道值m*n
>,也需要公开)。因此(m, mn)
和(n, mn)
对构成非对称密钥对。作为不知道私人秘密但仍在两方之间共享另一个秘密的另一个示例,请考虑 Diffie-Hellman 密钥交换:这里 Alice 和 Bob 保留秘密数字
x
和y
分别是,没有人知道。然后,Alice 告诉 Bobc^x
,Bob 告诉 Alicec^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, ifb
is my message, and ifm
andn
are the two parts of an asymmetric key, then one key can decipher something that the other key encrypted. That is,b^m
, and alsob^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 obtainb
fromb^m
(even if you know the valuem*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
andy
, respectively, that nobody else knows. Then Alice tells Bobc^x
, and Bob tells Alicec^y
, for some public valuec
. Now both sides can compute the valuec^xy
, but neither side knows the other party's secret, nor does any eavesdropper know the value ofc^xy
. Here the mathematical foundation is that it is computationally infeasible to obtainx
fromc^x
, even if you nowc
.您可以在此处找到有关公钥加密的相当好的解释。这并没有详细介绍所涉及的数学,因为它非常复杂并且无法用简单的术语解释。您可能还想查看此相关问题的答案:
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: