1234567891011121314151617181920 |
- def verify(signature,private_key,fileName):
- data=getData(fileName)
- data=data.encode("utf-8")
- start=timer()
- public_key = private_key.public_key()
- public_key.verify(
- signature,
- data,
- hashes.SHA256()
- )
- end=timer()
- print("Time Taken to verify the signature is ",(end-start))
- print("Time Taken per byte to verify is ",((end-start)/len(data)))
- generateFiles()
- private_key=generatePrivateKey(2048)
- signature=sign(private_key,"kbfile.txt")
- verify(signature,private_key,"kbfile.txt")
- signature=sign(private_key,"mbfile.txt")
- verify(signature,private_key,"mbfile.txt")
|