C
C#17mo ago
KRONOS

❔ Windwos Form MD5 Login system ?

In an application that I created as a windwos form, I need to enable users to log in with MYSQL. User passwords in MYSQL are encrypted with MD5. User cannot login using md5 encryption in Windwos Form. How can I do it ?
13 Replies
Jimmacle
Jimmacle17mo ago
1) md5 is not encryption 2) you should never encrypt passwords, only hash them 3) md5 is not a secure hashing algorithm for passwords besides that, you'll need to explain what you mean by the user can't log in
KRONOS
KRONOSOP17mo ago
passwords are like this but when I want to login. Username: admin password: admin it gives an error when i type but md5 Username: admin To password: 21232f297a57a5a743894a0e4a801fc3 [Convert a string to a MD5 hash] when i type this shape it accepts
Jimmacle
Jimmacle17mo ago
so what do you think you could add to your login code to hash the password correctly?
KRONOS
KRONOSOP17mo ago
Md5
Jimmacle
Jimmacle17mo ago
there you go
KRONOS
KRONOSOP17mo ago
I don't understand
Jimmacle
Jimmacle17mo ago
MD5 Class (System.Security.Cryptography)
Represents the abstract class from which all implementations of the MD5 hash algorithm inherit.
Jimmacle
Jimmacle17mo ago
also, i will reiterate that unless this is just a practice/school project you should not be using MD5 for this
KRONOS
KRONOSOP17mo ago
Since the data in the website is like this, I have to use it. Do you have any other suggestions? I'm doing it using user data in a ready data
Accord
Accord17mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Gibbo
Gibbo16mo ago
with passwords you want to salt and hash them, ive done this recently with one of my applications using bcrypt this generating the hashed password with salt added
//password
string password = txtPassword.Text;

//Generate Salts for Username & Password
string passwordSalt = BCrypt.Net.BCrypt.GenerateSalt((10));

//Generate Hashed Username & Password from Password entrys adding the Salt for addition security
string passwordToStoreInDatabase = BCrypt.Net.BCrypt.HashPassword(password, passwordSalt);
//password
string password = txtPassword.Text;

//Generate Salts for Username & Password
string passwordSalt = BCrypt.Net.BCrypt.GenerateSalt((10));

//Generate Hashed Username & Password from Password entrys adding the Salt for addition security
string passwordToStoreInDatabase = BCrypt.Net.BCrypt.HashPassword(password, passwordSalt);
this is verifying the hashed from the database against the entered password to verify they are a match
if (BCrypt.Net.BCrypt.Verify(enteredPassword, databasePassword) == true)
{
your code goes here
}
if (BCrypt.Net.BCrypt.Verify(enteredPassword, databasePassword) == true)
{
your code goes here
}
Accord
Accord16mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server