تخطَّ إلى المحتوى

Weak hash algorithm (ARCH2111)

هذا المحتوى غير متوفر بلغتك بعد.

Key python.security.weak-hash · Severity error · Category security · CWE CWE-328

MD5 and SHA-1 are broken against collisions and must not be used for security purposes. Use SHA-256 or a stronger algorithm.

import hashlib
def fingerprint(data):
return hashlib.md5(data).hexdigest()
import hashlib
def fingerprint(data):
return hashlib.sha256(data).hexdigest()

Replace MD5/SHA-1 with a secure hash such as SHA-256 or SHA-3.