File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
swift/ql/src/queries/Security/CWE-328 Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 4
4
<qhelp >
5
5
<overview >
6
6
<p >
7
- Using a insufficiently computationally hard hash function can leave data
8
- vulnerable, and should not be used for password hashing.
7
+ Hash functions that are not sufficiently computationally hard can leave data vulnerable. You should not use such functions for password hashing.
9
8
</p >
10
9
11
10
<p >
34
33
</p >
35
34
36
35
<p >
37
- Password hashing algorithms are designed to be slow and/or memory intenstive to compute, which makes brute force attacks more difficult.
36
+ Password hashing algorithms should be slow and/or memory intensive to compute, to make brute force attacks more difficult.
38
37
</p >
39
38
40
39
</overview >
41
40
<recommendation >
42
41
43
42
<p >
44
- Ensure that for password storage you should use a computationally hard cryptographic hash function, such as:
43
+ For password storage, you should use a computationally hard cryptographic hash function, such as one of the following :
45
44
</p >
46
45
47
46
<ul >
63
62
<example >
64
63
65
64
<p >
66
- The following examples show a function that hashes a password using a cryptographic hashing algorithm.
65
+ The following examples show two versions of the same function. In both cases, a password is hashed using a cryptographic hashing algorithm.
67
66
68
- In the first case the SHA-512 hashing algorithm is used. It is vulnerable to offline brute force attacks:
67
+ In the first case, the SHA-512 hashing algorithm is used. It is vulnerable to offline brute force attacks:
69
68
</p >
70
69
<sample src =" WeakPasswordHashingBad.swift" />
71
70
<p >
You can’t perform that action at this time.
0 commit comments