# Cryptography

A brief overview of the used cryptography

# General

All cryptography is based on https://nacl.cr.yp.to

# Cryptography libraries

  • Our web clients (websites and browser extensions) are using ecma-nacl a JavaScript implementation of NaCl.

  • Our backends (server and fileserver) are using PyNaCl

  • Our apps (Android and iOS) use are using flutter_sodium and Swift-Sodium

# Scrypt libraries

  • The scrypt library used by our backends (server and fileserver) is scrypt

  • The scrypt library used by our web clients (websites and browser extensions) is already part of ecma-nacl.

  • The scrypt library used by our apps (Android and iOS) is pointycastle

# Authkey Algorithm

The authkey is generated with the following algorithm / scrypt parameters:

var generate_authkey = function (username, password) {

    var salt = sha512(username.toLowerCase());

    var u = 14; // 2^14 = 16MB
    var r = 8;
    var p = 1;
    var l = 64; // 64 Bytes = 512 Bits

    var authkey = to_hex(scrypt(encode_utf8(password), salt, u, r, p, l));

    return authkey;
};

# Registration Process

The following diagram outlines the registration process, shows how the user's keys are generated and stored.

Registration Process

TIP

Click on the diagram to zoom.

# Login Process

The following diagram outlines the login process, shows how the signature of the server is checked, the authentication key is generated and the whole session creation including multifactor challenges are handled.

Login Process

TIP

Click on the diagram to zoom.

# Fileserver: File upload

The following diagram outlines the upload process to fileservers. It shows how a file is split up in chunks and the whole communication between the server and the fileserver.

Fileserver upload process

TIP

Click on the diagram to zoom.

# Fileserver: File download

The following diagram outlines the download process to fileservers. It shows how the various chunks of a file are downloaded decrypted and merged and the whole communication between the server and the fileserver.

Fileserver download process

TIP

Click on the diagram to zoom.

# Fileserver: File delete

The following diagram outlines the deletion process of files with fileservers. It shows the whole communication between the server and the fileserver.

Fileserver deletion process

TIP

Click on the diagram to zoom.