Class: DriveGenerator

DriveGenerator()

Utility class generates internal secure properties for the drive.

Constructor

new DriveGenerator()

Source:

Members

(static) AUTH_ID_SIZE

Auth ID size
Source:

(static) COMBINED_KEY_LENGTH

combined key is drive key + hash key.
Source:

(static) DRIVE_ID_LENGTH

Drive ID size.
Source:

(static) ITERATIONS_LENGTH

Length for the iterations that will be stored in the encrypted data header.
Source:

(static) IV_LENGTH

Initial vector length that will be used for encryption and master encryption of the combined key
Source:

(static) MASTER_KEY_LENGTH

Master key to encrypt the combined key we also use AES256.
Source:

(static) SALT_LENGTH

Salt length.
Source:

Methods

(static) generateAuthId() → {Uint8Array}

Generate a secure random authorization ID.
Source:
Returns:
The authorization Id (16 bytes).
Type
Uint8Array

(static) generateCombinedKey() → {Uint8Array}

Generates a secure random combined key (drive key + hash key)
Source:
Returns:
The length of the combined key.
Type
Uint8Array

(static) generateDriveID() → {Uint8Array}

Generate a Drive ID.
Source:
Returns:
The Drive ID.
Type
Uint8Array

(static) generateMasterKeyIV() → {Uint8Array}

Generates the initial vector that will be used with the master key to encrypt the combined key (drive key + hash key)
Source:
Returns:
The master key initial vector
Type
Uint8Array

(static) generateSalt() → {Uint8Array}

Generates a salt.
Source:
Returns:
The salt byte array.
Type
Uint8Array

(static) getIterations() → {number}

Returns the iterations used for deriving the combined key from the text password
Source:
Returns:
The current iterations for the key derivation.
Type
number

(static) getMaxNonce() → {Uint8Array}

Get the default max nonce to be used for drives.
Source:
Returns:
A secure random byte array (8 bytes).
Type
Uint8Array

(static) getStartingNonce() → {Uint8Array}

Get the starting nonce that will be used for encrypt drive files and filenames.
Source:
Returns:
A secure random byte array (8 bytes).
Type
Uint8Array

(static) setIterations(iterations)

Set the default iterations.
Parameters:
Name Type Description
iterations number The iterations
Source: