简体   繁体   中英

Can anyone explain how to calculate the execution time of encryption and decryption of a cipher?

I tried to use time function in polybious square cipher but its not working ,is there any other way to calculate the encryption and decryption time of a cipher? or it has any other formula ?plase help me regarding this ..and i wanted to know the encryption and decryption time of polybious square and vignere cipher with any random string length..

thank you

import time

start = time.time()
encrypt_func()
encrypt_duration = time.time() - start
decrypt_func()
decrypt_duration = time.time() - encrypt_duration

print("Encryption took", encrypt_duration, "milliseconds")
print("Decryption took", decrypt_duration, "milliseconds")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM