压缩和加密...哪个首先应用? [英] Compression and Encryption... Which to apply first?

查看:195
本文介绍了压缩和加密...哪个首先应用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个远程备份项目在C ...
我想发送数据和压缩以及加密数据。



但是我很困惑首先压缩还是先加密!



什么会更好?:


  1. 压缩数据,然后对其加密

  2. 加密数据,然后压缩

另外,我将使用zlib进行压缩。
我想知道使用哪个加密库...
有些人说libgcrypt是好的。
建议使用好的加密库(非常容易使用)...):



或者这两个作业都有什么? / p>

谢谢!

解决方案

>

任何良好的加密算法都会产生类似于压缩效果的随机数据。


I am working on a remote backup project in C... I want to send data and compress as well as encrypt the data.

However I am confused whether to compress first or encrypt first!

What will be better?:

  1. Compress the data and then encrypt it
  2. Encrypt the data and then compress it

Also I am going to use zlib for compression. And I am wondering which encryption lib to use... Some people say libgcrypt is good. Suggestion for good encryption libraries(very easy to use) will be appreciated... :)

or is there anything that does both of the jobs?

Thanks!

解决方案

You should compress before encrypting.

Any good encryption algorithm will produce random-like data that will not compress well.

这篇关于压缩和加密...哪个首先应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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