Skip to content

encrypt

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

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

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

Caller-owned byte arrays are snapshotted before the first async step to prevent them from changing during the operation. The IV is always generated internally and cannot be provided by the caller.

ParameterType
plaintextUint8Array
optionsEncryptOptions

Promise<Uint8Array<ArrayBufferLike>>