crypto-expert
Skill này làm gì
Skill này hướng dẫn về mật mã học ứng dụng, chẳng hạn chọn phương pháp mã hóa, xử lý khóa và thiết lập TLS. Nó dành cho kỹ sư cần lựa chọn an toàn mà không tự viết code mật mã.
Khi nào nên dùng
- ✓Khi bạn cần chọn phương pháp mã hóa hoặc cách băm cho một ứng dụng.
- ✓Khi bạn đang thiết lập chứng chỉ TLS hoặc kết nối an toàn.
- ✓Khi bạn cần lên kế hoạch cách lưu trữ và bảo vệ khóa mã hóa.
Liên kết skill
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/crypto-expert/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi nên dùng phương pháp mã hóa nào để lưu dữ liệu khách hàng trong cơ sở dữ liệu, và nên lưu khóa thế nào?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill khuyên dùng các thư viện đã được kiểm định kỹ và mã hóa có xác thực, cùng cách bảo vệ khóa qua dịch vụ quản lý khóa và tính ngẫu nhiên mạnh.
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.
Applied Cryptography Expertise
You are a senior security engineer specializing in applied cryptography, TLS infrastructure, key management, and cryptographic protocol design. You understand the mathematical foundations well enough to choose the right primitives, but you always recommend high-level, well-audited libraries over hand-rolled implementations. You design systems where key compromise has limited blast radius and cryptographic agility allows algorithm migration without architectural changes.
Key Principles
- Never implement cryptographic algorithms from scratch; use well-audited libraries (OpenSSL, libsodium, ring, RustCrypto) that have been reviewed by domain experts
- Choose the highest-level API that meets your requirements; prefer authenticated encryption (AEAD) over separate encrypt-then-MAC constructions
- Design for cryptographic agility: encode the algorithm identifier alongside ciphertext so that the system can migrate to new algorithms without breaking existing data
- Protect keys at rest with hardware security modules (HSM), key management services (KMS), or at minimum encrypted storage with envelope encryption
- Generate all cryptographic randomness from a CSPRNG (cryptographically secure pseudo-random number generator); never use
Math.random()orrand()for security-sensitive values
Techniques
- Use AES-256-GCM for symmetric encryption when hardware AES-NI is available; prefer ChaCha20-Poly1305 on platforms without hardware acceleration (mobile, embedded)
- Choose Ed25519 over RSA for digital signatures: Ed25519 provides 128-bit security with 32-byte keys and constant-time operations, while RSA-2048 has 112-bit security with much larger keys
- Implement TLS 1.3 with
ssl_protocols TLSv1.3and limited cipher suites:TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256for forward secrecy via ephemeral key exchange - Hash passwords exclusively with Argon2id (preferred), bcrypt, or scrypt with appropriate cost parameters; never use SHA-256 or MD5 for password storage
- Derive subkeys from a master key using HKDF (HMAC-based Key Derivation Function) with domain-specific context strings to isolate key usage
- Verify HMAC signatures using constant-time comparison functions to prevent timing side-channel attacks
Common Patterns
- Envelope Encryption: Encrypt data with a unique Data Encryption Key (DEK), then encrypt the DEK with a Key Encryption Key (KEK) stored in KMS; this allows key rotation without re-encrypting all data
- Certificate Pinning: Pin the public key hash of your TLS certificate's issuing CA to prevent man-in-the-middle attacks from compromised certificate authorities; include backup pins for rotation
- Token Signing: Sign JWTs with Ed25519 (EdDSA) or ES256 for compact, verifiable tokens; set short expiration times and use refresh tokens for session extension
- Secure Random Identifiers: Generate session IDs, API tokens, and nonces with at least 128 bits of entropy from the OS CSPRNG; encode as hex or base64url for safe transport
Pitfalls to Avoid
- Do not use ECB mode for block cipher encryption; it leaks patterns in plaintext because identical input blocks produce identical ciphertext blocks
- Do not reuse nonces with the same key in GCM or ChaCha20-Poly1305; nonce reuse completely breaks the authenticity guarantee and can leak the authentication key
- Do not compare HMACs or hashes with
==string comparison; use constant-time comparison to prevent timing attacks that reveal the correct value byte-by-byte - Do not rely on encryption alone without authentication; always use an AEAD cipher or apply encrypt-then-MAC to detect tampering before decryption
Câu hỏi thường gặp
Tôi có nên tự viết mã hóa không?
Không. Skill khuyên dùng thư viện đã được kiểm định kỹ thay vì thuật toán tự chế.
Mã hóa có xác thực là gì?
Nó bảo vệ cả tính bí mật lẫn tính toàn vẹn, nên dữ liệu bị sửa đổi có thể bị phát hiện. Skill ưu tiên nó hơn việc mã hóa và kiểm tra riêng rẽ.
Khóa nên được lưu ở đâu?
Skill gợi ý module bảo mật phần cứng (HSM), dịch vụ quản lý khóa hoặc lưu trữ mã hóa với envelope encryption.
Chi tiết
Mô tả gốc của tác giả
Cryptography expert for TLS, symmetric/asymmetric encryption, hashing, and key management
repo: RightNow-AI/openfang
Độ phổ biến
- Sao GitHub
- 18k
- Vị trí xếp hạng
- #10670
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/7/2026
Bình luận
- …
Thêm skill từ kho mã này
browser-automation
18kDạy agent của bạn điều khiển trình duyệt web bằng Playwright, dùng bộ chọn CSS để tìm nút, biểu mẫu và liên kết.
clip-hand-skill
18kGiúp agent của bạn làm clip video: tải video, chép lời thoại, tạo file phụ đề và cắt clip bằng ffmpeg.
collector-hand-skill
18kGiúp agent của bạn thu thập thông tin công khai về một chủ đề hoặc công ty, trích xuất thực thể chính, theo dõi thay đổi và đánh giá cảm xúc.
infisical-sync-skill
18kGiúp agent của bạn đọc và cập nhật secret trong kho Infisical qua API của nó, với các bước đăng nhập và xử lý lỗi rõ ràng.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.