|
10 | 10 |
|
11 | 11 | <p>
|
12 | 12 | A strong cryptographic hash function should be resistant to:
|
13 |
| - <ul> |
14 |
| - <li> |
15 |
| - <b>Pre-image attacks</b>. If you know a hash value <code>h(x)</code>, |
16 |
| - you should not be able to easily find the input <code>x</code>. |
17 |
| - </li> |
18 |
| - <li> |
19 |
| - <b>Collision attacks</b>. If you know a hash value <code>h(x)</code>, |
20 |
| - you should not be able to easily find a different input |
21 |
| - <code>y</code> |
22 |
| - with the same hash value <code>h(x) = h(y)</code>. |
23 |
| - </li> |
24 |
| - <li> |
25 |
| - <b>Brute force</b>. For passwords and other data with limited |
26 |
| - input space, if you know a hash value <code>h(x)</code> |
27 |
| - you should not be able to find the input <code>x</code> even using |
28 |
| - a brute force attack (without significant computational effort). |
29 |
| - </li> |
30 |
| - </ul> |
31 | 13 | </p>
|
| 14 | + <ul> |
| 15 | + <li> |
| 16 | + <b>Pre-image attacks</b>. If you know a hash value <code>h(x)</code>, |
| 17 | + you should not be able to easily find the input <code>x</code>. |
| 18 | + </li> |
| 19 | + <li> |
| 20 | + <b>Collision attacks</b>. If you know a hash value <code>h(x)</code>, |
| 21 | + you should not be able to easily find a different input |
| 22 | + <code>y</code> |
| 23 | + with the same hash value <code>h(x) = h(y)</code>. |
| 24 | + </li> |
| 25 | + <li> |
| 26 | + <b>Brute force</b>. For passwords and other data with limited |
| 27 | + input space, if you know a hash value <code>h(x)</code> |
| 28 | + you should not be able to find the input <code>x</code> even using |
| 29 | + a brute force attack (without significant computational effort). |
| 30 | + </li> |
| 31 | + </ul> |
32 | 32 |
|
33 | 33 | <p>
|
34 | 34 | As an example, both MD5 and SHA-1 are known to be vulnerable to collision attacks.
|
|
51 | 51 |
|
52 | 52 | <p>
|
53 | 53 | Ensure that you use a strong, modern cryptographic hash function, such as:
|
54 |
| - <ul> |
55 |
| - <li> |
56 |
| - Argon2, scrypt, bcrypt, or PBKDF2 for passwords and other data with limited input space where |
57 |
| - a dictionary-like attack is feasible. |
58 |
| - </li> |
59 |
| - <li> |
60 |
| - SHA-2, or SHA-3 in other cases. |
61 |
| - </li> |
62 |
| - </ul> |
63 | 54 | </p>
|
64 | 55 |
|
| 56 | + <ul> |
| 57 | + <li> |
| 58 | + Argon2, scrypt, bcrypt, or PBKDF2 for passwords and other data with limited input space where |
| 59 | + a dictionary-like attack is feasible. |
| 60 | + </li> |
| 61 | + <li> |
| 62 | + SHA-2, or SHA-3 in other cases. |
| 63 | + </li> |
| 64 | + </ul> |
| 65 | + |
65 | 66 | <p>
|
66 | 67 | Note that special purpose algorithms, which are used to ensure that a message comes from a
|
67 | 68 | particular sender, exist for message authentication. These algorithms should be used when
|
|
0 commit comments