Runtime: *CNG crypto algorithms missing from CNG library

Created on 14 Feb 2018  路  6Comments  路  Source: dotnet/runtime

I was looking at porting some code targeting desktop and came across SHA256Cng which I noticed was missing.

I did a diff and I see we're actually missing a number of Cng algorithms:

  • MD5Cng
  • SHA1Cng
  • SHA256Cng
  • SHA384Cng
  • SHA512Cng

Moreover, I see quite a few more here: https://github.com/dotnet/corefx/blob/5edf66e4f35eca3ba409cb2e31154fb6a59bd4b3/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs#L266-L284

Any reason we left these out? /cc @bartonjs

area-System.Security

All 6 comments

We discourage people from caring what their digest provider is, and on core they can't actually control it. (SHA256CryptoServiceProvider just wraps SHA256.Create()).

Since the types were not part of netstandard20, we don't want them in Core.

I see, we could have put them in the Microsoft.Windows.Compatibility package. I'll make sure to adjust the code to call the Create method instead of trying to new up the specific type.

Putting in the WPF/Winforms "project" as blocked (as no plan currently), just so this can be found in future.

So what's the recommended path-forward here? Everyone that used this library rewrites their module to use SHA256.Create()?

So what's the recommended path-forward here? Everyone that used this library rewrites their module to use SHA256.Create()?

Yep.

Since the current plan is that not having these types is correct, and we're being more aggressive about trimming things lately, I'm closing this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Timovzl picture Timovzl  路  3Comments

jzabroski picture jzabroski  路  3Comments

chunseoklee picture chunseoklee  路  3Comments

aggieben picture aggieben  路  3Comments

omajid picture omajid  路  3Comments