File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -422,7 +422,7 @@ def makeKeyFiles(name, keySize):
422422
423423确保没有人侵入你的电脑并复制这些关键文件。如果他们获得了你的私人密钥文件,他们就能解密你所有的信息!
424424
425- # ## 调用 main()函数
425+ # ## 调用` main()` 函数
426426
427427在程序结束时,如果`makePublicPrivateKeys.py` 作为一个程序运行,而不是作为一个模块被另一个程序导入,第 73 和 74 行调用`main()` 函数。
428428
Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ def isPrime(num):
275275 return None # No factors exist for num; num must be prime.
276276```
277277
278- 如果我们编写一个公钥密码黑客程序,我们可以只调用这个函数,将` n ` 传递给它(我们将从公钥文件中获得),并等待它找到因子` p ` 和` q ` 。然后我们可以找到` (p – 1) × (q – 1) ` 是什么,这意味着我们可以计算` e mod (p – 1) × (q – 1) ` 的 mod 逆 ,以获得` d ` ,即解密密钥。那么计算明文消息` M ` 就容易了。
278+ 如果我们编写一个公钥密码黑客程序,我们可以只调用这个函数,将` n ` 传递给它(我们将从公钥文件中获得),并等待它找到因子` p ` 和` q ` 。然后我们可以找到` (p – 1) × (q – 1) ` 是什么,这意味着我们可以计算` e mod (p – 1) × (q – 1) ` 的模逆 ,以获得` d ` ,即解密密钥。那么计算明文消息` M ` 就容易了。
279279
280280但是有一个问题。回想一下,` n ` 是一个大约 600 位数的数字。Python 的` math.sqrt() ` 函数不能处理这么大的数字,所以它会给你一个错误消息。但是,即使它能够处理这个数字,Python 也要执行那个` for ` 循环很长时间。以为例,即使你的计算机从现在开始继续运行 50 亿年,它仍然几乎没有机会找到` n ` 的因子。这些数字就是这么大。
281281
You can’t perform that action at this time.
0 commit comments