可以用较小的文件大小加密图像文件吗? [英] is it possible to encrypt image file with less file size?

查看:97
本文介绍了可以用较小的文件大小加密图像文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

在vb.net中,我尝试压缩图像文件.使用Rijndael算法对文件进行加密.加密后,文件大小将与原始文件相同..是否有可能获得比原始文件小的文件大小?

如果可能的话,意味着哪种算法适合呢?

在此先感谢

Dear all,

In vb.net i tried to compress image file.using Rijndael algorithm i have encrypt the file.after encryption the file size will be the same as original..is it posible to get the file with less size compared to original?

if it is possiblel means which algorithm suits for that?

thanks in advance

推荐答案

可能无法压缩图像除非您使用未压缩的图像格式(例如位图)来表示,否则.大多数图像格式已经包含某种形式的压缩,并且压缩的数据很难(很难理解)再次压缩-否则我们将重复压缩直到找到每个占用16个字节的文件.

实际上,由于压缩支持数据的额外开销,压缩图像(和其他压缩文件格式)实际上可能会增加生成文件的大小.

您是否不认为如果可以使用Rijndael等标准技术压缩图像,则不会有人将其添加到浏览器中以加快显示速度吗? :laugh:
The chances are that you can''t compress an image sifgnifcianly, unless you atart with an uncompressed image format such as a Bitmap. Most image formats already involve some form of compression, and compressed data is (understandably) difficult to compress again - or we would just repeat the compression until we got to every file occupying 16 bytes.

In fact, compressing images (and other compressed file formats) may actually increase the size of the resulting files due to the added overhead of the compression support data.

Don''t you think that if you could compress images using standard techniques such as Rijndael someone would not have added it to browsers to speed display? :laugh:


我几乎不相信你可以.
但是,您可以尝试一种无损压缩算法(例如,类似于ZIP文件中使用的算法).

您可能使用相反的方法:先压缩,然后加密.
I hardly believe you can.
However, you may try a lossless compression algorithm (like the one used in ZIP files, for instance).

You might use the opposite approach: first compress and then encrypt.


这篇关于可以用较小的文件大小加密图像文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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