> For the complete documentation index, see [llms.txt](https://polarischain-1.gitbook.io/polarischain/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polarischain-1.gitbook.io/polarischain/7.-storage-and-persistence-architecture/7.3-encryption-at-rest-and-key-custody.md).

# 7.3 - Encryption-at-Rest & Key Custody

A single operator passphrase activates cryptographic encryption across all persistent stores: consensus RocksDB, application RocksDB, and LMDB hot state. Each data directory maintains an isolated salt sidecar to ensure correct decryption during snapshot restoration or node migration.

| Component            | Algorithm                            | Implementation Notes                                                          |
| -------------------- | ------------------------------------ | ----------------------------------------------------------------------------- |
| Data Encryption      | AES-256-GCM                          | Per-record nonces sourced from OS CSPRNG                                      |
| Key Derivation       | Argon2id                             | Memory-hard KDF, shared securely across stores                                |
| Integrity Validation | BLAKE3 Keyed-Hash                    | Verifies sidecar integrity & key material consistency                         |
| Key Custody Modes    | Plaintext / Encrypted File / Env Var | Encrypted file mode leverages OS keyring; env var mode supports KMS workflows |

**Safety Guarantees:**

* Incorrect passphrase triggers a clean, structured exit with zero risk of state corruption.
* Missing salt sidecar on existing data produces a hard error—the node refuses to silently regenerate salts or re-encrypt with new material, preventing cryptographic downgrade attacks.

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://polarischain-1.gitbook.io/polarischain/7.-storage-and-persistence-architecture/7.3-encryption-at-rest-and-key-custody.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
