SSL握手期间浏览器如何生成对称密钥
在典型的 https Web 场景中,我对浏览器和服务器之间的 SSL 握手有一个小困惑:
到目前为止,我所理解的是,在 SSL 握手过程中,客户端(在本例中为浏览器)使用公共加密随机选择的对称密钥密钥(从服务器收到的证书)。这被发送回服务器,服务器用私钥解密它(对称密钥)。现在,在会话的其余部分使用此对称密钥来加密/解密两端的消息。这样做的主要原因之一是使用对称密钥进行更快的加密。
问题
1)浏览器如何选择并生成这个“随机”选择的对称密钥?
2)开发人员(或/和浏览器用户)是否可以控制这种生成对称密钥的机制?
I have a small confusion on SSL handshake between browser and server in a typical https web scenario:
What I have understood so far is that in the process of SSL handshake, client (browser in this case) encrypts a randomly selected symmetric key with the public key (certificate received from server). This is sent back to the server, server decrypts it (symmetric key) with the private key. This symmetric key is now used during rest of the session to encrypt/decrypt the messages at both the ends. One of main reasons to do so is given as faster encryption using symmetric keys.
Questions
1) How does browser pick and generates this "randomly" selected symmetric key?
2) Do developers (or/and browser users) have control on this mechanism of generating symmetric keys?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里很好地描述了 HTTPS 如何实现连接建立工作。我将总结双方(客户端和服务器)如何获取会话密钥,这个过程称为“密钥协商协议”,这里它是如何工作的:
然后双方通过以下方式生成主密钥:
Here is a very good description of how HTTPS connection establishment works. I will provide summary how session key is acquired by both parties (client and server), this process is known as "a key agreement protocol", here how it works:
Then master key is produced by both parties in following manner:
引用网络视频上这段精彩的视频,分钟 1:18:07
注意:密钥是每个会话创建的。
Quoting from a this great video on network video, minute 1:18:07
Note: the keys are created per session.