Files
codeql/python/ql/test/query-tests/Security/CWE-327/test_cryptography.py
Rasmus Wriedt Larsen 7afe3972d8 Revert "Merge pull request #5171 from RasmusWL/restructure-queries"
This reverts commit 8caafb3710, reversing
changes made to ec79094957.
2021-02-17 16:32:53 +01:00

10 lines
323 B
Python

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