Which one to use: Managed vs. NonManaged hashing algorithms

后端 未结 6 1812
离开以前
离开以前 2021-01-01 14:03

In a regular C# application which class to use for hashing: xxxManaged or xxx (i.e SHA1Managed vs SHA1) and why?

6条回答
  •  死守一世寂寞
    2021-01-01 14:19

    You should use the *Managed variants; they're usually faster.

    The *CryptoProvider and *CNG classes use native interop, and are usually slower.
    However, I've heard that they can use hardware crypto accelerators. (I haven't checked that)

    Also, the native versions are FIPS-certified; the managed versions aren't.

提交回复
热议问题