1.0.14 • Published 5 years ago

gigacrypto v1.0.14

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

gigacrypto

GigaCrypto is a crypto library to crypt data for the https://giga.gg service.

Installation

Using npm:

$ npm i --save gigacrypto

Usage

// 1) when the user subscribe, generate and export a keychain.
//    Then on the POST /rest/subscribe, you must include the exported keychain.

import { Keychain } from 'gigacrypto';

const keychain = await Keychain.generate('TheUserPasswordHere');
const exportedKeychain = await keychain.export(/* true: will export the masterKey and the password */);

// 2) On user login, import the keychain from the server
//    /rest/login and /rest/me will contain all the needed infos.

import { Keychain } from 'gigacrypto';

const keychain = await Keychain.import(keychainInfos, 'TheUserPasswordHere');
// If there is an error in the process, the user should not be allowed to log in.

// 3) Use the keychain to get the nodeKey and download files :

const nodeKey = keychain.getUnencryptedNodeKey();
// Remember to correctly url encode if it is part of a url.
1.0.14

5 years ago

1.0.13

5 years ago

1.0.11

5 years ago

1.0.12

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago