Encrypt password
Good evening.
I would like to know how to encrypt passwords properly these days. MD5 is apparently outdated and is no longer used. Is SHA256 more secure?
Many thanks for your help
12 Replies
to be pedantic, you never encrypt passwords
encryption is two way, passwords are hashed which is a one way operation
afaik argon2 is the "best" but i don't roll my own authentication
Let me not get this wrong. Don't I have to make sure that my passwords are stored securely in the database and cannot be accessed "blank"? Or am I just getting this wrong
correct
i was just nitpicking the word "encrypt" because that's not technically what you do, you hash them
Oh, then I apologize for that 😄
You should probably use an existing implementation like the PasswordHasher type from ASP.NET Core Identity
Andrew Lock | .NET Escapades
Exploring the ASP.NET Core Identity PasswordHasher
In this post I take a look at the PasswordHasher<> implementation from the ASP.NET Core Identity framework, and how it supports multiple hashing algorithms.
It takes care of salting for you and uses secure hash algorithms.
So i can this use for WPF?
Sure
At least, I'm not aware of a reason you couldn't use it there.
Thanks for help ❤️
You just need a reference to the Microsoft.Extensions.Identity.Core package.
If it works the way I want it to in the end, it will be perfect! 😄 But thank you very much ❤️ 🙂