---
title: "密钥管理"
canonical_url: "https://yangqiuyi.com/blog/da-xue/xin-xi-an-quan/mi-yao-guan-li"
---

> Index of every page on this site: [llms.txt](https://yangqiuyi.com/llms.txt)

1. WiFi的密钥
2. 对称密钥的分发
3. 公钥加密体制的密钥管理
4. 秘密分享

## 0. WIFI

1. 家用WiFi（临时Key）
WPA2-PSK模式下，TK的产生过程为：
PSK(无线网络密码) -> PMK -> PTK -> TK(临时Key)
Pmk = hash(PSK || ssid)
所以家用WiFi生成的PMK是固定的9
2. 企业WiFi（临时Key+随机数）
WPA2-Enterprise模式下，TK产生过程：
xxxx -> PMK->TK
Pmk = hash(masterKey, snonce, anonce)
snonce & anonce 是两个随机数

## 1. 对称密钥的分发

1. 一方产生，然后安全传给另一方
eg: Key和消息不走同一个信道，比如短信验证码
2. 两方协商产生
Diffie-Hellman密钥协商协议:
Alice <----> Bob
Alice --g--> Bob
Alice <--p-- Bob
Alice --y1--> Bob
Alice <--y2-- Bob
y1 = g^a mod p
y2 = p^b mod g
y1 & y2 是加密的消息，a & b是私钥
Alice 获取到y2之后， msg1 = y2^a mod p
Bob 获取到y1之后， msg2 = y1^b mod p
最后 msg1 = msg2
3. 通过可信赖的第三方参与产生(太复杂了)

## 2. 公钥加密体制的密钥管理

网络证书颁发机构（赛门杰克）

## 3. 秘密分割

1. (k,n)秘密分割门限方案
2. 可验证秘密分享

## Sitemap

See the full [sitemap](https://yangqiuyi.com/sitemap.md) for all pages.
