Skip to content

A simple chat RSA secured server and client full node js.

Notifications You must be signed in to change notification settings

Chupsy/simpleSecuredChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A simple chat RSA secured server and client full node js.

Resources

Stars

Watchers

Forks

Packages