A django based chat application where you can send messages encrypted using RSA algorithm.
Make sure you install all dependencies first. Open the project directory and run the following commands:
pip install django
pip install channels
pip install channels-redis
pip install redis
Setting up the database:
python manage.py makemigrations
python manage.py migrate
Run the local server using the command
sudo docker run -p 6379:6379 -d redis:2.8
python manage.py runserver
You can set up your account by entering details in the registration form.
After you sign up, it takes you to the login page where you can enter your credentials and log in.
After successful login, it takes you to the home page. This application provides 2 main features.
- Creating Chatrooms - private/public
- Joining Chatrooms
It also displays the registered users.
Click on the Create Room button and then enter the room name. You can create private/public rooms.
For private rooms, it needs a password
The below image shows the room page and you can enter your message inside the box provided on the right side. Once the message has been typed, you can click on the Encrypt button to encrypt your message. You can perform encryption using different sized keys(128 bits, 256, 512, 1024, 2048)
The encryption process can be seen on the terminal output. It generates a public key and encrypts your message using it.
You can open up an incognito window and login with another user's credentials and join the same room. When the other user finishes encryption, he can hit the SEND ENCRYPTED MESSAGE button to send the encrypted message. The user on the incognito window can hit the DECRYPT button to create a private key using the public key with which the message was encrypted and can decrypt the message.
The other user gets the public key used along with the enciphered text.
On clicking the DECRYPT button, it takes us to this page
You can view the decrypted message here
All the messages which have been decrypted are stored in a chat log.