0

I have created an application which uses a baic login method ( no need for help about that). It is not password sensitivee, which i would like it to be, and i would like to encript it with hash. Any idea how? This is the database code for the login:

private bool validate_login(string user, string pass)
    {
        db_connection();
        MySqlCommand cmd = new MySqlCommand();
        cmd.CommandText = "SELECT * FROM `user` WHERE `username`=@username AND `password`=@password";
        cmd.Parameters.AddWithValue("@username", user);
        cmd.Parameters.AddWithValue("@password", pass);
        cmd.Connection = connect;
        MySqlDataReader login = cmd.ExecuteReader();
        if (login.Read())
        {
            connect.Close();
            return true;
        }
        else
        {
            connect.Close();
            return false;
        }
    }
Tjazz
  • 57
  • 1
  • 11

0 Answers0