Class: SalmonTextDecryptor

SalmonTextDecryptor()

Utility class that encrypts and decrypts text strings.

Constructor

new SalmonTextDecryptor()

Source:

Methods

(async, static) decryptString(text, key, nonce, header, integrity, hashKey, chunkSize) → {Promise.<string>}

Decrypts a text String using AES256 with the key and nonce provided.
Parameters:
Name Type Default Description
text string Text to be decrypted.
key string The encryption key to be used.
nonce Uint8Array | null The nonce to be used, set only if header=false.
header boolean Set to true if you encrypted the string with encrypt(header=true), set only if nonce=null otherwise you will have to provide the original nonce.
integrity boolean false True if you want to calculate and store hash signatures for each chunkSize
hashKey Uint8Array | null null Hash key to be used for all chunks.
chunkSize null
Source:
Throws:
  • IOException
  • SalmonSecurityException Thrown when error with security
  • IntegrityException Thrown if the data are corrupt or tampered with.
Returns:
The decrypted text.
Type
Promise.<string>