繁体   English   中英

谁能解释一下如何计算密码的加密和解密的执行时间?

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

我试图在多元平方密码中使用时间函数但它不起作用,有没有其他方法可以计算密码的加密和解密时间? 或者它有任何其他公式吗?请帮助我解决这个问题..我想知道具有任何随机字符串长度的 polybious square 和 vignere 密码的加密和解密时间..

谢谢你

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")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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