Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Secure socket connection

Tags:

java

sockets

I'm working on a school project with a server application that holds centralized data, and client applications that hold cached data that will be synchronized with sockets. Everything is written in Java.

What is good practice? How can I stop people from listening to my traffic? Or prevent people to understand what is said?

like image 785
hogni89 Avatar asked Sep 17 '11 03:09

hogni89


2 Answers

You simply use SSLSocketFactory instead of SocketFactory for your client server application. That way, the communication between the two will be totally encrypted. You can secure your client server app in less than a day, if you know basic Java. Here's a tutorial.

like image 52
RHT Avatar answered Oct 13 '22 04:10

RHT


SSL is the standard practice. See the javax.net.ssl package, and the JSSE Reference Guide. But this may be beyond the scope of your project or your abilities at this stage. Check with your instructor.

like image 37
user207421 Avatar answered Oct 13 '22 04:10

user207421