Hashing Passwords using BCrypt in ASP.Net Core (.NET 5)

Photo by Jason Dent on Unsplash

A quick and simple tutorial on hashing passwords using Bcrypt.

This requires the BCrypt.Net-Next NuGet package
https://www.nuget.org/packages/BCrypt.Net-Next/
Quick code example:

EncryptionHelper.cs (Example)

Quick code example:

Which results in the following console output when inserting a new user.

And that’s all there is to it. Hope you’ve learned something.

Thanks for reading.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store