NanoChat

NanoChat is a peer-to-peer , end-to-end encrypted and discoverable chat application that can be used inside command line. It is totally server-less and every peer can discover other peers in the same subnet without having the network address of them in advance.

It can be compiled and works on both linux and OSX system platforms.

How to use

Call nanochat with desired flags. In order to see the list of available flags, use --help as follows:

NanoChat help ------------- Avaliable flags: Help: -h --help Host IP: -H --host {host IP} Broadcast IP: -B --broadcast {broadcast IP} RPC Port: -P --port {port} Discoverable: -d --discoverable Secure: -s --secure --host {host IP} flag is used to specify the network interface IP which you want to use. By default it is selected by NanoChat. --broadcast {broadcast IP} flag is used to specify the network interface broadcast IP which you want to use. By default it is selected by NanoChat. --port flag is used to specify the RPC port which is listening to answer chat requests after creating the requested chat room. Its default value is 1991 . --discoverable flag is used to let NanoChat to be disovered by other peers, otherwise it doesn't answer to discovery packet and remains hidden from others. --secure flag is used to make NanoChat secure for end to end message encryption with asymmetric/public-key cryptography.

In order to see available commands inside NanoChat use /help command as follows:

$ nanochat --discoverable NanoChat shell was started. >> /help Available commands: /help prints this text /probe find online peers /list peers list online peers /list rooms list availabe rooms /connect {host} {port} connect to remote client /attach {room} attach to room /quit quit nanochat console >> ... /probe command discovers the subnet for other online NanoChat peers. /list peers command list discovered online peers' host and port address. /list rooms command list available rooms. /connect {host} {port} command connects you to other peers. /attach {room} command is used to enter to a created room by other peers. /quit command closes the NanoChat console. Installation

NanoChat uses GNU Autotools . So you need to have them installed in your system. Also it needs GCC or Clang , GNU Make and GNU Readline library. Other dependencies are included in the NanoChat/lib directory and will be compiled and linked with autotools automatically. So there is no need to get and build it manually.

Debian dependencies: $ apt-get install gcc make automake autoconf libreadline-dev Fedora dependencies: $ yum install gcc make automake autoconf libreadline-devel OSX dependencies: $ port install gcc make automake autoconf readline

After making sure that your system has required dependencies, clone the repo and follow installation steps:

$ git clone https://github.com/hamidreza-s/NanoChat.git $ cd NanoChat $ autoreconf -i $ ./configure $ make && make install ... ============================================================= | NanoChat was successfully installed ------------------------------------------------------------- | NanoChat was installed in /usr/local/bin directory. | Just type 'nanochat --help' there to get started. =============================================================

Now nanochat executable file is accessible in the path of your shell.

How it works

My main purpose for writing NanoChat is learning things, so I think it is good to know for you how it works and what tools and protocols it uses.

For discovering other online peers in the same subnet it uses raw UDP broadcasting. For inter-node communication it uses some libnanomsg scalibility protocols, for instance REQREP protocol for RPC and PAIR for one to one chat. For user's input/output multiplexing it uses select POSIX-compliant syscall. For storing user's information it uses libvedis embedded datastore engine. For line-editing and history capabilities of commands it uses libreadline . For end to end encryption it useslibsodium public-key cryptography. For message serialization it useslibparson which is a JSON parser. For encoding and decoding encrypted messages before sending over wire it uses base64 codec. Contribution

Comments, contributions and patches are greatly appreciated.

License

The MIT License (MIT).

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

主题: P2PRPCDebianLinux
分页:12
转载请注明
本文标题:A P2P, E2E encrypted and discoverable chat application on top of nanomsg library
本站链接:http://www.codesec.net/view/479783.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(61)