Global

Members

EncryptionFormat

Encryption Format
Source:
See:

EncryptionFormat[undefined]

Generic format without header information, compatible with other AES-256 CTR libraries.
Source:

EncryptionFormat[undefined]

Salmon format with header (embedded nonce and integrity support).
Source:

EncryptionMode

Encryption Mode
Source:
See:

EncryptionMode[undefined]

Encryption Mode used with a base stream as a target.
Source:

EncryptionMode[undefined]

Decryption Mode used with a base stream as a source.
Source:

(constant) PBKDF_SHA256

Java Cipher key for SHA256. See javax.crypto.SecretKeyFactory.
Source:

PbkdfAlgo

Pbkdf algorithm implementation type.
Source:

PbkdfAlgo[undefined]

SHA256 hashing.
Source:

PbkdfType

Pbkdf implementation type.
Source:

PbkdfType[undefined]

Default Java pbkdf implementation.
Source:

ProviderType

AES provider types. List of AES implementations that currently supported.
Source:
See:

ProviderType[undefined]

Default JS AES cipher.
Source:

ProviderType[undefined]

Salmon builtin AES intrinsics. This needs the SalmonNative library to be loaded. @see Salmon README.md
Source:

ProviderType[undefined]

Salmon AES implementation. This needs the SalmonNative library to be loaded. @see Salmon README.md
Source:

ProviderType[undefined]

Salmon AES GPU implementation. This needs OpenCL, a compatible graphics card, and the SalmonNative library to be loaded. @see Salmon README.md
Source:

SearchEvent

Event status types.
Source:

SearchEvent[undefined]

Search files
Source:

SearchEvent[undefined]

Search is complete
Source:

SeekOrigin

Used to identify the start offset for seeking to a stream.
Source:

SeekOrigin[undefined]

Start from the beginning of the stream.
Source:

SeekOrigin[undefined]

Start from the current position of the stream.
Source:

SeekOrigin[undefined]

Start from the end of the stream.
Source:

Status

Sequencer status.
Source:
See:

Status[undefined]

Newly created sequence.
Source:

Status[undefined]

Currently active sequence used to provide nonces for data encryption ie: file contents and filenames.
Source:

Status[undefined]

Revoked sequence. This cannot be reused you need to re-authorize the device.
Source:

Methods

autoRename(filename) → {string}

Get an auto generated copy of a file name
Parameters:
Name Type Description
filename string The current file name
Source:
Returns:
The new file name
Type
string

autoRename(file) → {Promise.<string>}

Default autorename.
Parameters:
Name Type Description
file AesFile The file to be renamed
Source:
Returns:
The new file name
Type
Promise.<string>

autoRenameFile(file) → {Promise.<string>}

Get an auto generated copy of the name for a file.
Parameters:
Name Type Description
file IFile The file
Source:
Returns:
The new file name
Type
Promise.<string>

autoRenameFile(file) → {Promise.<string>}

Default autorename.
Parameters:
Name Type Description
file AesFile The file to be renamed
Source:
Returns:
The new file name
Type
Promise.<string>

copyFileContents(src, dest, optionsopt) → {Promise.<boolean>}

Copy contents of a file to another file.
Parameters:
Name Type Attributes Description
src IFile The source directory
dest IFile The target directory
options CopyContentOptions <optional>
The options
Source:
Throws:
IOException Thrown if there is an IO error.
Returns:
True if files are copied successfully
Type
Promise.<boolean>

copyRecursively(src, destDir, optionsopt)

Copy a directory recursively
Parameters:
Name Type Attributes Description
src IFile Source directory
destDir IFile Destination directory to copy into.
options RecursiveCopyOptions <optional>
The options.
Source:
Throws:
IOException Thrown if there is an IO error.

decryptData(data, start, count, outData, key, nonce, format, integrity, hashKey, chunkSize) → {Promise.<{startPos: number, endPos: number}>}

Decrypt the data.
Parameters:
Name Type Description
data Uint8Array The data to be decrypted.
start number The start position of the stream to be decrypted.
count number The number of bytes to be decrypted.
outData Uint8Array The buffer with the decrypted data.
key Uint8Array The AES key to be used.
nonce Uint8Array | null The nonce to be used.
format EncryptionFormat The format to use, see EncryptionFormat
integrity boolean True to verify integrity.
hashKey Uint8Array | null The hash key to be used for integrity verification.
chunkSize number The chunk size. Thrown if there is an error with the stream.
Source:
Throws:
  • SalmonSecurityException Thrown if there is a security exception with the stream.
  • IntegrityException Thrown if the stream is corrupt or tampered with.
Returns:
The number of bytes decrypted.
Type
Promise.<{startPos: number, endPos: number}>

deleteRecursively(optionsopt)

Delete a directory recursively
Parameters:
Name Type Attributes Description
options RecursiveDeleteOptions <optional>
The options
Source:

encryptData(data, start, count, outData, key, nonce, format, integrity, hashKey, chunkSize) → {Promise.<{startPos: number, endPos: number}>}

Encrypt the data.
Parameters:
Name Type Description
data Uint8Array The data to be encrypted.
start number The start position of the stream to be encrypted.
count number The number of bytes to be encrypted.
outData Uint8Array The buffer with the encrypted data.
key Uint8Array The AES key to be used.
nonce Uint8Array The nonce to be used.
format EncryptionFormat The format to use, see EncryptionFormat
integrity boolean True to apply integrity.
hashKey Uint8Array | null The key to be used for integrity application.
chunkSize number The chunk size. Thrown if there is an error with the stream.
Source:
Throws:
  • SalmonSecurityException Thrown if there is a security exception with the stream.
  • IntegrityException Thrown if integrity cannot be applied.
Returns:
The number of bytes encrypted.
Type
Promise.<{startPos: number, endPos: number}>

exportFilePart(fileToExport, exportFile, start, count, totalBytesWritten, onProgressChanged)

Export a file part from the drive. Do not use this directly, use FileExporter instead.
Parameters:
Name Type Description
fileToExport IVirtualFile The file the part belongs to
exportFile IFile The file to copy the exported part to
start number The start position on the file
count number The length of the bytes to be decrypted
totalBytesWritten Array.<number> The total bytes that were written to the external file
onProgressChanged OnFileExportProgressChanged The file progress
Source:

fillBufferPart(cacheBuffer, bufferSize, aesStream)

Fills a cache buffer with the decrypted data from a part of an encrypted file
Parameters:
Name Type Description
cacheBuffer CacheBuffer The cache buffer that will store the decrypted contents
bufferSize Uint8Array The length of the data requested
aesStream AesStream The stream that will be used to read from
Source:

getExtension(fileName) → {string}

Get extension from file name
Parameters:
Name Type Description
fileName string The file name
Source:
Returns:
The extension
Type
string

getPbkdfAlgoString(pbkdfAlgo) → {string}

Get the PBKDF java cipher algorigthm string.
Parameters:
Name Type Description
pbkdfAlgo PbkdfAlgo.SHA256 The PBKDF algorithm to be used
Source:
Returns:
The java cipher algorithm string. See javax.crypto.SecretKeyFactory.
Type
string

importFilePart(fileToImport, aesFile, start, count, totalBytesRead, onProgressChanged)

Import a file part into a file in the drive. Do not use this directly, use FileImporter instead.
Parameters:
Name Type Description
fileToImport IFile The external file that will be imported
aesFile IVirtualFile The file that will be imported to
start number The start position of the byte data that will be imported
count number The length of the file content that will be imported
totalBytesRead number The total bytes read from the external file
onProgressChanged OnFileImportProgressChanged Progress observer
Source:

moveRecursively(file, destDir, optionsopt)

Move a directory recursively
Parameters:
Name Type Attributes Description
file IFile Source directory
destDir IFile Destination directory to move into.
options RecursiveMoveOptions <optional>
The options
Source:

Type Definitions

OnFileExportProgressChanged(position, length)

Progress Callback
Parameters:
Name Type Description
position number The current position
length number The total length
Source:

OnFileImportProgressChanged(position, length)

Progress Callback
Parameters:
Name Type Description
position number The current position
length number The total length
Source: