You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
-
14Biases in the salt are not in themselves harmful (unlike biases in, say, a key). The salt only needs to be unique, it doesn't need to be unpredictable. A salt consisting of a MAC address (or something uniquely identifying the machine) and the time (assuming the clock doesn't go backward) would be fine. The statement that “ideally the salt characters should be equally weighted” is wrong.Gilles 'SO- stop being evil'– Gilles 'SO- stop being evil'2016-08-04 22:50:24 +00:00Commented Aug 4, 2016 at 22:50
-
7@thrig No, a predictable salt does not help with dictionary attacks, because a salt does not help with dictionary attacks as such. A salt helps with attacks that target multiple accounts (more precisely: multiple hashes — also successive hashes on the same account), and for this, all that matters is that the salt is distinct for the different accounts. The unpredictability of salts is irrelevant, only their uniqueness (actually, even a low repeat count is good enough).Gilles 'SO- stop being evil'– Gilles 'SO- stop being evil'2016-08-05 00:00:27 +00:00Commented Aug 5, 2016 at 0:00
-
8However, if the salt is badly generated, it doesn't inspire confidence in the rest of the crypto code.Stack Exchange Broke The Law– Stack Exchange Broke The Law2016-08-05 06:29:18 +00:00Commented Aug 5, 2016 at 6:29
-
4With salts, they need to be globally unique. They don't need to be random, and they don't need to be secret. But they do need to be globally unique. It turns out, this is harder to do if you try to increment a counter, or create some fancy deterministic algorithm, than just grabbing random bits from the OS RNG. If you generate 16 base64 characters randomly, then you have a n/64^16 chance of collisions. Of course, the whole point of salts, is to make rainbow table attacks fruitless. In this case, a 16-character base64 salt space would be 64^15 < n < 64^16. Not a showstopper, but easily fixed.Aaron Toponce– Aaron Toponce2016-08-05 17:04:05 +00:00Commented Aug 5, 2016 at 17:04
-
4@MontyHarder Entropy isn't a type of gasoline- you don't consume it, just like you don't consume temperature. It's a guess at the unpredictable state of your machine, just like temperature is a guess at the energy of gas molecules in a closed volume. Regardless, you should be pulling from /dev/urandom, which after properly seeded, is indistinguishable from true random noise. Also, rolling your own design rather than grabbing data from the RNG is almost guaranteeing to shoot yourself in the foot. Just use /dev/urandom.Aaron Toponce– Aaron Toponce2016-08-05 19:32:01 +00:00Commented Aug 5, 2016 at 19:32
|
Show 17 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. shell-script), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you