/SecureChat

Primary LanguageJava

SecureChat GitHub top language GitHub release (latest by date) GitHub Release Date GitHub all releases GitHub issues GitHub

SecureChat is an Android chat app that sends messages that are encrypted with PGP encryption.

The app uses Firebase's realtime database as a server, and SQLite as a local database.

HOW encryption works

User A sends a message to user B

  1. a copy of the plaintext message (before encryption) is saved into user A's local database
  2. the message gets encrypted with user B's public key
  3. the encrypted message is sent to the server (firebase realtime database)
  4. user B gets the encrypted message and decrypts it with his private key
  5. user B saves the decrypted message into his local database

That way no one is able to read the message except for user B even the sender cannot decrypt his own messages (that's why a copy of the plaintext message is saved before the encryption).

Generating public & private keys

For the first time a user is logged in using a device the app generates his public & private keys and saves them into the user's local DB and upload the public key to the server (Firebase) so other users can send encrypted messages to him using his public key.

When a user is logged-in in the future, the app checks his local DB for his public & private keys

  • If found then the app compares the public key from the local DB with the one in the server (Firebase)
    • if both are the same then everything is good
    • if not then the app uploads/update the one on the server with the one found locally
  • If not found then the app generates new ones and upload the public key to the server (Firebase)

Credits

SCREENSHOTS

Main login screen Generating PGP Account_Settings Chats Messages Find_Friends Friend_Requests