TLSPARAMS

来源:互联网 发布:光洋plc编程手册 编辑:程序博客网 时间:2024/06/10 22:19

Transport Layer Security (TLS) Parameters @ietf @iana

SSL/TLS CipherSuite 介绍

In SSL, the key exchange, symmetric encryption and MAC algorithm are all grouped together into a single aggregate notion called a cipher suite.

Before TLS version 1.3, a cipher suite is a named combination of authentication, encryption, message authentication code (MAC) and key exchange algorithms used to negotiate the security settings. The format of cipher suites is modified since TLS 1.3. In the current TLS 1.3 draft document, cipher suites are only used to negotiate encryption and HMAC algorithms.

Cipher Suite 构成

每个 CipherSuite 分配有 2 字节的短整型来标识,TLS Cipher Suite Registry 定义了 Value 对应的 Description:

Value Description DTLS-OK Reference 0xC0,0x2F TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 Y [RFC5289]
CipherSuite TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256    = {0xC0,0x2F};

可参考 macOS/iOS 的 Security.framework/CipherSuite.h 中定义的 CF_ENUM(SSLCipherSuite)

每个 Cipher Suite 是由4个算法原语组合而成:

  • Key Exchange (Kx):密钥交换协商协议。主流有两种:DH 和 ECDH。

    自从斯诺登爆料了 NSA 的 HTTPs 破解方案以后,现在的密钥交换算法,普遍流行 PFS(Perfect Forward Secrecy),把 DH, ECDH 变成 DHE,ECDHE 。

  • Authentication (Au):非对称认证算法,常见有三种:DSA/RSA/ECDSA。

    目前最主流的是 RSA ( 2048 bit 及以上);ECDSA 是新兴趋势,例如 gmail,facebook 都在迁移到 ECDSA;DSA 由于只能提供1024bit,已被建议禁用。

  • Encryption(Enc):对称加密算法,主流趋势是使用 AES

    其他的有:DES(已被淘汰);RC4(不建议使用);3DES(不建议使用);Camellia(貌似日本人搞的) 等。

  • Message Authentication Code(MAC):消息认证码算法,主流有 SHA1、SAH256、SHA384 等。

    TLS 中使用了 HMAC 模式,而不是原始的 SHA1、SHA256 等;google 已在淘汰 MD5 了。

通过 openssl ciphers -v 命令可以列举 OpenSSL 支持的所有 ciphers:

openssl-ciphers-v

参考

How do browsers negotiate SSL/TLS connection parameters?
What is ECDHE-RSA?
What’s the GCM-SHA 256 of a TLS protocol?
decompose cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
Proposal to Change the Default TLS Ciphersuites Offered by Browsers
TLS 1.2 handshake problem?
TLS Version specific cipher suites

密码学笔记 密码学一小时必知
数字签名和数字证书 数字证书的基础知识

公钥、秘钥、对称加密、非对称加密总结
和安全有关的那些事

现代密码学实践指南 byronhe@tencent
TLS协议分析 与 现代加密通信协议设计 byronhe@tencent

原创粉丝点击