且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

丢失SSL证书的后果

更新时间:2023-02-05 23:20:31

Presumably, you're not talking only about losing the certificate, but having its private key compromised.

In this case, someone in possession of the private key could perform a MITM attack, provided that they're also in a position to do so.

I'll clarify my question, does using the same public and private key pair by user and the attacker lead to generation of same symmetric key every time or the key pair is used to generate a random symmetric key for every communication channel, in which case man in the middle attack is prevented

Random symmetric keys are generated for every connection (unless SSL/TLS sessions are re-used, but that's more about optimisation, distinct clients or connections done after a certain period of time will have distinct symmetric keys). Having new symmetric keys every time certainly doesn't prevent MITM attacks on its own, since the negotiation of new symmetric keys is authenticated with the certificate: that's what prevents MITM attacks.

If you're really worried about your private key being copied from your machine, you could use an HSM module (Java supports PKCS#11).

This being said, since you seem to assume that there can be someone in a position to perform a MITM attack on your machine, using a communication between two processes on the same machine, it sounds like you're assuming your machine is compromised. In this case, your chances of success in using SSL/TLS to protect whatever you're trying to protect are limited. It sounds like there's a bigger problem with the general approach.

相关阅读

技术问答最新文章