Inspiration
Understanding the inner workings of the internet and low-level network programming. As well as, learning about data encryption to protect personal data.
What it does
Users are able to join a server, list online servers, send direct messages to each user.
Client encrypts sent messages.
Clients decrypt received messages.
Server receives and sends encrypted messages between clients.
How I built it
Client-Server architecture using TCP Sockets. Server listens for client sockets and creates a detached thread for each new client. Mutual exclusion is used to avoid colliding messages. Messages are encrypted using the RSA algorithm. Clients are created with a unique Public and Private key. In client, each character in a message is converted to its ASCII value and then encrypted into a cipher text. Cipher text is sent to server. Server sends to receiving client. Decrypted with private key and converted back to a character. Characters are strung into a readable message. Server only sees a string of numbers.
Sending a Message: Person A encrypts their message using Person B’s public key.
Reading a Message: Person B decrypts their message using Person A’s private key.
Challenges I ran into
Handling multiple clients with multithreading. Thread safety using mutual exclusion. Parsing sent data for commands and keys. Encrypting each character in message.
Accomplishments that I'm proud of
Working with low-level network programming. Handling multiple clients on a server. Creating a command system for users. Handling encryption keys between clients.
What I learned
Network programming with IP, ports, sockets. Multithreading and mutual exclusion. Encryption using RSA. Getting familiar with Linux and Bash.
What's next for Message-Encryption
I would like to implement group chat functionality to have multiple clients messaging. Currently, the encryption uses long long for its prime numbers which is much smaller than industry-standard numbers. Also, I would like to look into other encryption methods which are more efficient and suited for message encryption.
Log in or sign up for Devpost to join the conversation.