implementing-zero-knowledge-proof-for-authentication
它能做什么
这个工具让你可以在不直接展示密码或秘密的情况下,证明你确实知道它。就像用一把秘密钥匙证明你的身份,却从来不把钥匙交出去。
适用场景
- ✓创建不使用密码的登录系统时。
- ✓服务器需要确认你的身份,但又不能知道你的秘密时。
- ✓搭建更高级的安全系统时。
技能链接
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-zero-knowledge-proof-for-authentication/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我想用零知识证明来登录。”
每周 5 个新技能,1 分钟读完。
工作原理
你提供一个秘密(比如密码),工具会用它生成一份证明。这份证明会被发送给服务器,服务器在验证时无需看到你原始的秘密。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Implementing Zero-Knowledge Proof for Authentication
Overview
Zero-Knowledge Proofs (ZKPs) allow a prover to demonstrate knowledge of a secret (such as a password or private key) without revealing the secret itself. This skill implements the Schnorr identification protocol and a simplified ZKPP (Zero-Knowledge Password Proof) using the discrete logarithm problem, enabling authentication where the server never learns the user's password.
When to Use
- When deploying or configuring implementing zero knowledge proof for authentication 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 Schnorr's identification protocol for ZKP authentication
- Build a non-interactive ZKP using Fiat-Shamir heuristic
- Implement zero-knowledge password proof (ZKPP)
- Demonstrate completeness, soundness, and zero-knowledge properties
- Compare ZKP authentication with traditional password verification
Key Concepts
ZKP Properties
| Property | Description |
|---|---|
| Completeness | Honest prover always convinces honest verifier |
| Soundness | Dishonest prover cannot convince verifier (except negligible probability) |
| Zero-Knowledge | Verifier learns nothing beyond the statement's truth |
Schnorr Protocol
- Setup: Public generator g, prime p, q (order of g)
- Registration: Prover computes y = g^x mod p (public key from secret x)
- Commitment: Prover sends t = g^r mod p (random r)
- Challenge: Verifier sends random c
- Response: Prover sends s = r + c*x mod q
- Verify: Check g^s == t * y^c mod p
Security Considerations
- Use cryptographically secure random number generators
- Challenge must be unpredictable (from verifier's perspective)
- For non-interactive proofs, use Fiat-Shamir with collision-resistant hash
- ZKP alone does not provide forward secrecy; combine with TLS
Validation Criteria
- Honest prover always verifies successfully (completeness)
- Random response without secret does not verify (soundness)
- Server never receives the secret value
- Non-interactive proof is verifiable offline
- Multiple authentications produce different transcripts
- Protocol resists replay attacks
常见问题
什么是零知识证明?
这是一种方式,让你能够证明自己知道某些信息(比如密码),而无需把这些信息透露给验证方。
它有什么优势?
最主要的优势是安全性:即使服务器被入侵,你的秘密也不会暴露。
使用它需要很专业的知识吗?
这个工具简化了流程,但了解一些基础密码学知识,会更容易理解它的工作原理。
详情
作者的原始描述
Implements the Schnorr identification protocol and a simplified Zero-Knowledge Password Proof (ZKPP) over the discrete logarithm problem, letting a prover authenticate by demonstrating knowledge of a secret without ever revealing it to the server. Use when designing or building password-less or password-secret-free authentication, or when a server must verify a user's credential without learning o
热度
- GitHub 星标
- 35k
- 排名
- #8140
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/31
评论
- …
同一仓库的更多技能
abusing-dpapi-for-credential-access
35k为你的 AI 智能体提供针对特定任务的现成指令,让它完成得更好、更快。
abusing-shadow-credentials-for-privesc
35k教你的 AI 智能体写出清晰、结构良好的文本。
achieving-cmmc-level-2-compliance
35k帮助你的智能体搭建符合 CMMC Level 2 合规要求的环境。它会落实安全要求,并管理必要的文档。
acquiring-disk-image-with-dd-and-dcfldd
35k帮助你的智能体创建硬盘的精确副本。这能确保调查过程中信息不丢失、不被篡改。