Inspiration

I have been researching Cryptography a lot lately as I prepare for my next Cryptography class at school. I've always been security focused and have wanted to build my own secure applications.

What it does

At the moment.... Not much. Just a simple TCP/IP server (as of 09:51pm est).

How I built it

The application uses the Transmission Control Protocol (TCP) for communication between the client and the server. TCP is a connection-oriented protocol that ensures reliable and ordered data delivery, making it suitable for chat applications where messages need to be delivered in order and without loss.

Cryptography The application uses a combination of asymmetric and symmetric cryptography to secure the messages between the client and the server.

Asymmetric cryptography (ECC - Elliptic Curve Cryptography): When the client connects to the server, a key exchange is performed using the P-256 elliptic curve. Each party generates a public/private key pair and exchanges public keys. The client and server then calculate a shared secret using their private keys and the other party's public key. This shared secret is used as the symmetric key for further communication.

Symmetric cryptography (AES - Advanced Encryption Standard): Messages exchanged between the client and the server are encrypted using AES with a 256-bit key derived from the shared secret obtained during the key exchange. AES is a block cipher, which means that messages need to be padded to a multiple of the block size (16 bytes in this case). The application uses AES in EAX mode, which provides both confidentiality and integrity.

Password hashing: User passwords are hashed using the scrypt key derivation function before being stored in the SQLite database. The hash function is designed to be resistant to brute-force attacks, as it requires a significant amount of memory and processing power. A random salt is generated for each user and combined with their password before hashing, which helps protect against rainbow table attacks.

Challenges I ran into

I had trouble installing Signal's Network Protocol in python, I spent too much time trying to resolve the issue with the compiler so gave up and switched to another crypto package due to time constrains. I instead chose a different design for my encryption protocol implementations, I could have just used the ssl module, but I like to try new things I guess. For working solo I'm proud of how much I got done and learned!

Accomplishments that we're proud of

Learned a lot about new encryption/hash algorithms and even fell down the quantum rabbit hole (per-usual)

What I learned

There is many different python cryptography packages out there and options regarding algorithms, hash functions, digital signatures and emerging polymorphic/homomorphic cryptosystems. However regardless of the strength of a cipher/encryption algorithm, it's the implementation that makes it secure/insecure. This I found to be challenging as I often second guessed myself during the

What's next for Simple SecureChat

Continue building the application, connect to database and finish modeling the schema, and front-end work.

Built With

Share this project:

Updates