about SSL, TLS some links
- 信息交换 不稳定 -> tcp, 不安全 -> TLS (confidentiality, integrity, authentication)
- PKI(Public Key Infrastructure) 参与者: CA, server, client agents(browsers, codes)
- 对称加密(symmetic encryption) 或 private-key encryption 或 secret-key 加密.
plaintext -> 加密算法(secret_key|null) -> ciphertext - 流式加密(Stream Cipher -> XOR)(RC4) vs 块加密 (Block Cipher) (AES)
- 加密 Hash 函数并不是一般的 Hash 函数. 不可逆, 少重样, 少碰撞. 指纹(fingerprint) 摘要(digest) SHA256;
- MAC (Message Authentication Codes): 这种 Hash 函数需要 key, 具有认证功能 -> HMAC (Hash-based Message Authentication Codes);
- 非对称加密 (Asymmetricencrpytion) 又称 public-key crpytography) 为了保密, 用对方的公钥发消息给他; 为了证明自己, 用自己的私钥发通知 (RSA 2048 bits ~~ 112 对称加密 bits);
- 数字签名算法: (先算出原文 Hash 值(长度短) + 一些元数据) -> 私钥加密 -> 签名;
- 随机数: (TRNG: True Random Number Generator) & (PRNG: Pesudorandom Number Generator);
- 加密(保证 confidentiality)和 MAC (保证完整性 integrity) 都需要 secret key, secret key 需要非对称加密保证交换.
- 顺序号(Sequence num) 和 结束字节 保证没有被重放或删除;
- 非对称加密保证了 key 的传输和认证;
如何分析一个证书的详细内容, 接受的加密算法:
https://www.ssllabs.com/ssltest/analyze.html?d=sourceforge.net
如何 debug SSL
https://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/ReadDebug.html
关于 jdk 支持的 SSL, TLS 版本
https://blogs.oracle.com/java-platform-group/diagnosing-tls,-ssl,-and-https
https://blogs.oracle.com/java-platform-group/diagnosing-tls,-ssl,-and-httpshttps://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/JSSERefGuide.html#HowSSLWorks
https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#ciphersuites
https://confluence.atlassian.com/stashkb/list-ciphers-used-by-jvm-679609085.html