ssl - 非RSA TLS1.2数据包解密

标签 ssl encryption ffmpeg cryptography tls1.2

我正在尝试解密一个 pcap 文件。此 pcap 文件包含 HLS 加密视频流的捕获。 pcap 包含 TLSv1.2 数据包。

下面是pcap文件的一些信息

Server Hello message Cipher Suite:

TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384.

EC Diffie-Hellman server Params: pubkey (1)

证书状态消息:

Signature Hash Algorithm Hash: SHA256

Signature Hash Algorithm Signature: ECDSA

Client Key Exchange Message

EC Diffie-Hellman server Params: pubkey (2)

我试着按照 [这个 Wireshark SSL 解密教程][1]。但它似乎只适用于 RSA 加密。 我研究了一段时间并找到了 [this discussion][2]。我引用了这个讨论的摘录:

There is an important parameter to mind: decryption of a passively recorded session (with a copy of the server private key) works only if the key exchange was of type RSA or static DH; with "DHE" and "ECDHE" cipher suites, you won't be able to decrypt such a session, even with knowledge of the server private key. In that case, you will need either the negotiated "master secret", or to use the server private key to actively intercept the connection

值得注意的是,我有客户端私钥。在我的例子中,客户端是 FFmpeg video streamer (FFplay)。我还查看了 [TLS v1.2 RFC][3]。

我的问题:

在这种情况下是否可以进行解密?如果是,我需要做什么才能这样做?

解密是使用客户端的私钥还是使用 pre_shared_master(即 Diffie-Hellman)完成的? [1]: https://wiki.wireshark.org/SSL [2]:https://security.stackexchange.com/questions/117778/how-to-decrypt-ssl-traffic-with-a-packet-sniffer-when-i-have-the-private-key [3]:https://www.rfc-editor.org/rfc/rfc5246

最佳答案

首先,客户端私钥或公钥不以任何方式参与 key 交换,仅用于验证客户端(如果服务器请求)。 key 交换中使用的是服务器 私钥和公钥,但前提是使用 RSA key 交换。对于 DHE/ECDHE,它们未被使用,因此私钥/公钥是不够的。参见 it is possible to decrypt HTTPS with the (private, public) pair if it uses DHE?有关为什么会这样的详细信息。

您需要的不是私钥,而是交换的 key ,即使私钥相同,该 key 对于每个 TLS session 都是唯一的。一些客户端可以存储此 key 供以后使用,如果您的客户端可以,请参阅 Decrypting TLS Browser Traffic With Wireshark – The Easy Way!然后如何解密流量。

关于ssl - 非RSA TLS1.2数据包解密,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41227491/

相关文章:

java - 来自 Java 客户端的 SSL 连接

ssl - 带 SHA1 的 TLSv1.2?

c - LZ压缩技术

c# - 无法使用 FFmpeg 解码 H.264 流(附件 B)

c++ - Boost.Asio async_handshake 无法取消

facebook - Facebook 是否信任嵌入式视频播放器的 StartSSL Class 1(免费)证书?

video - 无法使用ffmpeg从视频中提取mp3音频

FFMPEG 将多个音频输入文件映射到 1 个单个图像文件,以便创建多个视频输出文件

java - 使用 AES/CTR 模拟流密码

java - 为什么信任 anchor 不应包含在 PKIX 认证路径中?