I have a very basic C# login system first i’ve work with localhost and basic databasebase username-password but now i want to connect my project to my website which is wordpress then i realize wordpress database is not at all basic they encrypt user passwords.
This is the code of my login system
MySqlCommand cmd =
new MySqlCommand("SELECT * FROM member.member WHERE username=@username AND password=@password ;",
connection);
cmd.Parameters.AddWithValue("@username", this.metroTextBox1.Text);
cmd.Parameters.AddWithValue("@password", this.metroTextBox2.Text);
and this is a example password which is 123456
$P$B84VsdpgngrtX/Aep0VNW3X1mz8mzJ.
But this is 123456 too
$P$B9sKzYbWqf.BTewOR7G.4j2.1.7S87/
and this
$P$BCkM0oYKnu2/M1Xz5BtDBjnLqKOn.4.
how can i recode my program and check password true or false.
Long time ago asked, but answering for my future self:
Found this link to a CryptSharp Library.
https://www.zer7.com/software/cryptsharp
Downloaded the file (.Net Framework 2.0) copied all files to a new .Net Core (3.1) project and compiled without touching any file.
Got the wordpress passwordcheck working without any problems!
Original stackexchange answer
And this blogpost (in French)