• Similar to decrypt, but asynchronous, this is a function that can be used to decrypt data that has been encrypted using this library's encrypt or encryptAsync function, both of which are based on the AES-256-CBC algorithm.

    Parameters

    • encryptedData: Buffer

      The Buffer instance containing the encrypted data.

    • key: Buffer

      A Buffer instance containing the same key that was used when encrypting the data using encrypt or encryptAsync.

    Returns Promise<Buffer>

    A Promise that resolves to a Buffer instance containing the decrypted data.

    Note

    Internally, this function uses Node's crypto.Decipher class to perform decryption.

    Note

    This function assumes that the encrypted data has been generated using either encrypt or encryptAsync, which two functions randomly generate a 128-bit initialization vector used for encrypting, and then prepend that initialization vector to the encrypted data before returning everything into a Buffer.

    See

    decrypt

Generated using TypeDoc