123456789101112131415 |
- def decryptInCTR(key,fileNameToDecrypt,nonce,fileNameToSavePT):
- ct = b64decode(getDataInBytes(fileNameToDecrypt))
- nonce = b64decode(nonce)
- cipher = AES.new(key, AES.MODE_CTR, nonce=nonce)
- start=timer()
- pt = cipher.decrypt(ct)
- end=timer()
- print("Time Taken to Decrypt is ",(end-start))
- print("Time Taken to Decrypt per byte is ",((end-start)/len(pt)))
- pt=pt.decode("utf-8")
- writeFile(pt,fileNameToSavePT)
- return pt
|