AES 加密与解密速度
我在某处读到解密可以比加密更快地执行。这是正确的吗?这将是使用 openssl 的纯软件实现。
I had read somewhere the decryption can be performed faster than encryption. Is this correct? This would be a pure software implementation using may be openssl.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
AES是一种对称加密,无论加密还是解密,速度都是一样的。事实上,在某些流模式下,AES 只是生成与要加密的数据进行异或的比特流,接收方运行完全相同的 AES 来生成完全相同的比特流以进行异或解密。
AES is a symmetric encryption, and is the same speed whether encrypting or decrypting. In fact in some streaming modes, AES simply generates a stream of bits that are xored with the data to encrypt, with the reciever running the exact same AES to produce the exact same bitstream to xor in to decrypt.
分组密码操作模式可能对加密/解密过程的性能产生直接影响。粗略地说; AES 加密数据块时每轮执行的操作都是以相反的方向(解密)执行的,因此没有合理的理由证明加密/解密本身的性能变化;一些分组密码操作模式(例如CBC)在加密输入块时需要顺序操作,而在解密时不需要顺序操作。
请查看此链接以进一步讨论此事:
https://security.stackexchange.com/questions/第38055章
The block cipher mode of operation might have a direct impact in the performance of the encryption/decryption processes. Roughly speaking; the operations performed on each round while AES is encrypting a block of data are performed in the opposite direction (decryption), so no reasonable justification for performance variation in the encryption/decryption itself , however; some of the block cipher mode of operations (e.g. CBC) requires sequential operation when encrypting input blocks, while no need for sequential operation in decryption.
Please Check this link for further discussion on this matter:
https://security.stackexchange.com/questions/38055/why-does-aes-encryption-take-more-time-than-decryption