MTco / schat

Secure Peer-to-Peer chat shell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Initial Setup

Before using SChat, please install nodeJS version 11 or greater. Once nodeJS is install, please clone https://github.com/John-Vincent/schat.git, to begin using SChat. Once cloned, step into schat/src/schat and run ‘npm install’ to install schat’s dependencies (we use native node so these will just be local directories in schat/src/). Once the installation you may use SChat. Start by running ‘./schat --help’, this will print information relative to SChat’s functionality.

Command Descriptions

  • “--help”
    • Prints help information about all commands for SChat
  • “key-gen”
    • By default schat will use the set of keys 'priv_key' and 'pub_key' in the ~/.schat directory. If this key pair does not exist you must run this command to generate the private-public RSA key pair and write it to the ~/.schat directory for usage in future schat chatting sessions. If previously ran, this will replace the old key pair that was generated, meaning that if you want to save generated keys elsewhere, you must move them yourself. When a chat is started, without a key pair specified (default usage), schat will use the key pair generated by this command, i.e the key pair stored in ~/.schat.
    • If you wish to use temporary keys, please use the flag '--temp-keys'
    • Example: 'schat key-gen'
  • “start-chat”
    • Default Usage: Start a chat with another user. Example 'schat start-chat IP'. Here, IP is the IP of the user you wish to chat with. By default, this will try and create an schat connection with the IP on the default port 4567. To change the port of the user you wish to connect to just specify it after a colon, like this, IP:PORT. Example: 'schat start-chat IP:PORT'
    • Specify the port you wish to serve schat on
      • --port [PORT]
      • Example: 'schat start-chat 127.0.0.1 --port 4567'
    • Specify keys to use for encryption:
      • "--priv [FILEPATH]" (your private key)
      • "--pub [FILEPATH]" (your public key)
      • "--fpub [FILEPATH]" (specify public key for user you which to connect to)
      • Example: 'schat start-chat IP --priv ~/.schat/id_rsa --pub ~/.schat/id_rsa.pub --fpub ~/.schat/alices_key.pub'
    • Download foreign public key from chatting partner for future use
      • "--save-fpub [FILEPATH]"
      • Example: 'schat start-chat IP --save-fpub ./pathToSaveTo'
    • Use temporary key pair
      • "--temp-keys"
      • Example: 'schat start-chat IP --temp-keys'"

Example Test Usage

To test SChat, here are some commands examples you can run locally

#Generate keys to use first
schat key-gen

#Start a chat locally
#Open two terminal instances in the schat/src/schat directory

#This will run SChat on the default 4567 port
#while connecting to the other instance of SChat on port 7654
#Chat should be started, send messages
./schat start-chat 127.0.0.1:7654

#Open second terminal instance in the schat/src/schat directory
#This will run SChat on port 7654 in this instance
#Start a chat locally with a specific local key pair
./schat start-chat 127.0.0.1 --port 7654 --priv ~/.schat/priv_key --pub ~/.schat/pub_key

#This will connect to given IP:PORT with local keys provided and the specified foreign key. 
./schat [IP:PORT] --priv [FILENAME] --pub [FILENAME] --fpub [FILENAME]

#This command will connect to IP:PORT using a temporary key pair (just for this session) 
#and will download the peers public key for future use to the file provided. 
./schat [IP:PORT] --temp-keys --save-fpub [FILENAME]

#This command will connect to ‘alice’ at IP:PORT using ‘her’ (a specified) public key. 
#If both users have already exchanged foreign public keys, and 
#load the keys from the file then there is no man in the middle vulnerability, 
#thus here we can guarantee confidentiality. 
./schat IP:PORT --fpub ~/.schat/alices_pub_key

About

Secure Peer-to-Peer chat shell


Languages

Language:JavaScript 100.0%