Java Securing network traffic
<p>First of all, I have googled how to secure network traffic and I have found a lot of answers... Only the issue is that I've found too many examples/methods and the majority of the them is very old (> 10 years), so it worries me a little bit.</p>

<p>What I want to know is: How can I encrypt network traffic between a server and a client?</p>

<p>I have had a bachelor degree class about it and from what I understand, I need a private-public key pair to encrypt and decrypt. However I may have missed some important notion, because I've got this question currently about that: How can I send the key over the network when that key is the key with which you need to secure the network? Do I even have to deal with it, or are there built-in applications of secure networking in Java?</p>

<p>What I also have seen in class was that the instructors needed to manually verify some keycodes to be 100% sure that some person was sending a message (manually as in looking at someone elses screen and comparing the keys to see if they were indeed the same).</p>

<p>I am using Sockets currently (not sure if networking can even be done differently in java), and I would like to know how I can achieve secure networking?</p>

<p>Any links to relevant material are appreciated, preferably I want to know the best solution if there happens to be any. If the link/article is dated, then please justify that it can still be used after 5 or 10 years.</p>

<p>Regards.</p>
