• Stars
    star
    5,091
  • Rank 8,085 (Top 0.2 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created over 13 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An encrypted IPv6 network using public-key cryptography for address allocation and a distributed hash table for routing.

cjdns

Русская версия Hrvatski Svenska Ελληνικά Deutsch 繁體中文 简体中文 Español Français Português brasileiro

Networking Reinvented

Cjdns implements an encrypted IPv6 network using public-key cryptography for address allocation and a distributed hash table for routing. This provides near-zero-configuration networking, and prevents many of the security and scalability issues that plague existing networks.

Build Status CII Best Practices tip for next commit irc License

Testimonials

23:26 <@jercos> well, cjdns is now officially more reliable than the open
                internet for getting to my cheaper VPSes :|

12:52 < mariner> so i don't know if it's been done before, and i assume it's
                 obvious, but I think it's neat. Currently on hype from an
                 airplane

00:36 < tester> man sites take so long to load on i2p
00:36 < tester> i value speed over anonymity any day

<DuoNoxSol> it's notably more reliable than the normal internet

09:46 < Kubuxu> I so love cjdns code base

<whyrusleeping> my internet is way better now.
<whyrusleeping> thanks
<whyrusleeping> i'm really upset and sad that its better
<whyrusleeping> but also quite happy

21:01 <@grewalsat> this is amazing. with my workpalce speedtest.net results I get around 6+mb speed, and with my cjdns-gate as vpn network I'm getting like 11-15mb download speed in speedtest.net
21:01 <@grewalsat> :P
21:01 <@grewalsat> plus, access anything! :D

<davidar> Yeah, I have to admit I sort of avoided hypeirc because of stuff like that

Community

Documentation

Advanced configuration:

Thank you for your time and interest,

The cjdns developers.


How to install cjdns

These instructions are for Debian-based Linux distributions and macOS. They should be informative enough for use on other distributions - just don't expect them to work verbatim. If you want to know what operating system's base is go here.

0. Install dependencies

You must have Rust/Cargo, see: https://rustup.rs/ for information about how to install.

If you have Node.js installed, the build will be slightly faster but this is not necessary. If Node.js is unavailable or an unacceptable version, it will be downloaded and installed in the source tree.

Debian-based distro:

sudo apt-get install nodejs git build-essential python2.7

Fedora 22+ based distro:

sudo dnf install nodejs git
sudo dnf install @development-tools

RHEL based distro (adds the EPEL repo):

sudo yum localinstall https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install nodejs git
sudo yum install @development-tools

CentOS Stream 9

sudo dnf install nodejs git
sudo dnf groupinstall "Development Tools"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Gentoo

emerge --ask nodejs sys-devel/gcc dev-lang/python:3.4 dev-vcs/git

MacOS:

Install with MacPorts:

sudo port install cjdns

OpenBSD:

pkg_add git node gcc gmake bash

Select version gcc-4.8.1p2 or more recent.

FreeBSD:

Everything you need is available prebuild in FreeBSD' ports.

pkg install gmake node

Arch:

You can install cjdns by running:

pacman -S cjdns

If you need to build from source, everything you need can be installed like this:

pacman -S nodejs git base-devel

Alternatively, you may like to install via AUR from the package, cjdns-git. After installation, the configuration file is located at /etc/cjdroute.conf. To start the service cjdns.service, do:

systemctl start cjdns

To stop it:

systemctl stop cjdns

Gentoo:

cjdns is not yet in the main Gentoo repository, so you will have to use an overlay. The easiest way is to use Layman but you can do it by hand, too.

Layman:

First, you need to install layman.

emerge layman

If layman is installed correctly, you can add the overlay

layman -f
layman -a weuxel

For future update of the overlay use

layman -S

Now you can install cjdns

emerge cjdns
By hand:

You will have to clone the overlay repository

cd /opt
git clone https://github.com/Weuxel/portage-weuxel.git

Now tell portage to use this repo

cd /etc/portage/repos.conf/

Create a file portage-weuxel.conf containing

[weuxel]
location = /opt/portage-weuxel
masters = gentoo
auto-sync = yes

Now sync

emerge --sync

And install cjdns

emerge cjdns

Automatic crash detection and restart

Copy the the openrc init script from contrib/openrc to /etc/init.d/ and modify the CONFFILE and command parameter to your needs. Then start cjdns by issuing

/etc/init.d/cjdns start

Configure the init system to autostart cjdns

rc-update add cjdns default

Copy the service_restart script contrib/gentoo/service_restart.sh to any convenient directory on your system and modify the eMail address. If you do not wish to be notified, comment out the whole line. Now add a crontab entry like this

# Restart crashed Services
* * * * *       root	/path/to/script/service_restart.sh

Solus:

Dependencies:

sudo eopkg install nodejs git build-essential system.devel python gcc binutils kernal-headers xorg-server-devel

Then Follow the steps below:

Sorry for so many steps. A package is being worked on currently

1. Retrieve cjdns from GitHub

Clone the repository from GitHub and change to the source directory:

git clone https://github.com/cjdelisle/cjdns.git cjdns
cd cjdns

2. Build

./do

Look for Build completed successfully, type ./cjdroute to begin setup., then proceed below:


Setup

Run cjdroute without options for HELP:

./cjdroute

0. Make sure you've got the stuff.

If you're on macOS, don't worry about this step.

LANG=C cat /dev/net/tun

If it says: cat: /dev/net/tun: File descriptor in bad state Good!

If it says: cat: /dev/net/tun: No such file or directory, create it using:

sudo mkdir -p /dev/net &&
sudo mknod /dev/net/tun c 10 200 &&
sudo chmod 0666 /dev/net/tun

Then cat /dev/net/tun again.

If it says: cat: /dev/net/tun: Permission denied You're probably using a VPS based on the OpenVZ virtualization platform. Ask your provider to enable the TUN/TAP device - this is standard protocol so they should know exactly what you need.

1. Generate a new configuration file

./cjdroute --genconf >> cjdroute.conf

Protect your conf file!

A lost conf file means you lost your password and connections and anyone who connected to you will no longer be able to connect. A compromised conf file means that other people can impersonate you on the network.

To generate a conf file with permissions set so that only your user can read it and write to it:

(umask 077 && ./cjdroute --genconf > cjdroute.conf)

2. Find a friend

To get into an existing network (e.g. Hyperboria), you need to connect to someone who is already in the network. This is required for a number of reasons:

  1. It helps prevent abuse because bad people will be less likely to abuse a system after they were, in an act of human kindness, given access to that system.
  2. This is not intended to overlay The Old Internet, it is intended to replace it. Each connection will in due time be replaced by a wire, a fiber optic cable, or a wireless network connection.
  3. In any case of a disagreement, there will be a "chain of friends" linking the people involved so there will already be a basis for coming to a resolution.

To find a friend, get out there and join our community. Also, have a look at the Hyperboria Map to find peers near you.

You can also use the geographically assorted list of public peering credentials for joining Hyperboria at hyperboria/peers.

3. Connect your node to your friend's node

To initiate the connection OUTbound

In your conf file, you will see:

// Nodes to connect to.
"connectTo":
{
    // Add connection credentials here to join the network
    // Ask somebody who is already connected.
}

A conf file with multiple friend-nodes, setup OUTbound, should look like:

// Nodes to connect to.
"connectTo":
{
    //friend_1 (IPv4: 0.1.2.3; IPv6 fcaa:5bac:66e4:713:cb00:e446:c317:fc39)
    "0.1.2.3:45678":
    {
        "login": "k.alexander"
        "password": "thisIsNotARealConnection_1",
        "publicKey": "thisIsJustForAnExampleDoNotUseThisInYourConfFile_1.k"
    },

    //friend_2 (IPv4: 5.1.2.3; IPv6 fcbb:5bac:66e4:713:cb00:e446:c317:fc39)
    "5.1.2.3:5678":
    {
        "login": "k.alexander"
        "password": "thisIsNotARealConnection_2",
        "publicKey": "thisIsJustForAnExampleDoNotUseThisInYourConfFile_2.k"
    }
}

You can add as many connections as you want to the connectTo attribute, following JSON syntax.

To allow your friend to initiate the connection INbound

In your conf file, you will see:

"authorizedPasswords":
[
    // A unique string which is known to the client and server.
    {"password": "password001", "login": "default-login"}

    // More passwords should look like this.
    // {"password": "password002", "login": "my-second-peer"}
    // {"password": "password003", "login": "my-third-peer}
    // {"password": "password004", "login": "my-fourth-peer"}
    ...

    // "your.external.ip.goes.here:45678":{"login": "default-login", "password": "password001","publicKey":thisisauniqueKEY_001.k"}

],

A conf file with multiple friend-nodes, setup INbound, should look like:

"authorizedPasswords":
[
    // A unique string which is known to the client and server.
    {"password": "thisisauniquestring_001", "user": "k.alexander"}

    // More passwords should look like this.
    //William Jevons (IPv4: 0.1.2.3; IPv6 fcaa:5bac:66e4:713:cb00:e446:c317:fc39)
    {"password": "thisisauniquestring_002", "user": "William Jevons"}
    //Marilyn Patel (IPv4: 5.1.2.3; IPv6 fcbb:5bac:66e4:713:cb00:e446:c317:fc39)
    {"password": "thisisauniquestring_003", "user": "Marilyn Patel"}
    // {"password": "thisisauniquestring_004"}
    ...

    // "your.external.ip.goes.here:45678":{"password": "thisisauniquestring_001","publicKey":thisisauniqueKEY_001.k"}
],

You need to give William Jevons (who is making the INbound connection) the following 4 items:

  1. Your external IPv4

  2. The port found in your conf file here:

    // Bind to this port. "bind": "0.0.0.0:yourportnumberishere",

  3. Their unique password that you uncommented or created: "password": "thisisauniquestring_002"

  4. Your public key: "publicKey": "thisisauniqueKEY_001.k"

  5. His username: "William Jevons"

His login credentials will look something like this (with your IPv4 and port):

"1.2.3.4:56789": {
    "login": "William Jevons",
    "password": "thisisauniquestring_002",
    "publicKey": "thisIsJustForAnExampleDoNotUseThisInYourConfFile_1.k"
}

Please note that you and your friend can initiate a connection either outbound (from YOU --> FRIEND) or inbound (from FRIEND --> YOU) but traffic flows both ways once the connection is established.

See doc/configure.md for more details on configuration, including how to peer with other cjdns nodes over ethernet and wifi.

4. Secure your system - check for listening services

Once your node is running, you're now a newly minted IPv6 host. Your operating system may automatically reconfigure network services to use this new address. If this is not what you intend, you should check to see that you are not offering more services than you intended to. ;)

See doc/network-services.md for instructions.

5. Start it up!

sudo ./cjdroute < cjdroute.conf

If you want to have your logs written to a file:

sudo ./cjdroute < cjdroute.conf > cjdroute.log

To stop cjdns:

sudo killall cjdroute

If you are having problems use killall cjdroute to return to sanity. Use pgrep cjdroute or top to see if it running.

NOTE!

This starts cjdns as the root user so it can configure your system without concern for permissions. To start cjdns as a non-root user, see doc/non-root-user.md.

6. Get in IRC

Welcome to the network! You're now a network administrator. There are responsibilities which come with being a network administrator which include being available in case there is something wrong with your equipment. You should stay on IRC so that people can reach you.

Admin interface

When cjdroute is up and running, the admin interface will be available at udp://localhost:11234 (this can be changed in the cjdroute.conf configuration file). See doc/admin-api.md for more information about the admin interface. There are several tools in contrib/ that can interact with it.

You can access the admin API with:

  • the Python library; see here.
  • the Perl library, maintained by Mikey; see here.

Reporting issues

  1. Don't report in this repo, please instead report it at https://github.com/hyperboria/bugs/issues
  2. Get on IRC and talk to somebody
  3. What will happen is either
  • Someone feels like fixing it
  • You feel like fixing it
  • Nobody cares about it and it will be forgotten for a while and maybe someone will hit it later and fix it or else it will get wiped away in a refactoring
  • Nobody can fix it at the moment but it is considered worth remembering because it has great significance to the way the code is developed, in this case it needs to be explained in technical terms by someone with strong familiarity with the code. They will make a pull request to the docs/bugs directory.

Security

Security issues should be reported on IRC the same as other bugs. We don't have a closed group of people with special knowledge so that means the default security reporting method is full disclosure.

See: security_specification.md to see if a possible security issue is really a security issue.

More Repositories

1

PacketCrypt

Bandwidth-hard proof of work
JavaScript
76
star
2

packetcrypt_rs

PacketCrypt in Rust
C
53
star
3

return-to-abort

return-to-abort() - Using code introspection to prevent stack-smashing
Python
37
star
4

Matterfoss

Free Software Community Chat Server
Go
31
star
5

CryptoSplainers

This is why nobody ever encrypts anything
30
star
6

fixlicense

Replace broken license headers like BSD with the GPLv3 for freedom.
Perl
28
star
7

cjdnsnode

JavaScript
28
star
8

JakeGate

A (hopefully) unbiased timeline of events related to accusations against Jacob Appelbaum
19
star
9

big_download

Big Download - Node express middleware for zipbombing vuln scanners
JavaScript
15
star
10

libposit

A library for working with the posit number type.
C
14
star
11

wasabi

WebAssembly
13
star
12

poly1305-mips32r2-donna

An implementation of Poly1305 for mips32r2 processors, based on the donna32 algorithm
Assembly
12
star
13

badssl

Connect to broken ssl servers
JavaScript
10
star
14

cjdnstool

Diagnostic and management tools for cjdns
JavaScript
10
star
15

clang-wasm-toolchain

Basic toolchain for compiling WebAssembly
Python
8
star
16

treetracert

A tool for building graphical depictions of traceroutes from many source locations to a single destination.
JavaScript
8
star
17

nthen

The simple intuitive asynchronous library. nThen do this, nThen do that.
JavaScript
7
star
18

goposit

Library for Posit math in golang
Go
7
star
19

cjdnsann

Library for parsing cjdns announcement messages
JavaScript
7
star
20

VerifiablySecureElections

A proposal for an election process which can be proven secure.
6
star
21

khacker

Kernel development environment
Shell
6
star
22

cjdnsniff

Library for sniffing and injecting cjdns traffic.
JavaScript
6
star
23

freewifi

it's not what you think, it's for a stable connection to free.fr wifi *with authorization*
JavaScript
6
star
24

wotbot

INCOMPLETE: This is here only for historical purposes and to provide inspiration, it might be completed at some point in the future but there is no plan
JavaScript
5
star
25

cjdns-ubuntu

For creating PPA builds - current status is unknown/unmaintained
JavaScript
5
star
26

opencl-experiment

Experiment with asynchronous programming in OpenCL
C++
5
star
27

wap4410n_v2.0.7.4_gpl

GPL source dump for the Cisco WAP4410N
C
4
star
28

cjdnslop

Fuzzy long-eared cjdns test runner.
Shell
3
star
29

reasonml-experiment

Experimentation with the ReasonML language
OCaml
3
star
30

cjdnshdr

Tools for parsing and serializing cjdns packet headers
JavaScript
3
star
31

cjdnswalk

walk a cjdns network and output links between nodes
JavaScript
3
star
32

esyr

An esy overlay which adds a few extra features
JavaScript
3
star
33

matrix-laggifier

Bot to periodically check Matrix/IRC lag and provide it on demand
JavaScript
3
star
34

pkt-docker-electrumx

A dockerized electrumx instance for the PKT blockchain
Dockerfile
3
star
35

buffershift

bit-shift Buffer objects in nodejs
JavaScript
3
star
36

node.rs

A nodejs-like framework for Rust.
Rust
3
star
37

candlize

Take different formats of trade data and unify them into a candlestick format
JavaScript
3
star
38

cjdnsadmin

Admin API connector for talking to cjdns engine
JavaScript
3
star
39

cjdnsencode

Encode and decode EncodingScheme on-wire representation
JavaScript
2
star
40

bandwidth-guess-sim

Simulation of different available bandwidth estimation algorithms with cjdns data
JavaScript
2
star
41

freeports

Find out which UDP ports are not blocked
JavaScript
2
star
42

IndependentFactCheckers

A GPT AI bot which checks facts for the Fediverse
JavaScript
2
star
43

pkt-multisig-tools

Tools for assisting in multi-signature signing for PKT
JavaScript
2
star
44

pg_rescue

Like dd_rescue, but for horrifically broken postgres tables.
JavaScript
1
star
45

voicie

Little IRC bot to voice people after 30 seconds of idling
JavaScript
1
star
46

rainflydns

An archive of a project which was done some years ago
JavaScript
1
star
47

tooples.rs

Array functions for tuples
Rust
1
star
48

xmhell

Read XML into a JSON structure and then convert that JSON back into XML.
JavaScript
1
star
49

conduit

Personal fork of conduit matrix server
Rust
1
star
50

cjdns-30c3

the cjdns presentation at the c3
JavaScript
1
star
51

node.sh

Launch a nodejs process (downloading node if needed) on most systems which support bash-like shell
Shell
1
star
52

matterfoss-scripts

Porting scripts for merging Mattermost upstream to MatterFOSS
Shell
1
star
53

CJDNS-contact

Legal and contact information for CJDNS SASU
1
star
54

cjdnsaddr

Tool for parsing and serializing lists of addresses which are sent in the inter-router protocol.
JavaScript
1
star
55

Electorium

Delegated Voting System
Rust
1
star
56

freeports-srv

Find out which UDP ports are not blocked, the server end
JavaScript
1
star
57

cjdnskeys

tools for working with cjdns keys
JavaScript
1
star
58

cjdnsctrl

tools for parsing and serializing cjdns low level CTRL messages
JavaScript
1
star
59

MatterfossWeb

Matterfoss free software community chat application - frontend
TypeScript
1
star
60

pkt-explorer-insightfe

Bitcore/Insight based frontend for the PKT Block Explorer
TypeScript
1
star
61

pocl-enqueue

Toy for playing with pocl device-side enqueue
C++
1
star
62

slides-squatconf-2014

JavaScript
1
star
63

pagedancer

A SECCOMP PageTable Dance Move for running trusted and untrusted code in the same process.
JavaScript
1
star