Simple secured chat
This is a simple RSA secured socket.io chat with server and client in node.js.
Server is working in socket.io with RSA key refreshing every 10 seconds. Every client is authenticated with their RSA. Each exchange between server and client or between a client and another client is first encrypted by client with server RSA, then server decrypts and encrypt with receiver RSA.
John === Encrypt with server RSA ===> server === Encrypt with Jane RSA ===> Jane
Client is also in node.js using Blessed ui.
cd path/to/project/server npm install node app.js
cd path/to/project/client npm install node client.js
For server configuration in config.json, you can modify port and RSA key length (128, 256, 512, 1024...).
For client configuration in config.json, you can modify the maximum of lines displayed in the client.
Client has multiple commands, here is the list :
command : /help (command)
description : Displays the help text of a command. If no command provided (/help), displays all the commands and their help text.
command : /exit
description : Leaves the app
Load RSA :
command : /loadRSA (path/to/rsa/private/key)
description : loads the RSA private key. If none provided, will generate one.
command : /connect serverIp:serverPort
description : Connects to the simple chat server (requires to load RSA first).
command : /disconnect
description : Disconnects from simple chat server (requires to be connected first).
command : /timelog
description : Enable or disable display of time before messages.
command : /mute
description : Enable or disable sounds in app.
command : /nick newName
description : Request to server to change your nickname (requires to be connected first).
command : /join roomName
description : Request to server to join a room (requires to be connected first). If the room does not exist, a room will be created and you will be set admin of this room.
Set Admin :
command : /setAdmin nameOfUser
description : Sets user as admin of the room (requires to be connected first, in a room and admin of the room).
command : /kick nameOfUser
description : Kick user from the room (requires to be connected first, in a room and admin of the room). He can come back to the room.
command : /ban nameOfUser
description : Ban user from the room (requires to be connected first, in a room and admin of the room). He will no longer be able to join the room.
command : /unban nameOfUser
description : Unban user from the room (requires to be connected first, in a room, admin of the room). He will be able to join the room again.
command : Message to send
description : Send the message to your current room (requires to be connected and in a room).
command : /whisper nameOfUser Message
/w nameOfUser Message
description : Send a private message to the specified user (requires to be connected).
command : /wizz nameOfUser
description : Send a wizz to the specified user (requires to be connected).
Feel free to contact me if you need anything.