Many popular messaging systems like Twitter have been exposed lately for using user information unethically. I wanted to make my own completely self hosted chat.

What it does

It is a database, server, and client software. It lets someone have complete control over what happens to data between clients. It is also encrypted so information will not get stolen. Allows any number of users.

When a user opens the client. It pops up a login GUI. If the user enters the correct info, the server will validate it and log the user in. After that a text chat GUI pops up allowing real time encrypted text messaging.

How I built it

I used mysql for the database set up. I made the server in java and connected it to the database using jdbc drivers. I made the client in java and fxml. Java to connect to the server and fxml to make it look nicer than terminal, GUI. For encryption, it uses a java library called jasypt.

Challenges I ran into

Encryption and decryption caused many issues. Because encryption changes the message length, I had to have the length of the message added on. I had to convert anything I wanted to send back and forth into a byte array for the encoding to work.

Accomplishments that I'm proud of

Just about everything. This was the first time setting up a database on my own machine which was nice. I never tried making a server that allowed multiple connections before, so figuring that out was satisfying. I have never attempted encryption before. I'm proud I figured out how to do that and send it over sockets without being unreadable. I'm proud I finished the basics of it fast enough to have a simple login and chat GUI.

What I learned

I learned how to make a multithreaded socket server, and I learned how to encrypt and decrypt the data being sent across.

What's next for PIChat

I am close to being done with a GUI for allowing people to make multiple chats and leave/join them. Multiperson chats are currently supported but only if I manually add people to the chat room in the database. I am also planning on adding functionality to make it optional to save the message to the server. The message can either be sent through the server with its own encryption key the server does not know without being saved by the server, or it can be saved and passed by the server. After that the goals are images and voice. Much later, after a GUI redesign, I plan to make an android app and webpage to connect.

Built With

Share this project: