GithubHelp home page GithubHelp logo

cryptochat's Introduction

cryptochat

npm

Encrypted P2P chat over ICMP (Internet Control Message Protocol).

I strongly advise you to pick a high-entropy encryption key to avoid the possibility of brute-force attacks.

Uses raw-socket for ICMP handling and terminal-colors to spice it up a bit.

Install and usage

Make sure you have node 0.10.x (tip: use n) and then install the package globally with sudo.

sudo npm install -g cryptochat

Three variants of cryptochat are available depending on your use case:

  • Send and receive messages

    $ sudo cryptochat <ip> <encryption_key>
  • Receive messages

    $ sudo cryptochat server <encryption_key>
  • Send messages

    $ sudo cryptochat client <ip> <encryption_key>

Because it relies on stdin for input, it is possible to use pipes to send data:

cat cryptochat.js | sudo cryptochat client <ip> <encryption_key>
bits 0-7 bits 8-15 bits 16-31
type = 0x08 code = 0x00 checksum
identifier sequence number
payload

The message data is attached as the ICMP payload.

Message

Messages are piped from stdin and split into payload packages, which are encrypted and sent as ICMP Echo requests. The payload size per request is currently set to 32 bytes. The first byte is the length of the message and the rest is the message itself.

The first request contains a salt and an initialization vector needed to decrypt the payloads.

byte 0 bytes 1-15 bytes 16-31
0x3e salt initialization vector

An "end" request is sent in order for the receiver to know when a message is completed. The end request has the following format:

byte 0 bytes 1-31
0x3e 0xffffffff...

When the end request is received, the full message is printed to the screen.

Contribute

As always, contributions are much appreciated.

cryptochat's People

Contributors

mateogianolio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.