Secured Chat Application

Crypto / bit-transfer / Modern Encryption

End-to-End Encryption with AES

    Key Generation and Management
  • Each user should have a unique encryption key. Use a secure method like RSA to exchange AES keys between users.
  • Use a secure key derivation function like PBKDF2, bcrypt, or Argon2 to derive AES keys from a user password if necessary.

encryption

Message Authentication:

  • Use message authentication codes (MACs) or authenticated encryption (like AES-GCM) to verify the integrity and authenticity of each message.
  • Ensure that any tampering with the ciphertext is detectable and results in message rejection.

encryption

Message Encryption

    When a user sends a message, the app should:
  1. Generate a random IV or VI for the code.
  2. Encrypt the message using the AES key.
  3. Send the encrypted message, to the friend.

encryption

Message Decryption

    Upon receiving a message, the app should:
  1. Extract the IV or VI and encrypted message.
  2. Decrypt the message using the IV or VI .
  3. Display the decrypted message to the user.

decryption

Secure Storage

  • Store keys and sensitive data in a secure enclave or use OS-level secure storage mechanisms.
  • Encrypt any locally stored messages or user data using AES before saving it to disk.

encryption

Forward Secrecy

  • Implement a mechanism for rotating keys periodically or on a per-message basis.
  • Use ephemeral keys for key exchanges to ensure past communications cannot be decrypted even if long-term keys are compromised.

encryption