Files
codeql/python/ql/test/query-tests/Security/CWE-327/test_cryptography.py
2018-11-19 15:15:54 +00:00

9 lines
284 B
Python

from cryptography.hazmat.primitives.ciphers import Cipher, algorithms
def get_badly_encrypted_password():
dangerous = get_password()
cipher = Cipher(algorithms.ARC4(key), _, _)
encryptor = cipher.encryptor()
return encryptor.update(dangerous) + encryptor.finalize()