QudsLab/PQChub

GitHub: QudsLab/PQChub

跨平台后量子密码学二进制分发工具,提供预编译的多平台库文件和多语言FFI封装,支持Kyber、Dilithium、Falcon等NIST批准的PQC算法。

Stars: 1 | Forks: 1

# PQChub
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![PQClean](https://img.shields.io/badge/source-PQClean-green.svg)](https://github.com/PQClean/PQClean) [![Build Status](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/b2321e908a024454.svg)](https://github.com/QudsLab/PQChub/actions/workflows/build-bins.yml) [![Platforms](https://img.shields.io/badge/platforms-Linux%20%7C%20macOS%20%7C%20Windows%20%7C%20Android-blue.svg)](https://github.com/QudsLab/PQChub) [![Languages](https://img.shields.io/badge/languages-Python%20%7C%20Node.js%20%7C%20Go%20%7C%20Rust%20%7C%20Java%20%7C%20C%23-orange.svg)](https://github.com/QudsLab/PQChub) [![NIST PQC](https://img.shields.io/badge/NIST-Post--Quantum%20Cryptography-purple.svg)](https://csrc.nist.gov/projects/post-quantum-cryptography) [![Algorithms](https://img.shields.io/badge/algorithms-Kyber%20%7C%20Dilithium%20%7C%20Falcon-red.svg)](https://github.com/QudsLab/PQChub) [![Pre-compiled](https://img.shields.io/badge/binaries-pre--compiled-brightgreen.svg)](https://github.com/QudsLab/PQChub/tree/main/bins) [![Zero Compilation](https://img.shields.io/badge/setup-zero%20compilation-success.svg)](https://github.com/QudsLab/PQChub) [![FFI Ready](https://img.shields.io/badge/FFI-ready-blueviolet.svg)](https://github.com/QudsLab/PQChub) [![Cross Platform](https://img.shields.io/badge/cross--platform-universal-cyan.svg)](https://github.com/QudsLab/PQChub) [![Auto Updates](https://img.shields.io/badge/updates-Daily%20automated-informational.svg)](https://github.com/QudsLab/PQChub)
后量子密码学 (PQC) 的通用二进制分发。针对多平台提供预编译、即开即用的二进制文件。无需编译——下载即可使用! ## 快速开始 ### Python ``` from wrappers.python import Kyber512, Dilithium2 # Key Encapsulation (Kyber) kyber = Kyber512() public_key, secret_key = kyber.keypair() ciphertext, shared_secret = kyber.encapsulate(public_key) decrypted_secret = kyber.decapsulate(ciphertext, secret_key) # Digital Signatures (Dilithium) dilithium = Dilithium2() pk, sk = dilithium.keypair() message = b"Hello, post-quantum world!" signature = dilithium.sign(message, sk) assert dilithium.verify(message, signature, pk) ``` ### Node.js ``` const { Kyber512, Dilithium2 } = require('./wrappers/nodejs'); // Key Encapsulation const kyber = new Kyber512(); const { publicKey, secretKey } = kyber.keypair(); const { ciphertext, sharedSecret } = kyber.encapsulate(publicKey); const decryptedSecret = kyber.decapsulate(ciphertext, secretKey); // Digital Signatures const dilithium = new Dilithium2(); const keys = dilithium.keypair(); const message = Buffer.from("Hello, post-quantum world!"); const signature = dilithium.sign(message, keys.secretKey); const isValid = dilithium.verify(message, signature, keys.publicKey); ``` ## 支持的平台 | 平台 | 架构 | 状态 | 二进制文件 | |----------|-------------|--------|---------| | Linux | x86_64 | ✅ | `libpqc.so` | | Linux | aarch64 | ✅ | `libpqc.so` | | macOS | x86_64 (Intel) | ✅ | `libpqc.dylib` | | macOS | arm64 (Apple Silicon) | ✅ | `libpqc.dylib` | | Windows | x64 | ✅ | `pqc.dll` | | Windows | x86 | ✅ | `pqc.dll` | | Android | arm64-v8a | ✅ | `libpqc.so` | | Android | armeabi-v7a | ✅ | `libpqc.so` | | Android | x86_64 | ✅ | `libpqc.so` | | Android | x86 | ✅ | `libpqc.so` | ## 支持的算法 所有算法均源自 [PQClean](https://github.com/PQClean/PQClean),提供经 NIST 批准的后量子密码学实现。 ### 密钥封装机制 (KEM) | 算法 | 安全级别 | 公钥 | 私钥 | 密文 | 共享密钥 | |-----------|---------------|------------|------------|------------|---------------| | Kyber512 | 1 | 800 bytes | 1632 bytes | 768 bytes | 32 bytes | | Kyber768 | 3 | 1184 bytes | 2400 bytes | 1088 bytes | 32 bytes | | Kyber1024 | 5 | 1568 bytes | 3168 bytes | 1568 bytes | 32 bytes | ### 数字签名方案 | 算法 | 安全级别 | 公钥 | 私钥 | 签名 | |-----------|---------------|------------|------------|-----------| | Dilithium2 | 1 | 1312 bytes | 2528 bytes | ~2420 bytes | | Dilithium3 | 3 | 1952 bytes | 4000 bytes | ~3293 bytes | | Dilithium5 | 5 | 2592 bytes | 4864 bytes | ~4595 bytes | | Falcon-512 | 1 | 897 bytes | 1281 bytes | ~690 bytes | | Falcon-1024 | 5 | 1793 bytes | 2305 bytes | ~1330 bytes | ## 工作原理 ``` ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ PQClean │ ───> │ GitHub │ ───> │ Pre-compiled │ │ (upstream) │ │ Actions │ │ Binaries │ │ │ │ (daily) │ │ (committed) │ └─────────────────┘ └─────────────────┘ └─────────────────┘ │ ▼ ┌────────────────┐ │ Language │ │ Wrappers │ │ (FFI) │ └────────────────┘ ``` **一次构建,处处运行** — 通过 GitHub Actions 每日编译的原生二进制文件。语言无关的 FFI 包装器实现了零编译部署。只需克隆并使用预构建的二进制文件,即可获得来自 PQClean 上游的自动更新。 ## 二进制文件更新计划 二进制文件会自动更新: - **每周**:每周日 UTC 时间 00:00 - **手动**:通过 GitHub Actions 工作流调度 - **来源**:[PQClean master 分支](https://github.com/PQClean/PQClean) 的最新提交 请查看 `bins/BUILD_INFO.txt` 以获取最新的构建信息。 ## 贡献指南 欢迎贡献!贡献领域包括: - 添加更多算法 - 针对额外平台的语言包装器 - 性能优化 - 文档改进 请参阅 [GitHub Issues](https://github.com/QudsLab/PQChub/issues) 了解当前任务。 ## 安全提示 这是一个研究和教育项目。用于生产环境时: - 仔细审查代码 - 在您的环境中进行彻底测试 - 考虑使用官方 NIST 标准化的实现 - 保持二进制文件更新 - 咨询密码学专家 如需报告安全漏洞,请参阅 [SECURITY.md](SECURITY.md)。 ## 许可证 MIT 许可证 - 详情请参阅 [LICENSE](LICENSE) 文件。 ## 致谢 - **PQClean** — 干净、可移植的后量子密码学实现 - **NIST PQC** — 后量子密码学标准化项目 ## 链接 - [GitHub 仓库](https://github.com/QudsLab/PQChub) - [问题追踪器](https://github.com/QudsLab/PQChub/issues) - [PQClean 项目](https://github.com/PQClean/PQClean) - [NIST PQC](https://csrc.nist.gov/projects/post-quantum-cryptography) **由 [QudsLab](https://github.com/QudsLab) 用 ❤️ 制作**
标签:CVE, Dilithium, Falcon, FFI接口, JS文件枚举, Kyber, MITM代理, NIST标准化, PQC, PQClean, Python加密, 可视化界面, 后量子密码学, 多语言支持, 安全测试框架, 密码学库, 密钥封装, 开发工具包, 抗量子计算, 数字签名, 日志审计, 网络安全, 跨平台二进制, 逆向工具, 隐私保护, 零编译, 静态链接, 预编译库