267. Adding KEM to a TCP server/client application
In this problem, we attempt to write a TCP server/client application that communicates with each other via encrypted messages. The server side is referred to as the sender and the client as the receiver.
In this context, a sender can encrypt a message using its private key, and the receiver decrypts it using the sender’s public key. In case you didn’t recognize this scenario, then allow me to mention that we are talking about Authenticated Key Exchange (AKE) within Public Key Encryption (PKE) or, in short, about encrypting/decrypting messages based on the key exchange algorithms.
AKE within PKE is a popular choice, but it is not secure. In other words, AKE vulnerabilities can be speculated by quantum computers that are capable of altering most key exchange algorithms. JDK 21 can prevent such issues via the newly introduced KEM (https://en.wikipedia.org/wiki/Key_encapsulation_mechanism). This is a final feature...