# Encrypted Containers

**Encrypted Containers** are a secure way to encrypt data and share it with specific Keeta accounts. They provide end-to-end encryption with built-in access control.

### **What Are They For**

Encrypted Containers solve a common problem in blockchain systems: how to share private data securely. Use cases include:

* **KYC documents**: Share identity verification documents with compliant anchors
* **Private transaction details**: Share sensitive payment information
* **Confidential certificates**: Distribute verifiable credentials
* **Secure messaging**: Send encrypted data between accounts

### **How Are They Constructed**

An Encrypted Container:

1. **Encrypts plaintext** for each authorized recipient using their public key
2. **Optionally signs** the container to prove authenticity
3. **Serializes to ASN.1** format for compact, standardized encoding

### **Advantages of the SDK**

The Encrypted Container implementation in the Anchor SDK:

* **Handles cryptographic complexity**: You don't need to understand ASN.1, key derivation, or cipher modes
* **Manages access control**: Automatically encrypts keys for each recipient
* **Provides verification**: Built-in signature support for authenticity
* **Optimizes size**: Automatic compression for large payloads
* **Ensures compatibility**: Standard encoding works across different implementations

### **Example: Creating and Sharing an Encrypted Container**

{% @github-files/github-code-block url="<https://github.com/KeetaNetwork/keetanet-examples/blob/main/src/anchor/encrypted-container.ts>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeta.com/anchors/overview/encrypted-containers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
