Implementing end to end encryption for messaging

From mukul975/Anthropic-Cybersecurity-Skills · View interactive version

Implementing end to end encryption for messaging is an AI agent skill from the GitHub repository mukul975/Anthropic-Cybersecurity-Skills. Implements a simplified Signal Protocol-style end-to-end encryption scheme for messaging, covering key exchange, forward secrecy, and the core cryptographic components so no server or intermediary can decrypt messages. Use when designing or building E2EE messaging, or evaluating forward-secrecy and

How to use this skill

Skill file

Implementing End-to-End Encryption for Messaging

Overview

End-to-end encryption (E2EE) ensures that only the communicating parties can read messages, with no intermediary (including the server) able to decrypt them. This skill implements a simplified version of the Signal Protocol's Double Ratchet algorithm, using X25519 for key exchange, HKDF for key derivation, and AES-256-GCM for message encryption.

When to Use

Prerequisites

Objectives

Key Concepts

Signal Protocol Components

| Component | Purpose | Algorithm |

|-----------|---------|-----------|

| X3DH | Initial key agreement | X25519 |

| Double Ratchet | Ongoing key management | X25519 + HKDF + AES-GCM |

| Sending Chain | Per-message encryption keys | HMAC-SHA256 chain |

| Receiving Chain | Per-message decryption keys | HMAC-SHA256 chain |

| Root Chain | Derives new chain keys on DH ratchet | HKDF |

Forward Secrecy

Each message uses a unique encryption key derived from a ratcheting chain. After a key is used, it is deleted, ensuring that compromise of the current state does not reveal previously sent/received messages.

Security Considerations

Validation Criteria

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.