gpt4 book ai didi

ssl 应用程序数据零字节神话

转载 作者:太空宇宙 更新时间:2023-11-03 12:53:16 26 4
gpt4 key购买 nike

最近分析了几个SSL/TLS应用数据包,发现有些数据包在SSL/TLS应用数据包的最开头以固定的7个零字节开头,比较有意思。

TLS 1.2 application data example 1

TLS 1.2 application data example 2

不知道为什么会这样?直观上,加密消息应该由随机字节组成。

最佳答案

我认为这是 Galois Counter Mode 特有的特性。 Wireshark 所谓的“加密应用程序数据”在这种情况下是 GenericAEADCipher,它在 RFC 5246, section 6.2.3.3 中定义。并开始于:

opaque nonce_explicit[SecurityParameters.record_iv_length];

RFC 5288, section 3为 GCM 描述此字段:

Each value of the nonce_explicit MUST be distinct for each distinctinvocation of the GCM encrypt function for any fixed key. Failure tomeet this uniqueness requirement can significantly degrade security.The nonce_explicit MAY be the 64-bit sequence number.

nonce 不需要是随机的或不可预测的——但它绝对必须是唯一的(另请参见 this answer)。使用 TLS 记录序列号(而不是 TCP 序列号!)是确保一个连接内唯一性的好方法,因此 NSS,例如,遵循该建议(参见 lib/ssl/ssl3con.c,NSS 3.27.1 中的第 2148-2167 行和第 2994-3016 行)。

因此,在新的 TLS 连接开始时,随机数将只是一串零。请注意,在您的第二个屏幕截图中,最后一个字节已经是 01 - 大概是连接中的第二条记录。

关于ssl 应用程序数据零字节神话,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36061305/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com