Encryption of Network Communications using JSSE Part 1: Introduction to Sockets

The Java Secure Socket Extension (JSSE) is an extension of the JDK which takes standard java sockets and adds a layer of encryption to them. It does this through the use of Secure Socket Layer (SSL) and Transport Layer Security (TLS) technologies. In a nutshell, this lets you transfer information over the internet without having to worry about anyone listening in, which is great for any number of client/server applications, and much more.

To understand what JSSE does, we first have to understand what a socket is, and what it does. A socket is basically just a virtual communication port that is used to transfer data between two machines. A socket on one machine connects to a socket on another machine and they can transmit data between each other. Super simple, right?

As we know, if data is sent over the internet it is susceptible to being intercepted by third parties. In order to protect our data from being read by those with malicious intent, we utilize JSSE to encrypt the data at the starting point, use sockets to transmit and receive that data, and JSSE again to unencrypt the data at the end point. This is done by utilizing public-key cryptography.

In public-key cryptography, each computer has two encryption keys, a private key that only it knows and a public key which is known by the other computer. Using our client/server relationship as an example, the client will have the client’s private key and the server’s public key. The public key is used to encrypt the data and, once encrypted, that data can only be decrytped by the server’s private key, thus even if a third party has the public keys, it cannot use them to retrieve the unencrypted data from the transfer.

Now that we have a basic understanding of sockets and encryption (a very, very basic understanding) we can start looking at actually using sockets to send information back and forth across a network. Look for part 2 of this series to start using sockets to transmit unencrypted data across a network, and further parts to add the encryption layer to that exchange.

Bryan Young
About Bryan Young
Bryan Young is a staff writer for WebProNews.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>