加密消息,然后压缩还是以其他方式更好?哪个提供更多的安全? [英] Is it better to encrypt a message and then compress it or the other way around? Which provides more security?

查看:131
本文介绍了加密消息,然后压缩还是以其他方式更好?哪个提供更多的安全?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我假设没有任何附加的保护。

I have the assumption there is no added protection at all.

推荐答案

提供的安全性没有差别,但是由于压缩算法的工作原理,您可能要先获得更好的压缩,如果先压缩,然后加密。

There is no difference in the security provided, but because of the way compression algorithms work, you are probably going to get better compression if you compress first then encrypt.

压缩算法利用统计冗余(如存在于自然语言或许多文件格式)在加密时应消除应该的数据,因此加密消息不能能够被压缩。

Compression algorithms exploit statistical redundancies (such as those that exist in natural language or in many file formats) in the data which should be eliminated when you encrypt it, therefore an encrypted message shouldn't be able to be compressed all that well.

维基百科文章: / p>

From the wikipedia article:


然而,无损数据压缩算法总是无法压缩一些文件;的确,任何压缩算法一定不能压缩任何不可辨别的模式的数据。因此,尝试压缩已经被压缩的数据通常会导致扩展,同时也会尝试压缩除最简单加密数据之外的所有数据。

However, lossless data compression algorithms will always fail to compress some files; indeed, any compression algorithm will necessarily fail to compress any data containing no discernible patterns. Attempts to compress data that has been compressed already will therefore usually result in an expansion, as will attempts to compress all but the most trivially encrypted data.

这篇关于加密消息,然后压缩还是以其他方式更好?哪个提供更多的安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆