File tree Expand file tree Collapse file tree 4 files changed +30
-2
lines changed
javascript/ql/lib/semmle/javascript/security
lib/semmle/python/concepts
test/library-tests/frameworks Expand file tree Collapse file tree 4 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,11 @@ private module AlgorithmNames {
28
28
name = "SHA256" or
29
29
name = "SHA384" or
30
30
name = "SHA512" or
31
- name = "SHA3"
31
+ name = "SHA3" or
32
+ name = "SHA3224" or
33
+ name = "SHA3256" or
34
+ name = "SHA3384" or
35
+ name = "SHA3512"
32
36
}
33
37
34
38
predicate isWeakHashingAlgorithm ( string name ) {
Original file line number Diff line number Diff line change @@ -28,7 +28,11 @@ private module AlgorithmNames {
28
28
name = "SHA256" or
29
29
name = "SHA384" or
30
30
name = "SHA512" or
31
- name = "SHA3"
31
+ name = "SHA3" or
32
+ name = "SHA3224" or
33
+ name = "SHA3256" or
34
+ name = "SHA3384" or
35
+ name = "SHA3512"
32
36
}
33
37
34
38
predicate isWeakHashingAlgorithm ( string name ) {
Original file line number Diff line number Diff line change
1
+ from Crypto .Hash import SHA3_224
2
+
3
+ hasher = SHA3_224 .new (b"secret message" ) # $ CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=SHA3224
4
+ print (hasher .hexdigest ())
5
+
6
+
7
+ hasher = SHA3_224 .new () # $ CryptographicOperation CryptographicOperationAlgorithm=SHA3224
8
+ hasher .update (b"secret" ) # $ CryptographicOperation CryptographicOperationInput=b"secret" CryptographicOperationAlgorithm=SHA3224
9
+ hasher .update (b" message" ) # $ CryptographicOperation CryptographicOperationInput=b" message" CryptographicOperationAlgorithm=SHA3224
10
+ print (hasher .hexdigest ())
Original file line number Diff line number Diff line change
1
+ from Cryptodome .Hash import SHA3_224
2
+
3
+ hasher = SHA3_224 .new (b"secret message" ) # $ CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=SHA3224
4
+ print (hasher .hexdigest ())
5
+
6
+
7
+ hasher = SHA3_224 .new () # $ CryptographicOperation CryptographicOperationAlgorithm=SHA3224
8
+ hasher .update (b"secret" ) # $ CryptographicOperation CryptographicOperationInput=b"secret" CryptographicOperationAlgorithm=SHA3224
9
+ hasher .update (b" message" ) # $ CryptographicOperation CryptographicOperationInput=b" message" CryptographicOperationAlgorithm=SHA3224
10
+ print (hasher .hexdigest ())
You can’t perform that action at this time.
0 commit comments