File tree Expand file tree Collapse file tree
python/ql/test/experimental/library-tests/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from Cryptodome .Hash import MD5
2+
3+ hasher = MD5 .new (b"secret message" ) # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
4+ print (hasher .hexdigest ())
5+
6+
7+ hasher = MD5 .new () # $ MISSING: CryptographicOperation CryptographicOperationAlgorithm=MD5
8+ hasher .update (b"secret" ) # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret" CryptographicOperationAlgorithm=MD5
9+ hasher .update (b" message" ) # $ MISSING: CryptographicOperation CryptographicOperationInput=b" message" CryptographicOperationAlgorithm=MD5
10+ print (hasher .hexdigest ())
Original file line number Diff line number Diff line change 1+ from cryptography .hazmat .primitives import hashes
2+
3+ from binascii import hexlify
4+
5+
6+ hasher = hashes .Hash (hashes .MD5 ())
7+ hasher .update (b"secret message" ) # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
8+
9+ digest = hasher .finalize ()
10+ print (hexlify (digest ).decode ('utf-8' ))
Original file line number Diff line number Diff line change 1+ import hashlib
2+
3+
4+ hasher = hashlib .md5 (b"secret message" ) # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
5+ print (hasher .hexdigest ())
6+
7+
8+ hasher = hashlib .md5 ()
9+ hasher .update (b"secret" ) # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret" CryptographicOperationAlgorithm=MD5
10+ hasher .update (b" message" ) # $ MISSING: CryptographicOperation CryptographicOperationInput=b" message" CryptographicOperationAlgorithm=MD5
11+ print (hasher .hexdigest ())
12+
13+
14+ hasher = hashlib .new ('md5' , b"secret message" ) # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
15+ print (hasher .hexdigest ())
16+
17+
18+ hasher = hashlib .new ('md5' )
19+ hasher .update (b"secret" ) # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret" CryptographicOperationAlgorithm=MD5
20+ hasher .update (b" message" ) # $ MISSING: CryptographicOperation CryptographicOperationInput=b" message" CryptographicOperationAlgorithm=MD5
21+ print (hasher .hexdigest ())
You can’t perform that action at this time.
0 commit comments