# FIPS ready for SSL - DHEC key exchange

**URL:** <https://discourse.mailinabox.email/t/fips-ready-for-ssl-dhec-key-exchange/76>\
**Category:** Improvements\
**Created:** [September 18, 2014, 7:33pm UTC](https://discourse.mailinabox.email/t/fips-ready-for-ssl-dhec-key-exchange/76 "2014-09-18T19:33:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![madmax](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.mailinabox.email/u/madmax)\
**Post date:** [September 18, 2014, 7:33pm UTC](https://discourse.mailinabox.email/t/fips-ready-for-ssl-dhec-key-exchange/76/1 "2014-09-18T19:33:01Z")

</div>

Is it worth adding cipher suites and generating DH elliptic curve key to become compliant with FIPS ?

I edited nginx-ssl.conf for cipher suites, enabled DHEC and generated DHEC 4096 key.

I guess if you add this to initial setup, you would want to generate the key on different thread because it takes a while to generate. I fork this and made commit to my res. I wanted to get feedback if this is worth the time.

---

<div class="post-metadata">

**Author:** ![JoshData](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/joshdata/32/2153_2.png) [@JoshData](https://discourse.mailinabox.email/u/JoshData)\
**Post date:** [September 20, 2014, 12:04pm UTC](https://discourse.mailinabox.email/t/fips-ready-for-ssl-dhec-key-exchange/76/2 "2014-09-20T12:04:46Z")

</div>

Can you post your changes and a link that documents what is required for FIPS compliance?

---

<div class="post-metadata">

**Author:** ![madmax](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.mailinabox.email/u/madmax)\
**Post date:** [September 21, 2014, 4:54am UTC](https://discourse.mailinabox.email/t/fips-ready-for-ssl-dhec-key-exchange/76/3 "2014-09-21T04:54:28Z")

</div>

I digress from my original posting and move to different direction. I believe the current Nginx SSL settings ARE FIPSv2 compliant. Not sure for v3 but its not public yet. I’m not sure why it wasn’t compliant at first when I did my testing at Qualys on the SSL.  
I went back added your protocols and the results were FIPS ready . My certification might not of been right initially when I first did the test.

For Qualys requirements to past there test.

> **[ssllabs/research](https://github.com/ssllabs/research/wiki/FIPS-Requirements)**
>
> Contribute to ssllabs/research development by creating an account on GitHub.

With that being said currently settings do not have elliptical curve enable. To make that happen you have to generate a 2048 bit key and on most computers that doesn’t take to long. On 1 GB digital ocean a 4096 bit key takes a long time. So I can’t I see that being done at install, at least not at default.

I wrote a tool script for mail-in-a-box to just install DHEC.

But there’s a additional option for a more conservative cipher suite but be advise your limiting your coverage to the newest technology. It limits the cipher suites to 256 and EC. Also limits to TLS1.2. I think Qualys shows only the newest browsers and phones are able to support the protocols  
I can think there are many good reasons why a user would want these settings. But at the same time I can count the number of users on my system so I know coverage and efficiency isn’t issue for me. I used this to get a complete 100 across the board at Qualys for all four categories for my website.

Use as reference to achieve an 100:

> **[100% Qualys SSL Test A+](https://blog.roushtech.net/2014/04/01/100-qualys-ssl-test-a/)**
>
> For fun we're going to poke at what it takes to score 100 across the board with Qualys SSL Server Test -- however impractical this configuration may actually be.

For explanation for anyone that doesn’t know what FIPS is, like me. Here are some resources.

> **[FIPS Mode - an explanation](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/FIPS_Mode_-_an_explanation)**
>
> NSS has a "FIPS Mode" that can be enabled when NSS is compiled in a specific way. (Note: Mozilla does not distribute a "FIPS Mode"-ready NSS with Firefox.) This page attempts to provide an informal explanation of what it is, who would use it,...

  

> **[FIPS 140-2](https://en.wikipedia.org/wiki/FIPS_140-2)**
>
> The Federal Information Processing Standard Publication 140-2, (FIPS PUB 140-2), is a U.S. government computer security standard used to approve cryptographic modules. The title is Security Requirements for Cryptographic Modules. Initial publication was on May 25, 2001 and was last updated December 3, 2002.
> Its successor FIPS 140-3 was approved on March 22, 2019 and became effective on September 22, 2019. FIPS 140-3 testing began on September 22, 2020, although no FIPS 140-3 validation certif...

Finally my code.

[https://raw.githubusercontent.com/jko11222/mailinabox/ssl\_branch/tools/ssl\_dhec.sh](https://raw.githubusercontent.com/jko11222/mailinabox/ssl_branch/tools/ssl_dhec.sh)

---

<div class="post-metadata">

**Author:** ![JoshData](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/joshdata/32/2153_2.png) [@JoshData](https://discourse.mailinabox.email/u/JoshData)\
**Post date:** [September 21, 2014, 1:02pm UTC](https://discourse.mailinabox.email/t/fips-ready-for-ssl-dhec-key-exchange/76/4 "2014-09-21T13:02:37Z")

</div>

Hey thanks.

I don’t entirely understand how this all works. The DHEC parameters are used by nginx in addition to the RSA-based SSL certificate _if_ DHEC ciphers are selected for the connection?

---

<div class="post-metadata">

**Author:** ![madmax](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.mailinabox.email/u/madmax)\
**Post date:** [September 21, 2014, 2:16pm UTC](https://discourse.mailinabox.email/t/fips-ready-for-ssl-dhec-key-exchange/76/5 "2014-09-21T14:16:39Z")

</div>

Essentially, you have to understand the exchanging of keys to understand this. A new trend has been perfect forward secrecy to protect the exchange of keys. There’s a negotiation process between the exchanging RSA certs but if the exchange is intercepted and the attacker gets the private keys and captures traffic, then its all for nothing, MITM attack. Perfect forward secrecy address this problem by using strong session keys which becomes very hard to break. Your keys are random per session and deterministic so past messages can not be compromise if other messages are compromise. The RSA private key is used the sign the DH handshake which then the exchange of DH keys happen.

Here are some resources:

> **[SSL Labs: Deploying Forward Secrecy | Qualys Security Blog](https://blog.qualys.com/product-tech/2013/06/25/ssl-labs-deploying-forward-secrecy)**
>
> With revelations about mass surveillance in the news everywhere, an obscure feature of SSL/TLS called Forward Secrecy has suddenly become very interesting.

  

> **[Strong SSL Security on nginx - Raymii.org](https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html)**

  

> **[Diffie Hellman - OpenSSLWiki](https://wiki.openssl.org/index.php/Diffie_Hellman)**

  
[http://baudehlo.com/2013/06/24/setting-up-perfect-forward-secrecy-for-nginx-or-stud/](http://baudehlo.com/2013/06/24/setting-up-perfect-forward-secrecy-for-nginx-or-stud/)  

> **[Forward secrecy](https://en.wikipedia.org/wiki/Forward_secrecy#Perfect_forward_secrecy)**
>
> In cryptography, forward secrecy (FS), also known as perfect forward secrecy (PFS), is a feature of specific key agreement protocols that gives assurances that session keys will not be compromised even if long-term secrets used in the session key exchange are compromised. For HTTPS the long-term secret is typically the private signing key of the server. Forward secrecy protects past sessions against future compromises of keys or passwords. By generating a unique session key for every session a us...

  

> **[SSL Enabling Forward Secrecy | DigiCert.com](https://www.digicert.com/kb/ssl-support/ssl-enabling-perfect-forward-secrecy.htm)**

---

<div class="post-metadata">

**Author:** ![JoshData](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/joshdata/32/2153_2.png) [@JoshData](https://discourse.mailinabox.email/u/JoshData)\
**Post date:** [September 26, 2014, 10:09pm UTC](https://discourse.mailinabox.email/t/fips-ready-for-ssl-dhec-key-exchange/76/6 "2014-09-26T22:09:58Z")

</div>

Hey,

Check out this commit (including the log message):

> <https://github.com/mail-in-a-box/mailinabox/commit/39bca053edbcfa149a283e3be0cb770460d327e0>

---

<div class="post-metadata">

**Author:** ![madmax](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.mailinabox.email/u/madmax)\
**Post date:** [September 28, 2014, 8:15pm UTC](https://discourse.mailinabox.email/t/fips-ready-for-ssl-dhec-key-exchange/76/7 "2014-09-28T20:15:31Z")

</div>

This is good stuff. I will look into dovecot. I’m curious what went wrong. Any details on on why or what went wrong? I personally didn’t mess with postfix or dovecot yet.

The 256 is the cipher strength. The strength of the encryption of the data being transmitted. So the connections is being encrypted with AES 256 bit. The RSA is for signing and handshaking and hashing is for integrity .

Here’s some quick references for the abbreviations:

[https://www.thesprawl.org/research/tls-and-ssl-cipher-suites/](https://www.thesprawl.org/research/tls-and-ssl-cipher-suites/)  
[https://www.openssl.org/docs/apps/ciphers.html#Elliptic\_curve\_cipher\_suites\_](https://www.openssl.org/docs/apps/ciphers.html#Elliptic_curve_cipher_suites_)

[http://crypto.stackexchange.com/questions/653/basic-explanation-of-elliptic-curve-cryptography](http://crypto.stackexchange.com/questions/653/basic-explanation-of-elliptic-curve-cryptography)

---

<div class="post-metadata">

**Author:** ![DrMartin](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/drmartin/32/2755_2.png) [@DrMartin](https://discourse.mailinabox.email/u/DrMartin)\
**Post date:** [April 12, 2015, 7:17am UTC](https://discourse.mailinabox.email/t/fips-ready-for-ssl-dhec-key-exchange/76/8 "2015-04-12T07:17:24Z")

</div>

It would be nice if there was an option to generate and use a 4096 bit key instead of 2048. EC keys are great but there are many CA’s, like StartCom, which only support RSA.

I don’t know if this necessarily helps some of the stronger FIPS implementations but it is borderline industry standard now.

---

<div class="post-metadata">

**Author:** ![JoshData](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/joshdata/32/2153_2.png) [@JoshData](https://discourse.mailinabox.email/u/JoshData)\
**Post date:** [April 12, 2015, 10:48am UTC](https://discourse.mailinabox.email/t/fips-ready-for-ssl-dhec-key-exchange/76/9 "2015-04-12T10:48:09Z")

</div>

We’re not going to add any options to the setup — it makes it too complicated both for the user and for me to maintain. We can switch everyone over to 4096 bits, but I think that’s premature for now (and we would have to check compatibility with CAs).
