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

  • Home
  • SEARCH
  • 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 126521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:19:51+00:00 2026-05-11T05:19:51+00:00

UPDATE: I recently learned from this question that in the entire discussion below, I

  • 0

UPDATE: I recently learned from this question that in the entire discussion below, I (and I am sure others did too) was a bit confusing: What I keep calling a rainbow table, is in fact called a hash table. Rainbow tables are more complex creatures, and are actually a variant of Hellman Hash Chains. Though I believe the answer is still the same (since it doesn’t come down to cryptanalysis), some of the discussion might be a bit skewed.
The question: ‘What are rainbow tables and how are they used?‘


Typically, I always recommend using a cryptographically-strong random value as salt, to be used with hash functions (e.g. for passwords), such as to protect against Rainbow Table attacks.

But is it actually cryptographically necessary for the salt to be random? Would any unique value (unique per user, e.g. userId) suffice in this regard? It would in fact prevent using a single Rainbow Table to crack all (or most) passwords in the system…
But does lack of entropy really weaken the cryptographic strength of the hash functions?


Note, I am not asking about why to use salt, how to protect it (it doesn’t need to be), using a single constant hash (don’t), or what kind of hash function to use.
Just whether salt needs entropy or not.


Thanks all for the answers so far, but I’d like to focus on the areas I’m (a little) less familiar with. Mainly implications for cryptanalysis – I’d appreciate most if anyone has some input from the crypto-mathematical PoV.
Also, if there are additional vectors that hadn’t been considered, that’s great input too (see @Dave Sherohman point on multiple systems).
Beyond that, if you have any theory, idea or best practice – please back this up either with proof, attack scenario, or empirical evidence. Or even valid considerations for acceptable trade-offs… I’m familiar with Best Practice (capital B capital P) on the subject, I’d like to prove what value this actually provides.


EDIT: Some really good answers here, but I think as @Dave says, it comes down to Rainbow Tables for common user names… and possible less common names too. However, what if my usernames are globally unique? Not necessarily unique for my system, but per each user – e.g. email address.
There would be no incentive to build a RT for a single user (as @Dave emphasized, the salt is not kept secret), and this would still prevent clustering. Only issue would be that I might have the same email and password on a different site – but salt wouldnt prevent that anyway.
So, it comes back down to cryptanalysis – IS the entropy necessary, or not? (My current thinking is it’s not necessary from a cryptanalysis point of view, but it is from other practical reasons.)

  • 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. 2026-05-11T05:19:52+00:00Added an answer on May 11, 2026 at 5:19 am

    Salt is traditionally stored as a prefix to the hashed password. This already makes it known to any attacker with access to the password hash. Using the username as salt or not does not affect that knowledge and, therefore, it would have no effect on single-system security.

    However, using the username or any other user-controlled value as salt would reduce cross-system security, as a user who had the same username and password on multiple systems which use the same password hashing algorithm would end up with the same password hash on each of those systems. I do not consider this a significant liability because I, as an attacker, would try passwords that a target account is known to have used on other systems first before attempting any other means of compromising the account. Identical hashes would only tell me in advance that the known password would work, they would not make the actual attack any easier. (Note, though, that a quick comparison of the account databases would provide a list of higher-priority targets, since it would tell me who is and who isn’t reusing passwords.)

    The greater danger from this idea is that usernames are commonly reused – just about any site you care to visit will have a user account named ‘Dave’, for example, and ‘admin’ or ‘root’ are even more common – which would make construction of rainbow tables targeting users with those common names much easier and more effective.

    Both of these flaws could be effectively addressed by adding a second salt value (either fixed and hidden or exposed like standard salt) to the password before hashing it, but, at that point, you may as well just be using standard entropic salt anyhow instead of working the username into it.

    Edited to Add: A lot of people are talking about entropy and whether entropy in salt is important. It is, but not for the reason most of the comments on it seem to think.

    The general thought seems to be that entropy is important so that the salt will be difficult for an attacker to guess. This is incorrect and, in fact, completely irrelevant. As has been pointed out a few times by various people, attacks which will be affected by salt can only be made by someone with the password database and someone with the password database can just look to see what each account’s salt is. Whether it’s guessable or not doesn’t matter when you can trivially look it up.

    The reason that entropy is important is to avoid clustering of salt values. If the salt is based on username and you know that most systems will have an account named either ‘root’ or ‘admin’, then you can make a rainbow table for those two salts and it will crack most systems. If, on the other hand, a random 16-bit salt is used and the random values have roughly even distribution, then you need a rainbow table for all 2^16 possible salts.

    It’s not about preventing the attacker from knowing what an individual account’s salt is, it’s about not giving them the big, fat target of a single salt that will be used on a substantial proportion of potential targets.

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

Sidebar

Related Questions

Update: Check out this follow-up question: Gem Update on Windows - is it broken?
Update: Now that it's 2016 I'd use PowerShell for this unless there's a really
Introduction Hello folks, I recently learned to program in C! (This was a huge
If we've learned anything from HTML/CSS it's that, declarative languages (like XML) do a
Today Recently on Stackoverflow i learned that: reintroduce is used to hide ancestor constructors
I've recently learned that on linux, git can be setup to autocomplete commands: If
I'm using an Ajax update panel and have recently added ASP.NET tracing code to
Recently, my Eclipse 3.4 installation started complaining while trying to update installed software. I
I've recently updated an application to the 3.5 framework (from 2.0). The app links
Update: Solved, with code I got it working, see my answer below for the

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.