Class AESUtils

AES enryption utils Provide functions to encrypt a text with a secure password and also be able to decrypt the encrypted value back to the original text with that secure password

Hierarchy

  • AESUtils

Constructors

Methods

Constructors

Methods

  • Decrypts a value

    Parameters

    • password: string

      The password to decrypt value.

    • value: Hex

      The value to decrypt.

    • salt: Hex
    • iv: Hex

      The additional data for encryption.

    • mode: string = "AES-GCM"

      The AES mode to decrypt value (default is AES-GCM).

    Returns Promise<string>

    The decrypted value.

  • Encrypts a value

    Parameters

    • password: string

      The password to encrypt value.

    • value: string

      The value to encrypt.

    • mode: string = "AES-GCM"

      The AES mode to encrypt value (default is AES-GCM).

    Returns Promise<EncryptionResult>

    The encrypted value with a random generated salt

  • Parameters

    • password: string
    • salt: Uint8Array
    • mode: string

    Returns Promise<CryptoKey>

Generated using TypeDoc