How to set custom DH group in Java SSLEngine to prevent Logjam attack?

狂风中的少年 提交于 2019-12-05 17:40:23

问题


The new Logjam attack on TLS is based on common DH groups. This link recommends generating a new, custom 2048-bit DH group for each server.

How can I set a custom DH group in Java server code which uses SSLEngine?

ETA: would I be safe if I used only ephemeral DH cipher suites, i.e. ones with DHE or ECDHE and not DH or ECDH in their name? Or is this unrelated?


回答1:


Java (JCE/JSSE) uses DH parameters from some well known DSA groups. The JCE parameter generator allows only to produce groups with sizes between 512 and 1024 bit (or 2048), but the JSSE implementation on the other side only accepts custom sizes between 1024 and 2048.

This has the affect you cannot use any of the custom sizes, only 1024 or 2048 (with Java 8). Keep in mind that Java 7 still only uses 768 bit as a server (or 512 in exportable crypto mode).

Starting with version 8 Java servers use by default 1024 bit. You can increase the server side to 2048 bit with jdk.tls.ephemeralDHKeySize=2048. See Customizing Size of Ephemeral DH Keys.

Java as TLS client is less strict in older versions and accepts unsafe groups.

Update: with OpenJDK 8U65 (JSSE) there is a security property jdk.tls.server.defaultDHEParameters which can define finit-field parameters.



来源:https://stackoverflow.com/questions/30352105/how-to-set-custom-dh-group-in-java-sslengine-to-prevent-logjam-attack

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!