Encrypted Chat Room
As an extra Honors project in a cryptography course I took, I decided to pursue using my Raspberry Pi 5 to host a chat room, equipped with functional end-to-end encryption for user privacy. I used both Public Key cryptography and Private Key cryptography to perform different tasks. First, public key cryptography is used for verification of identity and to perform a key transfer. The transferred key is then used for AES to encrypt future messages. The reasoning behind this is that RSA is really good for encryption, but also fairly slow. So we can use the slow but secure RSA to perform a key transfer to use a faster system like AES. The key does need to be transferred securely, so something like RSA is needed to perform this initial step.
The project was designed in Python, using a library called PyCryptodome for all cryptographic functionality. I initially verified connections would work locally, then set up the server to run on my Raspberry Pi with some network configuration. The end result was a running server with chat session history that was encrypted with AES. A user could join after messages were sent and still see the chat history. In the future, I would like to redesign this project to implement a better UI than I had with a pure console application. This would also let me experiment more with setting up new users, instead of having just a set number of pre-defined users.
Some of the most interesting parts of this project were when I got to learn how to implement things such as "salt" for passwords. Without getting too in depth, passwords must be hashed to store them securely, and adding "salt" when hashing adds an extra layer of security. I was very glad I got to work with these concepts that I had taken for granted in the past. Learning how to implement these systems myself is important knowledge that I can take to any application I develop in the future.