跳到正文
Skillpedia
安全35k · #8140

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-zero-knowledge-proof-for-authentication/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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

  1. Setup: Public generator g, prime p, q (order of g)
  2. Registration: Prover computes y = g^x mod p (public key from secret x)
  3. Commitment: Prover sends t = g^r mod p (random r)
  4. Challenge: Verifier sends random c
  5. Response: Prover sends s = r + c*x mod q
  6. 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

repo: mukul975/Anthropic-Cybersecurity-Skills

热度

GitHub 星标
35k
排名
#8140
许可证
Apache-2.0
更新时间
2026/8/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能