hyperpolymath/explicit-trust-plane

GitHub: hyperpolymath/explicit-trust-plane

该项目是一个基于 DNSSEC 的去中心化 PKI 框架,通过自动化脚本生成并经由 DNS 发布现代椭圆曲线加密身份与密钥材料。

Stars: 2 | Forks: 0

// SPDX-License-Identifier: MPL-2.0 // Copyright (c) Jonathan D.A. Jewell image:https://img.shields.io/badge/License-MPL_2.0--1.0-blue.svg[许可证: MPL-2.0,link="https://github.com/hyperpolymath/palimpsest-license"] // SPDX-FileCopyrightText: 2024 Hyperpolymath = Explicit Trust Plane image:https://img.shields.io/badge/OpenSSF-Best_Practices-green?logo=openssourcessecurity[OpenSSF 最佳实践,link="https://www.bestpractices.dev/en/projects/new?repo_url=https://github.com/hyperpolymath/explicit-trust-plane"] :author: Hyperpolymath :email: hyperpolymath@proton.me :revnumber: 1.0.0 :revdate: 2024-12-28 :toc: left :toclevels: 3 :icons: font :source-highlighter: rouge image:https://img.shields.io/badge/status-active-green[状态] image:https://img.shields.io/badge/DNSSEC-required-red[DNSSEC] ## 概述 *Explicit Trust Plane* 是一个用于发布 DNS 加密身份的框架,它将 DNS 视为去中心化的公钥基础设施(PKI),而不仅仅是一个命名系统。 ## [source] ## ┌─────────────────────────────────────────────────────────────────┐ │ EXPLICIT TRUST PLANE │ │ │ │ Your cryptographic identity, published via DNS │ │ │ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │ │ X.509 │ │ OpenPGP │ │ X25519 │ │ DANE │ │ │ │ Ed448 │ │ Ed25519 │ │ KEX │ │ TLSA │ │ │ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │ │ │ │ │ │ │ │ └─────────────┴──────┬──────┴─────────────┘ │ │ │ │ │ ┌──────▼──────┐ │ │ │ DNS │ │ │ │ + DNSSEC │ │ │ └─────────────┘ │ └─────────────────────────────────────────────────────────────────┘ ## 功能 * *现代密码学* - Ed448, Ed25519, X25519(无需传统的 RSA) * *算法敏捷性* - 为后量子迁移做好准备 * *自我主权身份* - 无中心化密钥服务器 * *可复现* - 脚本化密钥生成和 DNS 导出 * *显式角色分离* - 签名、密钥交换与身份验证分离 ## 快速开始 ## [source,bash] # 克隆代码库 git clone https://github.com/hyperpolymath/explicit-trust-plane.git cd explicit-trust-plane # 为您的域名生成所有加密材料 ./scripts/generate-ca.sh yourdomain.com ./scripts/generate-cert.sh yourdomain.com ./scripts/generate-kex.sh yourdomain.com ./scripts/generate-pgp.sh "Your Name" "you@yourdomain.com" # 导出 DNS 记录 ./scripts/export-dns.sh yourdomain.com # 查看生成的区域文件 ## cat dns/records/yourdomain.com.zone ## 项目结构 ## [source] ## explicit-trust-plane/ ├── ca/ # Certificate Authority materials │ ├── root/ # Ed448 Root CA (KEEP OFFLINE!) │ │ ├── ca-ed448.key # Private key (HSM recommended) │ │ ├── ca-ed448.crt # Root certificate │ │ └── ca-ed448.crt.b64 # Base64 for DNS │ └── intermediate/ # Ed448 Intermediate CA │ ├── intermediate-ed448.key │ ├── intermediate-ed448.crt │ └── chain.crt # Full certificate chain ├── certs/ # End-entity certificates │ ├── *.key # Ed25519 private keys │ ├── *.crt # Certificates │ └── *.crt.b64 # Base64 for DNS CERT records ├── pgp/ # OpenPGP keys │ ├── *.asc # ASCII armored public keys │ ├── *.pgp # Binary public keys │ └── *.pgp.b64 # Base64 for DNS CERT records ├── kex/ # Key exchange materials │ ├── *.x25519.key # X25519 private keys │ └── *.x25519.pub.b64 # Base64 for IPSECKEY records ├── dns/ # DNS zone files │ └── records/ # Generated zone includes ├── scripts/ # Automation scripts │ ├── generate-ca.sh # Create CA hierarchy │ ├── generate-cert.sh # Create server certificates │ ├── generate-pgp.sh # Create OpenPGP keys │ ├── generate-kex.sh # Create X25519 keys │ ├── export-dns.sh # Export all as DNS records │ └── rotate-keys.sh # Key rotation with backup └── docs/ # Documentation ├── DESIGN.adoc # Architecture & rationale └── DEPLOYMENT.adoc # End-to-end deployment guide ## 算法选择 [cols="1,1,2,2"] |=== | 算法 | 类型 | 用例 | DNS 记录类型 | Ed448 | 签名 | 长期 CA 证书 | CERT (PKIX) | Ed25519 | 签名 | 服务器证书, PGP 签名 | CERT (PKIX/PGP) | X25519 | 密钥交换 | TLS 1.3, VPN 引导 | IPSECKEY | SHA-256 | 哈希 | TLSA 指纹 | TLSA |=== 重要提示:这些是*不同的加密对象*,而不是同一密钥的多种编码方式。 ## DNS 记录类型 ### CERT 记录 (RFC 4398) ## [source,dns] ; X.509 Certificate _cert.example.com. IN CERT PKIX 0 0 ## ; OpenPGP Key _pgp.example.com. IN CERT PGP 0 0 ### IPSECKEY 记录 (RFC 4025) ## [source,dns] ## _ipsec.example.com. IN IPSECKEY 10 0 2 . ### TLSA 记录 (RFC 6698 - DANE) ## [source,dns] ## _443._tcp.example.com. IN TLSA 3 1 1 ## 安全要求 # [CAUTION] # *必须使用 DNSSEC。* 没有它,通过 DNS 发布的密钥可能会因缓存投毒攻击而被伪造。 * *禁用 MD5/SHA1* - 所有操作最低使用 SHA-256 * *仅限 HTTPS* - 任何配置中都不允许 HTTP URL * *CA 密钥须使用 HSM* - Root CA 私钥必须离线 * *密钥轮换* - 提供自动化轮换脚本 ## 最小可行集合 对于单一域名,您需要: 1. *1× Ed448 Root CA* - 离线,有效期 10 年 2. *1× Ed25519 服务器证书* - 用于 TLS 身份验证 3. *1× X25519 密钥* - 用于 TLS 1.3 密钥交换 4. *1× OpenPGP 密钥* - 用于人类身份标识 ## 文档 * link:docs/DESIGN.adoc[设计文档] - 完整的架构与设计理念 * link:docs/DEPLOYMENT.adoc[部署指南] - 端到端部署指南 ## 前置条件 * OpenSSL 3.0+(支持 Ed448/Ed25519) * GnuPG 2.2+(支持现代 ECC) * 启用 DNSSEC 的 DNS 区域 ## 检查您的版本: [source,bash] ## openssl version # OpenSSL 3.0.0 or later gpg --version # gnupg 2.2.0 or later ## 许可证 SPDX-License-Identifier: MPL-2.0 本项目基于 GNU Affero General Public License v3.0 或更高版本进行授权。 请参阅 link:CONTRIBUTING.md[CONTRIBUTING.md] 获取相关指南。 ## 作者 Hyperpolymath ## 架构 请参阅 link:TOPOLOGY.md[TOPOLOGY.md] 获取可视化架构图和完成度仪表盘。
标签:Cutter, DANE, DNS, 公钥基础设施, 安全测试工具, 密码学, 手动系统调用