Class: CryptTool

CryptTool()

new CryptTool()

handles everything related to en/decryption
Source:

Methods

(static) addEntropySeedListener(func)

add a listener function, triggered when enough entropy is available
Parameters:
Name Type Description
func function
Source:

(static) cipher(key, password, message) → {string}

compress, then encrypt message with given key and password
Parameters:
Name Type Description
key string
password string
message string
Source:
Returns:
data - JSON with encrypted data
Type
string

(static) decipher(key, password, data) → {string}

decrypt message with key, then decompress
Parameters:
Name Type Description
key string
password string
data string JSON with encrypted data
Source:
Returns:
decrypted message, empty if decryption failed
Type
string

(static) getSymmetricKey() → {string}

returns a random symmetric key
Source:
Returns:
func
Type
string

(static) isEntropyReady() → {bool}

checks whether the crypt tool has collected enough entropy
Source:
Returns:
Type
bool