Various Encryption Algorithms Implemented in Python
Encryption is generally about encrypting binary encoded formats, which corresponds to Python as Bytes. You need to convert str to Bytes using encode and decode. 01 md5 import hashlib def MD5(str): h1 =hashlib.md5() h1.update(str.encode(encoding = 'utf-8')) return h1.hexdigest() # lowercase if __name__ == "__main__": str ='123232' md5 =MD5(str) print("Before encryption: "+ str) print("After encryption: " … Read more