Documentation

Get started

Get code source jossnet

git clone https://github.com/jossweb/jossnet-core
cd jossnet-core

Install and compile dependances

./init

⚠️ If you have a file rights problem, run this command to give yourself execution rights.

chmod 111 init.sh

Compile and execute server (need to be in /server)

gcc server.c endpoint.c ../common/common.c ../keygen/keygen.c ../cjson/cJSON.c \
    -I../build/include \
    ../build/lib/libnoisekeys.a \
    ../build/lib/libnoiseprotobufs.a \
    ../build/lib/libnoiseprotocol.a \
    -o server
./server

Compile and execute client (need to be in /client)

gcc client.c ../common/common.c ../keygen/keygen.c  ../cjson/cJSON.c \
    -I../build/include \
    ../build/lib/libnoisekeys.a \
    ../build/lib/libnoiseprotobufs.a \
    ../build/lib/libnoiseprotocol.a  \
    -o client
./client

Setup

Set target ip

By default, the server is accessible on port 2006, but you can change the port using the line below.

/server/server.c
static int port = 2006;

On the client side, you can change the target IP and port according to your needs using the following two lines.

/client/client.c
static const char *hostname = "localhost";
/client/client.c
static int port = 2006;

Choose Diffie-Hellman (DH)

Diffie-Hellman uses mathematical operations on elliptic curves, which are structures that secure key exchange. In the case of Jossnet, only the curves Curve25519 and Curve448 are supported, providing an optimal balance between security and performance during the shared secret generation. You can choose either of these two curves by modifying the corresponding value in the client.c file. The only accepted values are 25519 and 448. After making this change, recompilation is required.

/client/client.c
static const int dh = 25519;

Hadcode secret keys to change

Finally, it’s important to change the hardcoded secrets, as they are publicly available on GitHub and could lead to security vulnerabilities. Here are the values you should customize to avoid this issue:

/keygen/keygen.c
const char* salt[] = {
  "jossnet_salt_001", "jossnet_salt_002", ...
};
/server/server.c
const char* secure_string = "Jossnet-secure-screen-for-psk";
/keygen/keygen.c
const char* secondary_secure_string = "Jossnet2025Server";