360 Secure SkillHub
360 安全技能中心

A2a E2ee Encryption

该工具为代理间通信提供端到端加密能力,核心功能含RSA密钥生成、消息加解密、密钥交换/自动轮换、HMAC消息认证等。适用于代理间消息加密、安全通信密钥管理、实现安全通信协议等场景,以JS API形式提供,支持密钥导出导入,输入参数含明文、密钥等,输出密钥对象、密文或明文。

jpengcheng523-netizen
jpengcheng523-netizen
热度 51.47
最近更新 2026-05-11 17:36:35
分类:开发依赖:代码执行 / 内部调用大模型应用场景:代码生成 / API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add a2a-e2ee-encryption
Metadata
name
a2a-e2ee-encryption
description
Implements end-to-end encryption (E2EE) utilities for secure A2A (Agent-to-Agent) communication. Provides key generation, message encryption/decryption, and key management capabilities. **Trigger scenarios:** - User asks about E2EE implementation for agent communication - Need to encrypt messages between agents - Key management for secure A2A channels - Implementing secure communication protocols

A2A End-to-End Encryption

Provides encryption utilities for secure agent-to-agent communication.

Features

  • Key Generation: RSA key pair generation for asymmetric encryption
  • Message Encryption: Encrypt messages with recipient's public key
  • Message Decryption: Decrypt messages with own private key
  • Key Exchange: Secure key exchange protocols
  • Key Rotation: Automatic key rotation support
  • Message Integrity: HMAC-based message authentication

Usage

const e2ee = require('./skills/a2a-e2ee-encryption');

// Generate key pair
const keyPair = e2ee.generateKeyPair();

// Encrypt message
const encrypted = e2ee.encrypt('secret message', recipientPublicKey);

// Decrypt message
const decrypted = e2ee.decrypt(encrypted, privateKey);

// Export/Import keys
const exported = e2ee.exportKey(keyPair.publicKey);
const imported = e2ee.importKey(exported);

Architecture

┌─────────────┐                    ┌─────────────┐
│   Agent A   │                    │   Agent B   │
│             │                    │             │
│ Private Key │                    │ Private Key │
│ Public Key  │◄──── Exchange ────►│ Public Key  │
│             │                    │             │
│ Encrypt     │──── Encrypted ────►│ Decrypt     │
│ with B's    │      Message       │ with A's    │
│ Public Key  │                    │ Public Key  │
└─────────────┘                    └─────────────┘

Security Considerations

  1. Key Storage: Private keys should be stored securely (env vars, vault)
  2. Key Rotation: Rotate keys periodically for forward secrecy
  3. Key Validation: Always verify key fingerprints before use
  4. Message Size: Large messages should use hybrid encryption