/secure-chat

Primary LanguageJavaScriptMIT LicenseMIT

secure-chat

Secure Instant Point-to-Point (P2P) Messaging using Node.js and Socket.IO

Run

  1. git clone https://github.com/chanyoonzhu/secure-chat.git
  2. cd secure-chat
  3. npm install
  4. mongod
  5. mongo < models/db.js
  6. npm run start
  7. http://localhost:3000 in your browser
  8. username and password:
username password
Alice Security1sF*n
Bob Security1sF*n

Todo

  • crypto https://nodejs.org/api/crypto.html
    • log in using passphrase (done)
    • generate key using passphrase
    • padding strategy
    • message encryption with 56-bit key
    • display both cipher and plaintext
    • bonus: periodically update the key (done)
  • image messaging serve image
  • file messaging serve file

References

Features

  • periodically update the key The server, upon startup, periodically creates a random number, which is immediately sent to all connected clients. When the random number arrives, the clients update this number stored in their local storage. In this way, all connected clients would store the same number at any given time (theoretically). Whenever a client sends a message, s/he uses a key generated by the passphrase and this random number combined to encrypt the message, and the client on the other side decrypts it using the same key.