Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8603665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:22:39+00:00 2026-06-12T02:22:39+00:00

Currently I’m working on software which connects to a MySQL database in order to

  • 0

Currently I’m working on software which connects to a MySQL database in order to retrieve and store data. The software itself is running as it should be, but I want to implement some new security features.

One of these security features is to store the password of the database user as a hash and not in plain text. For the record, I am NOT using a table to verify users, I’m talking about the database user to connect to the database itself.

I’m currently using a MySQL connection string which sends the password in plain text:

public abstract Database()
    {
        ReadConfig();
        connectionstring = "SERVER=" + server + ";" +
                "DATABASE=" + database + ";" +
                "UID=" + username + ";" +
                "PASSWORD=" + password + ";";
        try
        {
            connection = new MySqlConnection(connectionstring);
        }
        catch (MySqlException ex)
        {
            LogService.Log("ERROR - " + ex.ToString());
        }
    }

I also store this data on the user’s computer, so the user can change the server address, database, username and password. As I said, this is stored in plain text. Server addresses, database names and usernames stored as plain text are fine by me, but I don’t want to store the password in plain text.

Generating a SHA1 hash (or other hashing method) is not the problem, as I already have a method to generate these hashes.

In short, I would like to save the password as a hash, and use that hash in de connection string. How can I implement this?

EDIT:
I’m aware this is a ‘security through obscurity’ solution and it isn’t the best way to extend the security of my software. I’m looking into ways to find out how to use challenge-response methods, but in the mean time I would like to implement the above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:22:40+00:00Added an answer on June 12, 2026 at 2:22 am

    The best you can do here is to encrypt the user’s login info and use the plaintext when you want to do a login. MySQL won’t take the hashed value – if it did, this wouldn’t be any more secure than using the original (unhashed) value.

    A ‘shared secret’ challenge would be to use a proxy on your server to control the login. When a client wants to connect, the server proxy would send a long string of random bits. The client would append the (shared) ‘secret text’ to the end of this, use your SHA-1 hash on it and send it back to the server. The server would do the same with the text and compare the strings. This way it’s essentially a different password each time and sniffing it won’t matter.

    Once the client is authenticated the server proxy would enable communication with the mysql process. Using libmysql (or its c#) equivalent you can duplicate anything that would happen on a ‘regular’ mysql client.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently using a MySQL database Wanting to insert a new row into a table
Currently, I'm working on a project where I have a server - client relationship
Currently I have 2 ways of displaying images in a cell, which way will
Currently working with converting SQLException error messages into messages that are more useful for
Currently I have a date in my clients data table and it is stored
Currently, I have a log file of messages in one table in a MySQL
Currently I have a web service running in a tomcat (http:// localhost:8080/myApp/getUsers ). My
Currently I have a web service, which loads up any plugins located within its
Currently I'm using the Jackson JSON Processor to write preference data and whatnot to
Currently writing a C# application it should do backups using GIT in the background.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.