Skip to content

Commit 42aa275

Browse files
committed
add chinese readme
1 parent f7ee82f commit 42aa275

2 files changed

Lines changed: 159 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[5]: https://img.shields.io/github/created-at/xtaci/dppk
88
[6]: https://img.shields.io/github/created-at/xtaci/dppk
99

10+
English | [简体中文](README.zh-CN.md)
1011

1112
[A Deterministic Polynomial Public Key Algorithm over a Prime Galois Field GF(p)](https://www.researchgate.net/profile/Randy-Kuang/publication/358101087_A_Deterministic_Polynomial_Public_Key_Algorithm_over_a_Prime_Galois_Field_GFp/links/61f95ff44393577abe055af7/A-Deterministic-Polynomial-Public-Key-Algorithm-over-a-Prime-Galois-Field-GFp.pdf)
1213

README.zh-CN.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
[![GoDoc][1]][2] [![Go Report Card][3]][4] [![CreatedAt][5]][6]
2+
3+
[1]: https://godoc.org/github.com/xtaci/dppk?status.svg
4+
[2]: https://pkg.go.dev/github.com/xtaci/dppk
5+
[3]: https://goreportcard.com/badge/github.com/xtaci/dppk
6+
[4]: https://goreportcard.com/report/github.com/xtaci/dppk
7+
[5]: https://img.shields.io/github/created-at/xtaci/dppk
8+
[6]: https://img.shields.io/github/created-at/xtaci/dppk
9+
10+
[English](README.md) | 简体中文
11+
12+
# 确定性多项式公钥算法 (DPPK)
13+
14+
[基于素数伽罗瓦域 GF(p) 的确定性多项式公钥算法](https://www.researchgate.net/profile/Randy-Kuang/publication/358101087_A_Deterministic_Polynomial_Public_Key_Algorithm_over_a_Prime_Galois_Field_GFp/links/61f95ff44393577abe055af7/A-Deterministic-Polynomial-Public-Key-Algorithm-over-a-Prime-Galois-Field-GFp.pdf)
15+
16+
DPPK 是一种[密钥封装机制](https://en.wikipedia.org/wiki/Key_encapsulation_mechanism)(Key Encapsulation Mechanism,KEM)。
17+
18+
## 概述
19+
20+
古老的[韦达定理](https://en.wikipedia.org/wiki/Vieta%27s_formulas)揭示了 n 次多项式的系数与其根之间的关系。令人惊讶的是,人们发现了一个潜在的公钥交换秘密:将多项式所有根的乘积(即常数项)与根乘积之和(即系数)解耦,从而建立密钥对。
21+
22+
## 核心原理
23+
24+
1. **因式分解依赖性**:DPPK 算法基于这样一个事实——没有常数项的多项式无法进行因式分解。
25+
2. **密钥对构造**:密钥对生成器将一个可在解密过程中消除的基础多项式,与两个可解多项式相结合,创建两个纠缠多项式。
26+
- **公钥**:由纠缠多项式的系数向量组成。
27+
- **私钥**:由纠缠多项式的常数项和两个可解多项式组成。
28+
29+
## 安全机制
30+
31+
- 仅发布多项式的系数而不发布其常数项,可极大限制通过多项式因式分解技术提取私钥的可能性。
32+
- 从公钥提取私钥的时间复杂度为:
33+
- **经典攻击**:超指数级难度 $O(p^2)$。
34+
- **量子攻击**:指数级难度 $O(p)$。
35+
- 相比之下,多项式因式分解问题(PFP)的复杂度为:
36+
- **经典攻击**:$O(n\sqrt{p})$。
37+
- **量子攻击**:$O(\sqrt{p})$,与 Grover 搜索算法的复杂度水平相当。
38+
39+
## 密钥对生成及加解密
40+
41+
- 密钥对构造的核心思想源于韦达定理,通过将多项式系数解耦为两类:
42+
- **私有部分**:来自常数项。
43+
- **公开部分**:来自不定元 $x$ 的系数。
44+
45+
- DPPK 使用两个纠缠的通用多项式,它们基于一个公共基础多项式 $B_n(x)$ 和两个可解多项式 $u(x)$ 和 $v(x)$:
46+
- **公钥**:纠缠多项式的所有系数。
47+
- **私钥**:它们的常数项和两个可解多项式。
48+
49+
## 安全性分析
50+
51+
- **确定性时间复杂度**
52+
- **经典攻击**:$O(\sqrt{p})$(超指数级难度)。
53+
- **量子攻击**:$O(p)$(指数级难度)。
54+
55+
## 安装
56+
57+
使用以下命令安装 DPPK:
58+
```console
59+
go get -u github.com/xtaci/dppk
60+
```
61+
62+
## 使用示例
63+
64+
### 密钥对生成
65+
```go
66+
package main
67+
68+
import (
69+
"github.com/xtaci/dppk"
70+
"log"
71+
)
72+
73+
func main() {
74+
// 为 Alice 生成密钥
75+
alice, err := dppk.GenerateKey(10)
76+
if err != nil {
77+
log.Fatal(err)
78+
}
79+
80+
// 为 Bob 生成密钥
81+
bob, err := dppk.GenerateKey(10)
82+
if err != nil {
83+
log.Fatal(err)
84+
}
85+
86+
log.Println("Alice 的公钥:", alice.PublicKey)
87+
log.Println("Bob 的公钥:", bob.PublicKey)
88+
}
89+
```
90+
91+
### 加密
92+
```go
93+
package main
94+
95+
import (
96+
"github.com/xtaci/dppk"
97+
"log"
98+
)
99+
100+
func main() {
101+
// 假设 alice 和 bob 已生成密钥
102+
alice, _ := dppk.GenerateKey(10)
103+
bob, _ := dppk.GenerateKey(10)
104+
105+
// 待加密的消息
106+
secret := []byte("hello quantum")
107+
108+
// Bob 为 Alice 加密消息
109+
kem, err := dppk.Encrypt(&alice.PublicKey, secret)
110+
if err != nil {
111+
log.Fatal(err)
112+
}
113+
114+
log.Printf("KEM: %+v\n", kem)
115+
}
116+
```
117+
118+
### 解密
119+
```go
120+
package main
121+
122+
import (
123+
"github.com/xtaci/dppk"
124+
"log"
125+
)
126+
127+
func main() {
128+
// 假设 alice 和 bob 已生成密钥,且 bob 已加密消息
129+
alice, _ := dppk.GenerateKey(10)
130+
bob, _ := dppk.GenerateKey(10)
131+
secret := []byte("hello quantum")
132+
kem, _ := dppk.Encrypt(&alice.PublicKey, secret)
133+
134+
// Alice 解密消息
135+
plaintext, err := alice.DecryptMessage(kem)
136+
if err != nil {
137+
log.Fatal(err)
138+
}
139+
140+
log.Println("恢复的消息:", string(plaintext))
141+
}
142+
```
143+
144+
## 贡献
145+
146+
欢迎贡献!如需改进、修复错误或添加新功能,请提交 issue 或 pull request。
147+
148+
## 许可证
149+
150+
本项目采用 GPLv3 许可证。详见 [LICENSE](LICENSE) 文件。
151+
152+
## 参考文献
153+
154+
更多详细信息,请参阅[研究论文](https://www.researchgate.net/profile/Randy-Kuang/publication/358101087_A_Deterministic_Polynomial_Public_Key_Algorithm_over_a_Prime_Galois_Field_GFp/links/61f95ff44393577abe055af7/A-Deterministic-Polynomial-Public-Key-Algorithm-over-a-Prime-Galois-Field-GFp.pdf)
155+
156+
## 致谢
157+
158+
特别感谢 DPPK 研究论文的作者们在这一领域的开创性工作。

0 commit comments

Comments
 (0)