Skip to content

encrypt

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

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

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.

ParameterType
plaintextUint8Array
optionsEncryptOptions

Promise<Uint8Array<ArrayBufferLike>>