Chuyển đến nội dung
Skillpedia
Kiểm thử35k · #8035

implementing-end-to-end-encryption-for-messaging

Skill này làm gì

Công cụ này giúp tạo hệ thống nhắn tin mà chỉ những người trò chuyện mới đọc được tin nhắn. Ngay cả máy chủ gửi tin nhắn cũng không đọc được. Nó dùng các phương pháp mã hóa tiên tiến để đảm bảo an toàn.

Khi nào nên dùng

  • ✓Khi xây dựng ứng dụng nhắn tin an toàn.
  • ✓Khi thiết lập bảo mật để bảo vệ các cuộc trò chuyện.
  • ✓Khi đánh giá cách bảo vệ tin nhắn khỏi bị nghe lén.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-end-to-end-encryption-for-messaging/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-end-to-end-encryption-for-messaging/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm thế nào để thiết lập mã hóa đầu cuối cho ứng dụng chat của tôi?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ dùng phương pháp gọi là “Signal Protocol” để tạo khóa bảo mật riêng cho từng tin nhắn. Các khóa này đảm bảo rằng ngay cả khi ai đó chặn được tin nhắn, họ cũng không thể đọc được nội dung.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

  • When deploying or configuring implementing end to end encryption for messaging capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Prerequisites

  • Familiarity with cryptography concepts and tools
  • Access to a test or lab environment for safe execution
  • Python 3.8+ with required dependencies installed
  • Appropriate authorization for any testing activities

Objectives

  • Implement X25519 Diffie-Hellman key exchange for session establishment
  • Build the Double Ratchet key management algorithm
  • Encrypt and decrypt messages with per-message keys
  • Implement forward secrecy (compromise of current key does not reveal past messages)
  • Handle out-of-order message delivery
  • Implement key agreement using X3DH (Extended Triple Diffie-Hellman)

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

  • Delete message keys immediately after decryption
  • Implement message ordering and replay protection
  • Use authenticated encryption (AES-GCM) for all messages
  • Protect identity keys with device-level security
  • Verify identity keys out-of-band (safety numbers)

Validation Criteria

  • X25519 key exchange produces shared secret
  • Messages encrypt and decrypt correctly between two parties
  • Different messages produce different ciphertexts
  • Forward secrecy: old keys cannot decrypt new messages
  • Out-of-order messages can be decrypted
  • Tampered messages are rejected by authentication
Câu hỏi thường gặp

Mã hóa đầu cuối là gì?

Đây là phương pháp bảo mật đảm bảo chỉ bạn và người bạn đang nói chuyện mới đọc được tin nhắn. Không ai khác, kể cả công ty cung cấp dịch vụ, cũng không đọc được.

“Forward secrecy” là gì?

Nghĩa là nếu khóa bảo mật hiện tại bị lộ, các tin nhắn cũ vẫn được bảo vệ và không thể đọc được.

Tôi có cần là chuyên gia mật mã để dùng công cụ này không?

Lý tưởng nhất là bạn có kiến thức cơ bản, nhưng công cụ này đơn giản hóa quá trình để bạn triển khai bảo mật mà không cần là chuyên gia.

Chi tiết

Mô tả gốc của tác giả

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 key-management tradeoffs for a messaging system.

repo: mukul975/Anthropic-Cybersecurity-Skills

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#8035
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự