当前位置:网站首页>8.1 Diffie-Hellman密钥交换
8.1 Diffie-Hellman密钥交换
2022-07-26 17:11:00 【碳烤小肥羊。。。】
Diffie-Hellman密钥交换(DHKE)方案提供了实际中密钥分配问题的解决方案,即它允许双方通过不安全的信道进行交流,得到一个共同密钥。DHKE的基本思想为, Z p ∗ Z^*_p Zp∗内的指数运算(p是素数)是单向函数,并且该指数运算是可交换的,即: k = ( a x ) y = ≡ ( a y ) x m o d p k = (a^x)^y =\equiv (a^y)^x mod p k=(ax)y=≡(ay)xmodp
值 k = ( a x ) y = ≡ ( a y ) x m o d p k = (a^x)^y =\equiv (a^y)^x mod p k=(ax)y=≡(ay)xmodp是一个联合密钥,它可以当做通信双方的会话密钥使用。
Diffie-Hellman密钥交换协议在 Z p ∗ Z^*_p Zp∗的工作方式
这个协议拥有两个参与方,Alice和 Bob,他们将建立一个共享密钥。可能存在一个值得信赖的第三方,该方能恰当地选择密钥交换所需的公开参数。然而,Alice或Bob也可能生成公开参数。严格来讲,DHKE协议由两个协议组成:握手协议和主要协议; 其中主要协议负责执行真正的密钥交换。
Diffie-Hellman握手协议
- 选择一个大素数 p p p。
- 选择一个整数 α ∈ { 2 , 3 , 4 , . . . . , p − 2 } \alpha \in \{2, 3, 4, ...., p-2\} α∈{ 2,3,4,....,p−2}。
- 公开 p p p和 α \alpha α
Diffie-Hellman密钥交换
下面来证明协议的正确性,即 Alice和 Bob实际上计算的都是相同的会话密钥 k A B k_{AB} kAB
证明: Alice计算 B α ≡ ( α b ) a ≡ α a b m o d p B^\alpha \equiv ({\alpha}^b)^a \equiv {\alpha}^{ab} mod p Bα≡(αb)a≡αabmodp
而Bob计算 A b ≡ ( α a ) b ≡ α a b m o d p A^b \equiv ({\alpha}^a)^b \equiv {\alpha}^{ab} mod p Ab≡(αa)b≡αabmodp
因此Alice和 Bob都共享会话密钥 k A B = α a b m o d p k_{AB} = {\alpha}^{ab} mod p kAB=αabmodp。这个密钥可以用来在Alice和 Bob之间建立一个安全的通信,比如将 k A B k_{AB} kAB用作类似AES或3DES等对称算法的密钥。
示例:Diffie-Hellman的域参数为 p = 29 , α = 2 p = 29, α =2 p=29,α=2。此协议的处理过程如下:
双方计算得到的值都是 k A B = 16 k_{AB} = 16 kAB=16, 这个值可以当做联合密钥使用,比如作为对称加密中的会话密钥。
参考资料:《深入浅出密码学》–Christof Paar,Jan Pelzl著
边栏推荐
- URL跳转漏洞
- How to set IP for layer 2 management switches
- Come on developer! Not only for the 200000 bonus, try the best "building blocks" for a brainstorming
- Zhaoqi science and technology innovation overseas high-level talent introduction platform, entrepreneurship event Roadshow
- URL jump vulnerability
- AI遮天传 ML-无监督学习
- 来吧开发者!不只为了 20 万奖金,试试用最好的“积木”来一场头脑风暴吧!
- 8、 Topic communication: topic substitution and monitoring
- The user experience center of Analysys Qianfan bank was established to help upgrade the user experience of the banking industry
- Is it safe for Changzheng securities to open an account?
猜你喜欢

ACL实验演示(Huawei路由器设备配置)

Performance tuning bugs emerge in endlessly? These three documents can easily handle JVM tuning

Hardware development and market industry
![[virtual machine data recovery] data recovery cases in which XenServer virtual machine is unavailable due to accidental power failure and virtual disk files are lost](/img/99/e5404a09ec7f52a7c5d7be23e43e85.jpg)
[virtual machine data recovery] data recovery cases in which XenServer virtual machine is unavailable due to accidental power failure and virtual disk files are lost

Relative path and absolute path
![[training Day2] sculpture](/img/d9/2e2ee8b4d995a29204afba889da635.png)
[training Day2] sculpture

【元宇宙欧米说】剖析 Web3 风险挑战,构筑 Web3 生态安全
![Cloud rendering volume cloud [theoretical basis and implementation scheme]](/img/38/0e97d6f015f3cb51e872a8d3ce584a.png)
Cloud rendering volume cloud [theoretical basis and implementation scheme]

Cross site scripting attack (XSS)

【云原生】 iVX 低代码开发 引入腾讯地图并在线预览
随机推荐
VIM multiline operation
1、 C language program structure, compilation and operation, data type related
[Day2] cinema ticket
What is the PMP exam outline in 2022?
The database uses PSQL and JDBC to connect remotely and disconnect automatically from time to time
5、 Parameter server principle, code implementation
PMP Exam details, what changes have been made to the new exam outline?
【集训Day2】Sculpture
JS closure simulates private variable interview questions and immediately executes function Iife
【静态代码质量分析工具】上海道宁为您带来SonarSource/SonarQube下载、试用、教程
【集训Day3】delete
[template] segment tree 1
【模板】线段树 1
【数字IC】深入浅出理解AXI-Lite协议
CCS tm4c123 new project
[Oumi reading club] talk about the creator economy in the meta universe: infinite dimension
Sequential storage structure of linear table -- sequential table
我要开中信的证券账户找渠道的经理开安全吗?
Week 16 OJ practice 1 calculates the day of the year
Spark data format unsafe row