<p>There are a couple of different things going on here, and you need to define your problem more clearly. </p>

<p>For starters, let's just look at a simple case where what is being stored in a database (for each user) is either $H(pw)$ or $s, H(s, pw)$ where $H$ is a hash function, $pw \in \{1, \ldots, N\}$ is a password, and $s \in \{0,1\}^\ell$ is a salt.</p>

<p>To attack a single user without a salt, the attacker can pre-compute $H(pw)$ for all possible values of $pw$ yielding a table of size $N$. Without knowing the salt, however, the attacker has to compute $H(s, pw)$ for all possible salts as well, thus requiring a table of size $N \cdot 2^\ell$. On the other hand, if the attacker does no pre-computation but instead just waits until it compromises the database and then obtains $s^*, H(s^*, pw)$, then we are back to the previous case where the attacker just has to compute $N$ values of $H(s^*, pw)$ to learn the password. </p>

<p>Thus, in the single-user case, the salt increases the attacker's off-line computation but does not increase the on-line computation needed.</p>

<p>Before continuing, let me note also that (in the case without the salt) the attacker can use  to obtain various time-space tradeoffs. Use of salts makes rainbow tables less effective as well.</p>

<p>Salts also help, in a somewhat orthogonal way, in the multi-user setting. To see this, note that if the attacker got the database of hashed passwords in the unsalted case, then using $N$ work he gets the passwords of <em>all</em> users. But in the salted case, assuming each of $M$ users is assigned a different salt, the attacker must do $M \cdot N$ work to recover all passwords.</p>

CC BY-SA 3.0
2012-04-22T20:49:32.773Z
2012-04-22T20:49:32.773Z
user6584
<p>You don't need users X passwords entries...</p>

<p>You can store the passwords with one master set of salts (one or more salt - can be double salted, triple salted or more).</p>

<p>When the user tries to log-in, the server should send him a temporary salt, which should be used to salt the password prior to sending it.</p>

<p>The server should then unsalt the password using that temporary salt, then salt it with the master salt(s) and compare it with the DB version.</p>

<p>In other words the time complexity may grow, but the effect on the storage space should not (unless salting algorithm has larger output than input).</p>

<p>There are also alternatives such as asymmetric encryption and certificates.</p>

CC BY-SA 3.0
2012-04-22T16:47:12.017Z
2012-04-22T16:47:12.017Z
Danny Varod
<p>I am trying to wrap my head around the benefits of salt in cryptography. </p>

<p><a href="http://en.wikipedia.org/wiki/Salt_%28cryptography%29" rel="nofollow">http://en.wikipedia.org/wiki/Salt_(cryptography)</a></p>

<p>I understand that adding salt makes it harder to precompute a table. But exactly how much harder do things get with salt?</p>

<p>It seems to me, like when you add salt, the number of entries in your precomputed table would = number of common passwords to precompute x number of entries in the password table (ie number of different possibile salts). </p>

<p>So if you have a list of 100 common passwords, then without salt, you would have 100 hashed passwords. But if you have 10 users on a system, with 10 different salts, then you would now have 1000 different combinations to check. </p>

<p>So as the numbers of users or the size of common password list increases, the precomputed table gets so big that you can't pre-compute it easily (if at all)</p>

<p>Am I getting this? Do I have it right?</p>

CC BY-SA 3.0
2012-04-17T17:51:15.477Z
"salt" ? Please explain for those of us who are crypto (and cooking) challenged.
Suresh Venkat
CC BY-SA 3.0
2012-04-17T18:46:36.103Z
how do i send it to the other site?
bernie2436
CC BY-SA 3.0
2012-04-22T16:39:46.630Z
Don't forget to add a link in each question to the other question.
Danny Varod
<cr.crypto-security>
How much bigger does a precomputed lookup table get when salt is added?
bernie2436
# How much bigger does a precomputed lookup table get when salt is added?

(Asked by: username_0 on 2012-04-17)

I am trying to wrap my head around the benefits of salt in cryptography.

[http://en.wikipedia.org/wiki/Salt\_(cryptography)](http://en.wikipedia.org/wiki/Salt_%28cryptography%29)

I understand that adding salt makes it harder to precompute a table. But exactly how much harder do things get with salt?

It seems to me, like when you add salt, the number of entries in your precomputed table would = number of common passwords to precompute x number of entries in the password table (ie number of different possibile salts).

So if you have a list of 100 common passwords, then without salt, you would have 100 hashed passwords. But if you have 10 users on a system, with 10 different salts, then you would now have 1000 different combinations to check.

So as the numbers of users or the size of common password list increases, the precomputed table gets so big that you can't pre-compute it easily (if at all)

Am I getting this? Do I have it right?

**Tags:** cr.crypto-security

> **Comments:**
> **username_1**: "salt" ? Please explain for those of us who are crypto (and cooking) challenged.  
> **username_0**: how do i send it to the other site?  
> **username_2**: Don't forget to add a link in each question to the other question.  

---

## 2 answers

### Answer by username_3 on 2012-04-22. Score: 1 | Accepted answer

There are a couple of different things going on here, and you need to define your problem more clearly.

For starters, let's just look at a simple case where what is being stored in a database (for each user) is either $H(pw)$ or $s, H(s, pw)$ where $H$ is a hash function, $pw \in \{1, \ldots, N\}$ is a password, and $s \in \{0,1\}^\ell$ is a salt.

To attack a single user without a salt, the attacker can pre-compute $H(pw)$ for all possible values of $pw$ yielding a table of size $N$. Without knowing the salt, however, the attacker has to compute $H(s, pw)$ for all possible salts as well, thus requiring a table of size $N \cdot 2^\ell$. On the other hand, if the attacker does no pre-computation but instead just waits until it compromises the database and then obtains $s^\*, H(s^\*, pw)$, then we are back to the previous case where the attacker just has to compute $N$ values of $H(s^\*, pw)$ to learn the password.

Thus, in the single-user case, the salt increases the attacker's off-line computation but does not increase the on-line computation needed.

Before continuing, let me note also that (in the case without the salt) the attacker can use to obtain various time-space tradeoffs. Use of salts makes rainbow tables less effective as well.

Salts also help, in a somewhat orthogonal way, in the multi-user setting. To see this, note that if the attacker got the database of hashed passwords in the unsalted case, then using $N$ work he gets the passwords of *all* users. But in the salted case, assuming each of $M$ users is assigned a different salt, the attacker must do $M \cdot N$ work to recover all passwords.


---

### Answer by username_2 on 2012-04-22. Score: 0

You don't need users X passwords entries...

You can store the passwords with one master set of salts (one or more salt - can be double salted, triple salted or more).

When the user tries to log-in, the server should send him a temporary salt, which should be used to salt the password prior to sending it.

The server should then unsalt the password using that temporary salt, then salt it with the master salt(s) and compare it with the DB version.

In other words the time complexity may grow, but the effect on the storage space should not (unless salting algorithm has larger output than input).

There are also alternatives such as asymmetric encryption and certificates.


---

