Skip to content
Back to skills

494 Backend Encryption

ASecurity

Backend Agent Data Encryption. High-security MK->KEK->DEK hierarchy for backend environments.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
developmentjavascriptjavanodefrontendbackendsecurity

Works with

  • cli

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add winlem2024/workbuddy-skills --skill 494-backend-encryption --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 494 Backend Encryption?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 494 Backend Encryption
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/winlem2024-494-backend-encryption/badge)](https://www.skillsdirectory.com/skills/winlem2024-494-backend-encryption)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "backendenc"
description: "Backend Agent Data Encryption. High-security MK->KEK->DEK hierarchy for backend environments."
---

# backendenc: Backend Security Toolkit

This skill provides mandatory encryption for OpenClaw agents running in **Node.js/Backend** environments. It operates in **Local Manual Mode**, using the Node.js built-in `crypto` module.

## Context
Unlike the frontend version which uses Web Crypto, this version is designed for server-side execution, CLI tools, or background agents. It stores metadata in a persistent local file (or compatible storage provider).

## Key Hierarchy

1.  **Master Key (MK)**: Derived from your passphrase using `crypto.pbkdf2`. 
    *   **Persistence**: A unique "Salt" is stored in your configuration. As long as you remember your passphrase, the same Master Key will be generated across reboots.
2.  **Key Encryption Key (KEK)**: Generated randomly and encrypted by your MK.
3.  **Data Encryption Keys (DEKs)**: Scoped keys (e.g., `memory`, `assets`) encrypted by the KEK.

## Security Disclosure

-   **Zero Network**: This skill does NOT perform any external network requests. All operations happen via the Node.js `crypto` module.
-   **No Cleartext Keys**: Keys are never stored in cleartext. They are always "wrapped" (encrypted) by a higher-level key using AES-256-GCM.
-   **Passphrase Obligation**: You must provide your passphrase to "unlock" the vault after هر server reboot.

## Multi-User & Channel Isolation

Designed for high-concurrency backend environments:
-   **Key Partitioning**: All storage keys follow the `${userId}:${channelId}:key` format.
-   **Security**: Ensures that even if the underlying storage file is compromised, keys for different users remain cryptographically separated.

## Usage (Backend)

```javascript
import { EncryptionService } from './encryption-service.js';

// Access context IDs
const { userId, channelId } = agent.context;

// Unlock for context
await EncryptionService.unlock(userId, channelId, 'passphrase');

// Scoped encryption
const encrypted = await EncryptionService.encrypt(userId, channelId, 'history', 'data');
```

Files in this skill

  • README.md2.6 KB
  • SKILL.md2.1 KB
  • _skillhub_meta.json511 B
  • references/storage-keys.md660 B
  • scripts/encryption-service.js6.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.