diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index c5dcf19..dbc4de5 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -353,7 +353,10 @@ class MISPAttribute(AbstractMISP): if '|' in self.type or self.type == 'malware-sample': hashes = [] for v in self.value.split('|'): - h = hashlib.new(algorithm, usedforsecurity=False) + try: + h = hashlib.new(algorithm) + except ValueError e: + h = hashlib.new(algorithm, usedforsecurity=False) h.update(v.encode("utf-8")) hashes.append(h.hexdigest()) return hashes