CNG, CryptoServiceProvider and Managed implementations of HashAlgorithm

后端 未结 4 1710
不思量自难忘°
不思量自难忘° 2020-12-31 00:02

So I was wondering if there are any major differences between the various implementations of the hash algorithms, take the SHA series of algorithms for example. All of them

4条回答
  •  遥遥无期
    2020-12-31 00:43

    Another difference between the Managed and the CNG versions is the supported .Net Framework version: e.g.

    • the AES Managed version starts from 3.5, while the CNG from 4.6.2 and for
    • SHA512, Managed starts from 1.1 and Cng from 3.5.

    However, I believe that if we are not constrained by the framework version or to support legacy OS versions, we should use the CNG versions:

    • The hashing algorithms postfixed with Cng are the only ones that use bcrypt
    • The fact that it might take longer is actually an advantage as it protects from brute force attacks: on the user side 300ms or 3ms makes no difference, while for an attacker it is an order 100 magnitude!

提交回复
热议问题