init: deliberately vulnerable demo (CWE-798/327/89/78/319)

This commit is contained in:
test
2026-07-21 10:39:18 +02:00
commit 8cdac0dcb6
5 changed files with 31 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import hashlib
from Crypto.Cipher import DES
def weak_hash(data):
return hashlib.md5(data.encode()).hexdigest() # weak hash (CWE-327/328)
def encrypt(data, key):
cipher = DES.new(key, DES.MODE_ECB) # weak cipher (CWE-327)
return cipher.encrypt(data)