bbangert/beaker

SHA1 -> SHA256, any issues?

JasonThomasData opened this issue · 1 comments

Given what we know about the weaknesses of SHA1, would there be any issue with replacing SHA1 with SHA256? Would there be any backwards compatibility issues?

Just checking before I go and make a pull request. If it's good I'll get started soon.

import hashlib

input_data = "some_data_to_hash"
hash_obj = hashlib.sha1()
hash_obj.update(input_data.encode('utf-8'))
sha1_hash = hash_obj.hexdigest()

input_data = "some_data_to_hash"
hash_obj = hashlib.sha256()
hash_obj.update(input_data.encode('utf-8'))
sha256_hash = hash_obj.hexdigest()