跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] 对于“公钥加密,私钥解密”有在 ssh 的 authorized_keys 这种常见的应用场景,那么“私钥签名,公钥验证”有什么常见的应用场景?

发表于
个人目的只是想从 应用使用的角度来理解,非对称加密、公钥私钥这些概念。

对于 ssh 的`authorized_keys`的应用使用过程为:
● 服务器检查 `authorized_keys` 文件,找到与客户端提供的公钥匹配的条目。
● 服务器生成一个随机数,并使用公钥对其进行加密,然后将加密后的消息发送给客户端。
● 客户端使用私钥解密该消息,并将解密后的随机数返回给服务器。
● 服务器验证返回的随机数是否正确。如果正确,服务器接受客户端的连接请求。
从这个过程,理解了"正因为客户端使用了私钥来解密,所以才能证明客户端的身份。",而且反过来,“私钥加密,公钥解密”是无法证明身份的。
自己也去 ssh 连接了多个服务器,查看了`authorized_keys`的内容。也看了客户端自己`~/.ssh/id_rsa.pub`。


那对于“私钥签名,公钥验证”,有什么应用场景是平时接触得到的?
- 而且最好有实物可以查看,帮助理解。
- 而且要是能有一个和我上面差不多的简单分析,就更好了。

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.