Rfc2898 / PBKDF2 with SHA256 as digest in c#

前端 未结 8 2178
伪装坚强ぢ
伪装坚强ぢ 2020-12-13 10:01

I want to use Rfc2898 in c# to derive a key. I also need to use SHA256 as Digest for Rfc2898. I found the class Rfc2898DeriveBytes, but it uses SHA-1 and I don\

相关标签:
8条回答
  • 2020-12-13 10:53

    .NET Core has a new implementation of Rfc2898DeriveBytes.

    The CoreFX version no longer has the the hashing algorithm hard-coded

    The code is available on Github. It was merged to master on March 2017 and has been shipped with .NET Core 2.0.

    0 讨论(0)
  • 2020-12-13 11:00

    I know this is an old question, but for anyone that comes across it, you can now use KeyDerivation.Pbkdf2 from the Microsoft.AspNetCore.Cryptography.KeyDerivation nuget package. It is what is used in asp.net core.

    Unfortunately it will add a ton of references that aren't really needed. You could just copy the code and paste it into your own project (although you will now have to maintain cryto code which is a PITA)

    0 讨论(0)
提交回复
热议问题