Skip to content

encrypt

encrypt(plaintext, options): Promise<Uint8Array<ArrayBufferLike>>

Defined in: packages/filecoin-encryption-envelope/src/aes-gcm.ts:82

Encrypt a complete plaintext as scheme 1 and return envelope || ciphertext.

Borrows its inputs: callers must not modify plaintext, keys, recipients or metadata until the promise settles. The IV is always generated internally and cannot be provided by the caller.

Parameter Type
plaintext Uint8Array
options EncryptOptions

Promise<Uint8Array<ArrayBufferLike>>