Class for managing encrypting and decrypting private auth information.

Hierarchy

  • AsyncOptionalCreatable<CryptoOptions>
    • Crypto

Methods

  • Clears the crypto state. This should be called in a finally block.

    Returns void

  • Decrypts text.

    Parameters

    • text: string

      The text to decrypt.

    Returns string

  • Encrypts text. Returns the encrypted string or undefined if no string was passed.

    Parameters

    • text: string

      The text to encrypt.

    Returns string

  • Takes a best guess if the value provided was encrypted by Crypto.encrypt by checking the delimiter, tag length, and valid characters.

    Parameters

    • Optional text: string

      The text

    Returns boolean

    true if the text is encrypted, false otherwise.