Skip to content
A simple chat RSA secured server and client full node js.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
client
server
.gitignore
README.md

README.md

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.

Install

Server:

cd path/to/project/server
npm install
node app.js

Client:

cd path/to/project/client
npm install
node client.js

Configuration

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.

Commands

Client has multiple commands, here is the list :

Help :
command : /help (command)
description : Displays the help text of a command. If no command provided (/help), displays all the commands and their help text.

Exit :
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.

Connect :
command : /connect serverIp:serverPort
description : Connects to the simple chat server (requires to load RSA first).

Disconnect :
command : /disconnect
description : Disconnects from simple chat server (requires to be connected first).

Timelog :
command : /timelog
description : Enable or disable display of time before messages.

Mute :
command : /mute
description : Enable or disable sounds in app.

Nick :
command : /nick newName
description : Request to server to change your nickname (requires to be connected first).

Join :
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).

Kick :
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.

Ban :
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.

Unban :
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.

Message :
command : Message to send
description : Send the message to your current room (requires to be connected and in a room).

Whisper :
command : /whisper nameOfUser Message
/w nameOfUser Message
description : Send a private message to the specified user (requires to be connected).

Wizz :
command : /wizz nameOfUser
description : Send a wizz to the specified user (requires to be connected).



#THANK YOU

Feel free to contact me if you need anything.

You can’t perform that action at this time.