Open source p2p share for devs to share anything with teammates across machines securely.

Overview

Secure share codecov Lint

Share anything with teammates across machines via CLI. Share is a tool for secure peer-to-peer connections, enabling direct communication and efficient exchange of secrets, files, and messages between machines with or without direct access to the internet.

Contents

Dependencies

  • bash, curl, tar: install these utilities.

Install

To use scs,

yarn add @onboardbase/secure-share # npm i @onboardbase/secure-share

Or, if you have rust on your machine:

cargo install scs

Or, using curl:

curl https://onboardbase.github.io/secure-share-sh/ | bash

Notes:

  • For Windows users, please use Git Bash or any other CLI with the Bourne Shell.
  • For users with Rust on their machines, ensure that $HOME/.cargo/bin directory is in your $PATH if you installed Rust with rustup. If not, please find the corresponding directory and add it to your $PATH. and then,
scs --help

You should get a response displaying the utilities for scs

Share anything with teammates across machines via CLI.

Usage: scs [OPTIONS] <MODE>

Arguments:
  <MODE>  The mode (send secrets, or receive secrets). e,g `scs send` or `scs receive`
Options:
  -s, --secret <SECRET>
          Separated list of secrets to share. The key-Value pair is separated by a comma. "my_key,my_value"
  -m, --message <MESSAGE>
          List of messages or a message string to deliver to the receiver. e,g -m "Hi there" -m "See me"
  -f, --file <FILE>
          List of file paths of files to deliver to the receiver. e,g -f "/path/to/file1" -f "../path/to/file2"
  -r, --remote-peer-id <REMOTE_PEER_ID>
          Peer ID of the remote to send secrets to
  -p, --port <PORT>
          Port to establish a connection on
  -d, --debug...
          Turn debugging information on
  -h, --help
          Print help
  -V, --version
          Print version

Usage

scs enables the transmission of secrets or messages between teammates using different machines and behind different networks. To share a secret, the sender and receiver must get scs as described above and follow the instructions below.

The receiver:

Open a terminal or cd to where scs was installed, then:

scs receive

scs starts in listen mode and assigns you a PeerId, and picks a random port to start on. (An optional -p flag is available to specify a port). A response like the one below should be displayed:

INFO  Your PeerId is: 12D3KooWA768LzHMatxkjD1f9DrYW375GZJr6MHPCNEdDtHeTNRt
INFO  Listening on "/ip4/172.19.192.1/tcp/54654"
INFO  Listening on "/ip4/192.168.0.197/tcp/54654"
INFO  Listening on "/ip4/127.0.0.1/tcp/54654"
INFO  Listening on "/ip4/157.245.40.97/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN/p2p-circuit/p2p/12D3KooWA768LzHMatxkjD1f9DrYW375GZJr6MHPCNEdDtHeTNRt"

The sender:

Obtain the PeerId of the teammate you wish to send a secret to, then:

scs send -r 12D3KooWA768LzHMatxkjD1f9DrYW375GZJr6MHPCNEdDtHeTNRt -s "hello, world"

scs will print your IP address and your PeerId. To verify that a connection was established and your machine can talk to your teammates, you should see a similar thing below in your terminal:

INFO  Your PeerId is: 12D3KooWRpqX3QUvPNHXW5utkceLbx2b1LKfuAKa3iLdXXBGB2bY
INFO  Listening on "/ip4/127.0.0.1/tcp/40479"
INFO  Listening on "/ip4/192.168.212.254/tcp/40479"
INFO  Established connection to 12D3KooWA768LzHMatxkjD1f9DrYW375GZJr6MHPCNEdDtHeTNRt via /ip4/157.245.40.97/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN/p2p-circuit/p2p/12D3KooWA768LzHMatxkjD1f9DrYW375GZJr6MHPCNEdDtHeTNRt

The sender then attempts to send the secret, and if it is successful, scs relays messages to both parties, notifying them of the status and the progress of the secret sharing session.

Files

scs also supports sending files:

scs send -r 12D3KooWLaLnHjKhQmB46jweVXCDKVy4AL58a4S4ZgHZGuJkzBf9 -f ../path/to/file1 -f path/to/file2

Messages

Ordinary messages can also be shared

scs send -r 12D3KooWLaLnHjKhQmB46jweVXCDKVy4AL58a4S4ZgHZGuJkzBf9 -m "hi there" -m "foo"

All three items can also be sent together.

Configuration

As of v0.0.12, scs allows a configuration file to be passed. Ports, whitelists, and items can all be configured directly instead of passing them as arguments. A sample configuration file can be found here. For example:

port: 5555 #An optional port defaults to 0 if not present
save_path: "default"
secret: # Optional during receive
  - key: foo
    value: bar
  - key: baz
    value: woo
message: # Optional during receive
  - new message from me
  - test message
file: # Optional during receive
  - "./dev_build.sh"
debug: 1 # Compulsory. 0 is for off, and 1 and above for on
blacklists:
  - 34.138.139.178
whitelists:
  - 34.193.14.12
connection: trusted # or self
seed: "scsiscool"
scs receive -c ./config.yml

Or for senders:

scs send -r 12D3KooWLaLnHjKhQmB46jweVXCDKVy4AL58a4S4ZgHZGuJkzBf9 -c ./config.yml

Whitelists/Blacklists IP addresses

Whitelisting and blacklisting control traffic from specified IPs. To enable this feature, add the IP list to the config file. If no whitelist IPs are provided, all connections are allowed. However, if whitelist IPs are specified, only traffic from those addresses is permitted. Generic IPs like 127.0.0.1 (localhost) or 192.0.0.0 (firewall access points) won't work.

Signed Certificate

Receivers can configure scs to only allow connections from users using a signed certificate from the CA. or just self-signed certificates. Add a connection: trusted or connection: self to the configuration file.

Seeds (Seed Key)

The backbone of scs is PeerId. A PeerId is a randomly generated key whenever a session is started for both the receiver and the sender. As of v0.1.3 of scs, PeerIds can now be deterministic; a single PeerId can be used for life. To do this, you need to set a "seed". The PeerId is generated concerning this seed. As long as the seed key remains the same, the PeerId will remain. The "seed" key is a string of any length lesser than 32. But for ease and optimal configuration, we recommend 4 or 5 letter words as in the above configuration file.

Saving Peer Info

To make using scs easier after the initial setup, scs implements a simple mechanism for storing recipients' information. After every session with a new peer, scs asks if you'll like to save the information of the connected peer. If you decide to send to that same peer, pass in the name of the peer to the -n argument like below

scs send -n dante -c config.yml

Note: For security reasons, we don't save the IP addresses of the connected peers on each machine.

To see all saved peers:

scs list

Items Storage Location

Items sent (secrets, files, and messages) are stored in the local folder on the machine. To find the saved items:

  • Windows: /c/Users/<name_of_user>/AppData/Local/onboardbase/secureshare/data
  • Linux: /home/<name_of_user>/.local/share/secureshare
  • Mac: /Users/<name_of_user>/Library/Application Support/com.onboardbase.secureshare

Contributing

Contributions of any kind are welcome! See the contributing guide.

Thanks goes to these contributors!

Roadmap

Protocols

  • AutoNat: If you look closely, scs assumes both peers are behind NATs, firewalls, or proxies. But sometimes, this might not be the case, and it is excessive to hole punch just for that. Implementing AutoNat will first check if the two peers can communicate directly. If not, it will then proceed to hole punch. With TCP, this might take about 3 to 10 seconds, and this is where QUIC comes in and improves upon scs's speed.

License

See LICENSE © Onboardbase

Technicals

The significant technical detail scs employs under the hood is P2P sharing. Below are excellent and detailed resources on P2P sharing and hole punching. Happy reading!!

Comments
  • Saving Recipients Info

    Saving Recipients Info

    This PR is the corollary to #5. The logical conclusion to being able to personalize a Peerid is saving that PeerId to enable reusability. For more information, please refer to the "Saving Recipients Information" on the Readme.

    opened by Lilit0x 1
  • Peer ID personalization

    Peer ID personalization

    This PR solves the issue of getting a random peer id. A peer id can now be deterministic by setting a value we call seed key in the config file. Check the readme for instructions.

    opened by Lilit0x 1
  • Fix: IP Address Validation

    Fix: IP Address Validation

    This PR aims to fix two bugs.

    • The current bug with IP address validation that prevents scs from sharing/receiving items. The image below shows the error. This issue happens because sometimes, an Incoming Message Event is not emitted before a connection is established. And since the connection_id is being set when this event occurs, during validation, the id can't be found because that event was not emitted. Registering a connection_id has been moved to after the connection has been established.

    image

    • Secondly, the npm bin package was not changed to reflect the new name scs
    opened by Lilit0x 1
  • Renaming Package to `scs`

    Renaming Package to `scs`

    This PR focuses on making scs formerly known as share available on crates.io while also replacing share with scs in all package registries that it was uploaded to. Documentation for also installing with cargo has also been added

    opened by Lilit0x 1
  • Allow to always listen to specific addresses for an accessible data flow.

    Allow to always listen to specific addresses for an accessible data flow.

    "always listen" to the person that sent it means, "I don't want ever manually to start a receiving session apart from the first-time configuration. I want to specify port 78089, and scs should always listen on that port".

    We will need to add scs as a system service. When the machine starts up, immediately start scs too. When it is about to shut down, close it too. A systemd service on *ix machines.

    opened by dantelex 0
  • Human readable ids

    Human readable ids

    Secure share could probably have less friction without a peerid using a readable link, for example, or just a human-readable id

    https://www.npmjs.com/package/human-readable-ids

    opened by dantelex 0
  • File Sharing: CLI

    File Sharing: CLI

    Sharing a file to a Windows machine causes share to time out the connection. Note that this issue is not only on Windows. All platforms seem to have the issue

    254028894-61ec781a-b861-4b20-8c2e-6cb8819aa2e1

    bug 
    opened by dantelex 0
Releases(v0.1.4)
Owner
Onboardbase
Open security infrastructure for developers to collaborate and ship securely.
Onboardbase
Open Protocol Indexer, OPI, is the best-in-slot open-source indexing client for meta-protocols on Bitcoin.

OPI - Open Protocol Indexer Open Protocol Indexer, OPI, is the best-in-slot open-source indexing client for meta-protocols on Bitcoin. OPI uses a fork

Best in Slot 33 Dec 16, 2023
A blazingly fast, ShareX uploader coded in Rust (using actix web) which utilizes AES-256-GCM-SIV to securely store uploaded content.

Magnesium Oxide ❔ What is this? Magnesium-Oxide (MGO) is a secure file uploader with support for ShareX. ?? Features ?? Blazingly fast uploads and enc

Nitrogen Development 26 Nov 25, 2022
Narrowlink securely connects devices and services together, even when both nodes are behind separate NAT

Narrowlink Narrowlink is a self-hosted platform that allows you to establish secure remote connections between devices within a network that may be hi

Narrowlink 355 Aug 17, 2023
A simple command-line application to securely store secrets using encryption

rust-secret-vault A simple yet robust command-line tool designed to safely encrypt and store your sensitive information. Harnessing the power of AES-2

Luis Soares 4 Nov 22, 2023
🧩Creating a blockchain wallet and integrating a couple of cryptographic algorithms to securely save the secrets.🧩

Rust Library For Cryptocurrency Wallet Folder Structure src : contains the source code of the library examples : contains some examples of the library

rstkey 3 Aug 12, 2024
A fully p2p cli chat utility written in rust.

P2P Chat Client This is a simple demonstration of a peer to peer chat client, written entirely in rust utilising the libp2p library. Demo On two seper

Josiah Bull 7 Dec 17, 2022
NAT Traversal techniques for p2p communication

P2P NAT-Traversal Crate Documentation Linux/OSX/Windows The goal of this crate is to provide a robust and crypto-secure NAT traversal for peer to peer

Spandan Sharma 123 Dec 24, 2022
A multiplexed p2p network framework that supports custom protocols

Tentacle Overview This is a minimal implementation for a multiplexed p2p network based on yamux that supports mounting custom protocols. Architecture

漂流 188 Dec 19, 2022
P2P Network to verify authorship & ownership, store & deliver proofs.

Anagolay Network Node Anagolay is a next-generation framework for ownerships, copyrights and digital licenses. ?? Local Development The installation a

Anagolay Network 5 May 30, 2022
Custom p2p swaps powered by Solana blockchain

Peer to peer, decentralized protocol which allow direct swaps between 2 network participants for custom tokens without liquidity pools on Solana blockchain.

Ilia 3 Mar 18, 2022
Biddi Network enables custom p2p swaps in Solana ocean 🌊.

Peer to peer, decentralized protocol which allow direct swaps between 2 network participants for custom tokens without liquidity pools on Solana blockchain.

Biddi Network 2 Nov 1, 2022
Low-level Bitcoin P2P Network Client

Peerlink What is Peerlink? Peerlink is a low-level network client for the Bitcoin P2P network written in Rust. It uses a nonblocking reactor to accept

Alfred Hodler 6 Dec 23, 2022
Ethereum (and Ethereum like) indexer using P2P message to fetch blocks and transactions

Ethereum P2P indexer This project is an indexer for Ethereum and Ethereum forks. It takes advantage of the ETH (Ethereum Wire Protocol) to fetch block

null 5 Nov 10, 2023
An extensible open-source framework for creating private/permissioned blockchain applications

Exonum Status: Project info: Community: Exonum is an extensible open-source framework for creating blockchain applications. Exonum can be used to crea

Exonum 1.2k Jan 1, 2023
HyperCube is a free and open source blockchain project for everyone to use.

XPZ Public Chain HyperCube is a free and open source blockchain project for everyone to use. 日本語 简体中文 正體中文 HyperCube Wiki Wha is HyperCube HyperCube i

null 949 Dec 31, 2022
Crates - A collection of open source Rust crates from iqlusion

iqlusion crates ?? This repository contains a set of Apache 2.0-licensed packages (a.k.a. "crates") for the Rust programming language, contributed to

iqlusion 335 Dec 26, 2022
CKB's vm, based on open source RISC-V ISA

Nervos CKB VM About CKB VM CKB VM is a pure software implementation of the RISC-V instruction set used as scripting VM in CKB. Right now it implements

Nervos Network 297 Jan 3, 2023
Open source Rust implementation of the Witnet decentralized oracle protocol, including full node and wallet backend 👁️🦀

witnet-rust is an open source implementation of the Witnet Decentralized Oracle Network protocol written in Rust. Components witnet-rust implements ma

The Witnet Project 155 Nov 21, 2022
Outp0st is an open-source UI tool to enable next-level team collaboration on dApp development over Terra blockchain

Outp0st is an open-source UI tool to enable next-level team collaboration on dApp development over Terra blockchain

Genolis 2 May 4, 2022