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.
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).
Master Key (MK): Derived from your passphrase using crypto.pbkdf2.
Key Encryption Key (KEK): Generated randomly and encrypted by your MK.
Data Encryption Keys (DEKs): Scoped keys (e.g., memory, assets) encrypted by the KEK.
crypto module.Designed for high-concurrency backend environments:
${userId}:${channelId}:key format.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');