Class: TextDecryptor

TextDecryptor()

Utility class that encrypts and decrypts text strings.

Constructor

new TextDecryptor()

Source:

Methods

(async, static) decryptString(text, key, nonce, format, 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.
format EncryptionFormat The format to use, see EncryptionFormat
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 number 0 The chunk size.
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>