Adding a custom hashAlgorithmType in C# ASP.NET

后端 未结 3 996
故里飘歌
故里飘歌 2021-02-11 00:48

I\'ve got a page that I need to beef up security on. I\'m using the built-in MembershipProvider functionality and currently have hashAlgorithmType set to SHA512. I\

3条回答
  •  故里飘歌
    2021-02-11 01:34

    To be able to register a custom hashAlgorythmType, the first thing you need is a type that actually implements HashAlgorythm. If BCrypt implements it, it's your lucky day, but apparently it does NOT implement it, so this is your problem.

    There is really no work around for it, as implementing HashAlgorithm is a requirement for being able to register it like this.

    So what you are going to need to do is either write a wrapper around BCrypt to implement HashAlgorithm, or, of this is not possible, modify BCrypt itself to implement it.

    Unless you are really-really lucky and BCrypt is written in a way that easily lend itself to such a modification, it can require some non-trivial efforts.

提交回复
热议问题