# @filoz/filecoin-encryption-envelope

**Filecoin Encryption Envelope (FIP-1253) - Main Entry Point**

## Example

```ts
import * as fee from '@filoz/filecoin-encryption-envelope'

source.pipeThrough(fee.encrypt({ cek }))  // chunked stream, the default
fee.aesGcm.encrypt(plaintext, { cek })     // whole-object, opt-in
fee.constants.ALG_A256KW
```

## Namespaces

| Namespace | Description |
| ------ | ------ |
| [aesGcm](/reference/filoz/filecoin-encryption-envelope/namespaces/aesgcm/toc/) | - |
| [constants](/reference/filoz/filecoin-encryption-envelope/namespaces/constants/toc/) | - |
| [cose](/reference/filoz/filecoin-encryption-envelope/namespaces/cose/toc/) | COSE decode-only inspection surface (FIP-1253): read an untrusted envelope into its typed protected header, unprotected header, and recipient list. See docs/tech-spec.md, "Wire profile" and "CDDL". |
| [errors](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/toc/) | - |
| [recipients](/reference/filoz/filecoin-encryption-envelope/namespaces/recipients/toc/) | - |

## Interfaces

| Interface | Description |
| ------ | ------ |
| [ChunkedEncryptOptions](/reference/filoz/filecoin-encryption-envelope/interfaces/chunkedencryptoptions/) | Options for one chunked AES-256-GCM STREAM encryption using a direct CEK. |

## Type Aliases

| Type Alias | Description |
| ------ | ------ |
| [AppMetadata](/reference/filoz/filecoin-encryption-envelope/type-aliases/appmetadata/) | Opaque, string-keyed application metadata. Carried but never interpreted. |
| [CborValue](/reference/filoz/filecoin-encryption-envelope/type-aliases/cborvalue/) | CBOR values supported by this profile. |

## Functions

| Function | Description |
| ------ | ------ |
| [encrypt](/reference/filoz/filecoin-encryption-envelope/functions/encrypt/) | Encrypt a plaintext stream using scheme 2 (chunked AES-256-GCM STREAM) and a direct CEK. |