Code Monkey home page Code Monkey logo

schat's Introduction

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

schat's People

Contributors

mattbechtel avatar john-vincent avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.