A type to encrypt and to decrypt anything that can fit in an Uint8Array, usually big buffer.

Methods

  • Returns void

  • Decrypt an EncryptedAttachment.

    The encrypted attachment can be created manually, or from the encrypt method.

    Warning: The encrypted attachment can be used only once! The encrypted data will still be present, but the media encryption info (which contain secrets) will be destroyed. It is still possible to get a JSON-encoded backup by calling EncryptedAttachment.mediaEncryptionInfo.

    Parameters

    Returns Uint8Array<ArrayBufferLike>

  • Encrypt the content of the Uint8Array.

    It produces an EncryptedAttachment, which can be used to retrieve the media encryption information, or the encrypted data.

    Parameters

    • array: Uint8Array<ArrayBufferLike>

    Returns EncryptedAttachment