压缩和加密时,是先压缩,还是先加密? [英] When compressing and encrypting, should I compress first, or encrypt first?
本文介绍了压缩和加密时,是先压缩,还是先加密?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我要对文件进行 AES 加密,然后对其进行 ZLIB 压缩,那么压缩效率会比我先压缩然后加密的效率低吗?
If I were to AES-encrypt a file, and then ZLIB-compress it, would the compression be less efficient than if I first compressed and then encrypted?
换句话说,我应该先压缩还是先加密,还是有关系?
In other words, should I compress first or encrypt first, or does it matter?
推荐答案
先压缩.加密文件后,您将生成不可压缩的随机数据流.压缩过程取决于在数据中找到可压缩的模式.
Compress first. Once you encrypt the file you will generate a stream of random data, which will be not be compressible. The compression process depends on finding compressible patterns in the data.
这篇关于压缩和加密时,是先压缩,还是先加密?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文