3

Diffie Hellman 密钥交换原理、教程

 2 years ago
source link: https://blog.kamino.link/2022/03/31/DiffieHellman/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Diffie Hellman 密钥交换原理、教程

密钥交换指的是两名用户在不安全信道中,在没有任何预先消息的情况下商量出一个密钥,从而建立一个安全信道。

Diffie和Hellman是两个人,他们在1976年发明了这个算法。

算法安全性基于离散对数问题:已知p是质数,g和x是整数,计算y=gxmodp快。但是已知p,g,y,计算x很困难。

  1. Alice和Bob先选择一个质数p和一个整数g(公开)
  2. Alice选择一个秘密整数a,计算A=gamodp,然后将A发送给Bob(A公开)
  3. Bob选择一个秘密整数b,计算B=gbmodp,然后将B发送给Alice(B公开)
  4. Alice计算Ka=Bamodp=gabmodp。
  5. Bob计算Kb=Abmodp=gabmodp。
  6. 可知Ka=Kb

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK