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 955107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:19:36+00:00 2026-05-16T00:19:36+00:00

I had an idea about hashed passwords and salt values. Since I’m rather new

  • 0

I had an idea about hashed passwords and salt values. Since I’m rather new to hashing and encryption, I thought I’d post this to you. Would it be more secure to generate a unique salt for each user account, then store the salt and hashed values in the database? Or, keep a single salt value securely stored and re-use that each time I hashed a password?

For example,
A user would use the password:

"secret"

My code would generate a salt value of:

"d1d0e3d4b3d1ed1598a4e77bb614750a2a175e"

Then hash the result to get:

"e8187dcbe8e2eabd4675f3a345fe21c98affb
 5544a9278461535cb67265b6fe09a11dbef572
 ce3a4a8f2275839927625cf0bc7bc46fc45d51
 12d7c0713bb4a3"

The hashed result and salt would then be stored in the database in the users profile when their account was created. Then, each time the user logged on, a new salt would be generated, the password and salt rehashed and stored in the database.

Any thoughts? Like I said, this is a sanity check on an idea I had.

  • 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-05-16T00:19:37+00:00Added an answer on May 16, 2026 at 12:19 am

    Storing a unique salt per user is a good idea in my opinion. Re-generating the salt/hash combination every time the user logs in is a bit pointless unless you’ve got CPU cycles to burn. I’d recommend using something like the Rfc2898DeriveBytes class to generate a secure salt/hash combo:

    Simple example of generating a hash from a password:

    string password = GetPasswordFromInput();
    
    using (var deriveBytes = new Rfc2898DeriveBytes(password, 32))  // 32-byte salt
    {
        byte[] salt = deriveBytes.Salt;
        byte[] hash = deriveBytes.GetBytes(32);  // 32-byte hash
        SaveToDatabase(salt, hash);
    }
    

    And the corresponding checking of a password:

    string password = GetPasswordFromInput();
    byte[] salt = GetSaltFromDatabase();
    byte[] hash = GetHashFromDatabase();
    
    using (var deriveBytes = new Rfc2898DeriveBytes(password, salt))
    {
        if (deriveBytes.GetBytes(32).SequenceEqual(hash))
            Console.WriteLine("Password matches");
        else
            throw new Exception("Bad password");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a data compression idea I've had, and since I'm imagining
I had an idea, if I add a python .py file to my C#
I had the idea of a search engine that would index web items like
I had an idea for a client-side language other than JavaScript, and I'd like
I had an idea I was mulling over with some colleagues. None of us
I had this idea of creating a count down timer, like 01:02, on the
It seems like Microsoft had a great idea with the ObservableCollection. They are great
I was wondering if anyone had a better idea how to do this. atm
Had an interesting discussion with some colleagues about the best scheduling strategies for realtime
Had a coworker ask me this, and in my brain befuddled state I didn't

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.