浅析Diffie–Hellman
一、作者
这个密钥交换方法,由惠特菲尔德·迪菲(Bailey Whitfield Diffie)、马丁·赫尔曼(Martin Edward Hellman)于1976年发表。
二、说明
它是一种安全协议,让双方在完全没有对方任何预先信息的条件下通过不安全信道建立起一个密钥,这个密钥一般作为“对称加密”的密钥而被双方在后续数据传输中使用。DH数学原理是base离散对数问题。做类似事情的还有非对称加密类算法,如:RSA。
三、应用场景
其应用非常广泛,在SSH、VPN、Https...都有应用,勘称现代密码基石。
四、DH算法描述
DH算法是相当简单、直观的,我直接把wikipedia的描述拿过来了:

上图中,Alice和Bob通过DH算法生成秘钥K,
其中:
- g、p是2个非私密数据;
- a、b是私密数据;
- A是根据:g、p、a算出来的非私密数据;B是根据:g、p、b算出来的非私密数据;
- 把A从a传到b,根据求K公式,b得到秘钥k;a同理;
注:
- p是一个大素数。p的位数决定了攻击者破解的难度。
- g则不需要很大,并且在一般的实践中通常是2或者5。
再来个直观的图说明下:

五、安全与风险
- 爆破成本:
How enormous a computation, you ask? Possibly a technical feat on a scale (relative to the state of computing at the time) not seen since the Enigma cryptanalysis during World War II. Even estimating the difficulty is tricky, due to the complexity of the algorithm involved, but our paper gives some conservative estimates. For the most common strength of Diffie-Hellman (1024 bits), it would cost a few hundred million dollars to build a machine, based on special purpose hardware, that would be able to crack one Diffie-Hellman prime every year. 美国NSA几亿美元的破译机,每年可以破一个1024bit的Diffie-Hellman素数。不过呢,一个1024bit素数的破解也是很致命的......而512bit,现在被认为是非常容易破解的。 - 泄密风险:私密数据a,b在生成K后将被丢弃,因此不存在a,b过长时间存在导致增加泄密风险。
- 中间人攻击:由于DH在传输p,g时并无身份验证,所以有机会被实施中间人攻击,替换双方传输时的数据。
六、参考引用
- 《迪菲-赫尔曼密钥交换》
- 《How is NSA breaking so much crypto?》
- 《Diffie Hellman key exchange (1024 bit) unreliable》
- 《Weak Diffie-Hellman and the Logjam Attack》
浅析Diffie–Hellman的更多相关文章
- 深入浅出Diffie–Hellman
一.作者 这个密钥交换方法,由惠特菲尔德·迪菲(Bailey Whitfield Diffie).马丁·赫尔曼(Martin Edward Hellman)于1976年发表. 二.说明 它是一种安全协 ...
- Diffie–Hellman key exchange
General overview[edit] Illustration of the idea behind Diffie–Hellman key exchange Diffie–Hellman ...
- Node.js 内置模块crypto加密模块(4) Diffie Hellman
Diffie-Hellman( DH ):密钥交换协议/算法 ( Diffie-Hellman Key Exchange/Agreement Algorithm ) 百科摘录: Diffie-Hell ...
- openssl之DH(Diffie–Hellman)加密
//加密机制初始化 g_HDMgr.init(); //对方的public key BIGNUM* peerPubKey = NULL; peerPubKey = BN_bin2bn((unsigne ...
- OPENVPN+MYSQL认证+客户端配置
安装环境:ubuntu 12.04 x64 一 服务器端 1.安装openvpn及相应包 1 2 root@jkb:~# aptitude install openvpn root@jkb:~# ap ...
- 烂泥:openvpn配置文件详解
本文由秀依林枫提供友情赞助,首发于烂泥行天下 在上一篇文章<烂泥:ubuntu 14.04搭建OpenVPN服务器>中,我们主要讲解了openvpn的搭建与使用,这篇文章我们来详细介绍下有 ...
- Microsoft Azure Point to Site VPN替代方案
Microsoft Azure提供了Point to Site VPN,但有时候这并不能满足我们的需求,例如:Point to Site VPN是SSTP VPN,只能支持Window客户端拨入,而且 ...
- How To Set Up an OpenVPN Server on Ubuntu 14.04
Prerequisites The only prerequisite is having a Ubuntu 14.04 Droplet established and running. You wi ...
- 理解 HTTPS 的工作原理
目标读者:理解HTTP协议,对称和非对称加密,想要了解HTTPS协议的工作原理. 读完本文,你能明白 什么是HTTPS,TLS(SSL),TLS和HTTPS是什么关系? 什么是证书和数字签名,它们是如 ...
随机推荐
- css3——border-image属性的用法
项目需求是实现鼠标移到按钮上时,下方显示一张渐变的三角图片,于是想到使用border-image来实现. 实现;//向外偏移10px,可使边框内部的内容不是那么紧凑border-image-repea ...
- ubuntu,装完PYTHON3 pip3 install 报错
ubuntu,装完PYTHON3 pip3 install 报错CalledProcessError: Command 'lsb_release -a' returned non-zero exit ...
- requireJS简单应用
项目结构目录: Html页面 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> < ...
- Jmeter(1)介绍
JMeter是什么东西 Jmeter(Apache JMeter)是一个100%基于JAVA的应用程序,它的功能是 分析和衡量 web应用程序和各种服务的性能和负载能力 Jmeter不是一个浏览器,它 ...
- bootstrap-typeahead 自动补全简单的使用教程
参考链接: 参考1 : https://segmentfault.com/a/1190000006036166参考2 : https://blog.csdn.net/u010174173/articl ...
- CocosCraetor中图像资源Texture和SpriteFrame的区别
Texture是保存在GPU缓冲中的一张纹理.是由一张图片创建获得的. SpriteFrame是Texture+Rect,根据一张纹理材质来剪切获得. SpriteFrame是Texture+Rect ...
- swoole websocket服务推送
用过workerman, 两个字"好用",对于swoole最近有时间也研究研究 swoole的websocket 很好实现 如官网 https://wiki.swoole.com/ ...
- UOJ#349. 【WC2018】即时战略
原文链接https://www.cnblogs.com/zhouzhendong/p/UOJ349.html 题解 被cqz D没了.我D cly 关你啥事(逃 首先链的情况直接rand就好了. 期望 ...
- 在命令行输入python出现“Warning:This Python interpreter is in a conda environment, but the environment has not been activated. Libraries may fail to load. To activate this environment please see https://conda.
[现象] 在命令行输入python出现“Warning:This Python interpreter is in a conda environment, but the environment h ...
- JSP(一):JSP概要
问题: 在学习了 Servlet 之后,使用 Servlet 进行页面的展现,代码书写过于麻烦.极大的影响了开发的效率,那么有没有一种方式可以让我们像以前写网页一样来进行网页的编程工作呢? 解决: 使 ...