<p>You should basically <em>never</em> choose FIPS-140 unless you have no choice. FIPS-140 compliance is provided primarily for people who must comply with FIPS-140 for regulatory or policy reasons.</p>

<p>Note that that's not to say FIPS-140 <em>validation</em> is bad. It's great. If it finds bugs or problems, that's a pure win. If you have a choice between an implementation that has been FIPS validated and one that has not, the former is the better choice. But that has nothing to do with whether you enable FIPS-140 modes.</p>

<p>Your implementation has been FIPS validated. <em>Don't</em> brain damage it.</p>

CC BY-SA 3.0
2012-12-19T00:47:05.720Z
Would upvote if you said why FIPS-140 is less desirable.
Highly Irregular
CC BY-SA 3.0
2012-12-19T03:51:19.940Z
Too many reasons. For one thing, say you find a bug in your FIPS validated code. Do you pay $35,000 to fix it (since you'll need a new validation) or do you leave the bug in? And FIPS requires you to break things that are perfectly capable of working. Also, FIPS modes are maintained under the assumption that nobody will ever enable them. They're only there so that you can put a checkmark in the "FIPS validated" box. If you enable FIPS mode and something doesn't work and you file a bug report, you will be told "disable FIPS mode".
David Schwartz
CC BY-SA 3.0
2012-12-14T02:10:02.660Z
2012-12-14T02:10:02.660Z
David Schwartz
<p>Here are some performance stats I've come up with so far for my C# implementation:</p>

<p>A single ECC public key (after the ECC operation) can have the Base58Checked algorithm applied at this rate</p>

<pre><code>   Algorithm                             Time for 100,000 Base58Check(byte[] key)
   ------------------------------       ---------------------------------------------
   SHA256Managed()                       4500ms
   SHA256CryptoServiceProvider()         3640ms  &lt;--- CSP FIPS version
</code></pre>

<p>So yes, the FIPS validated version is faster &amp; likely better.</p>

CC BY-SA 3.0
2012-12-18T19:24:08.760Z
2012-12-19T04:44:37.490Z
2012-12-19T04:44:37.490Z
makerofthings7
<p>I'm implementing part of the Bitcoin client in C# and noticed that I have the choice between <a href="http://en.wikipedia.org/wiki/FIPS_140-2" rel="nofollow">FIPS 140-2</a> and non certified versions of SHA256.  Supposedly both versions give the same hash.</p>

<p>Does the choice of SHA-2 library matter for Bitcoin?  Does the FIPS-2 library exist in Mono and mobile devices?</p>

CC BY-SA 3.0
2012-12-19T00:45:42.707Z
"Does the choice of SHA-2 library for Bitcoin?" Does it what? Is there a grammatical error in that sentence?
Highly Irregular
CC BY-SA 3.0
2012-12-19T01:01:18.230Z
@HighlyIrregular Oops & TY. I missed a word while typing on my cell phone.  Incomplete sentences seem to
makerofthings7
<development><encryption><c#>
Does FIPS 140-2 crypto certification matter for Bitcoin?
makerofthings7
# Does FIPS 140-2 crypto certification matter for Bitcoin?

(Asked by: username_0 on 2012-12-13)

I'm implementing part of the Bitcoin client in C# and noticed that I have the choice between [FIPS 140-2](http://en.wikipedia.org/wiki/FIPS_140-2) and non certified versions of SHA256. Supposedly both versions give the same hash.

Does the choice of SHA-2 library matter for Bitcoin? Does the FIPS-2 library exist in Mono and mobile devices?

**Tags:** development, encryption, c#

> **Comments:**
> **username_1**: "Does the choice of SHA-2 library for Bitcoin?" Does it what? Is there a grammatical error in that sentence?  
> **username_0**: @HighlyIrregular Oops & TY. I missed a word while typing on my cell phone.  Incomplete sentences seem to  

---

## 2 answers

### Answer by username_2 on 2012-12-14. Score: 2

You should basically *never* choose FIPS-140 unless you have no choice. FIPS-140 compliance is provided primarily for people who must comply with FIPS-140 for regulatory or policy reasons.

Note that that's not to say FIPS-140 *validation* is bad. It's great. If it finds bugs or problems, that's a pure win. If you have a choice between an implementation that has been FIPS validated and one that has not, the former is the better choice. But that has nothing to do with whether you enable FIPS-140 modes.

Your implementation has been FIPS validated. *Don't* brain damage it.

> **Comments:**
> **username_1**: Would upvote if you said why FIPS-140 is less desirable.  
> **username_2**: Too many reasons. For one thing, say you find a bug in your FIPS validated code. Do you pay $35,000 to fix it (since you'll need a new validation) or do you leave the bug in? And FIPS requires you to break things that are perfectly capable of working. Also, FIPS modes are maintained under the assumption that nobody will ever enable them. They're only there so that you can put a checkmark in the "FIPS validated" box. If you enable FIPS mode and something doesn't work and you file a bug report, you will be told "disable FIPS mode".  

---

### Answer by username_0 on 2012-12-18. Score: 1

Here are some performance stats I've come up with so far for my C# implementation:
A single ECC public key (after the ECC operation) can have the Base58Checked algorithm applied at this rate
   Algorithm                             Time for 100,000 Base58Check(byte[] key)
   ------------------------------       ---------------------------------------------
   SHA256Managed()                       4500ms
   SHA256CryptoServiceProvider()         3640ms  <--- CSP FIPS version

So yes, the FIPS validated version is faster & likely better.


---

