附在JPG上的随机数据会使它不可用吗? [英] Will random data appended to a JPG make it unusable?

查看:77
本文介绍了附在JPG上的随机数据会使它不可用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,为了简化我的生活,我希望能够在我的程序正在处理的某些jpg图像的末尾添加1到7个其他字符*.这些是伪填充(填充符等-可能都是0x00),只是为了使文件大小为8字节的倍数以进行块加密.

So, to simplify my life I want to be able to append from 1 to 7 additional characters on the end of some jpg images my program is processing*. These are dummy padding (fillers, etc - probably all 0x00) just to make the file size a multiple of 8 bytes for block encryption.

通过一些程序进行了尝试,看来它们可以与附加字符配合使用,这些附加字符在指定图像末尾的FF D9 -这样看来,文件格式定义得足够好,以至于我在末尾添加的损坏"都没有关系.

Having tried this out with a few programs, it appears they are fine with the additional characters, which occur after the FF D9 that specifies the end of the image - so it appears that the file format is well defined enough that the 'corruption' I'm adding at the end shouldn't matter.

如有需要,我总是可以稍后对文件进行后期处理,但我的喜好是做尽可能简单的事情-就是让它们保留(我正在解密其他文件类型,他们不介意,所以有一个特殊的情况很烦人.)

I can always post process the files later if needed, but my preference is to do the simplest thing possible - which is to let them remain (I'm decrypting other file types and they won't mind, so having a special case is annoying).

几年前,我想到了 Steganography 的所有话题,有人在这里提供了一些建议. ..

I figure with all the talk of Steganography hullaballo years ago, someone has some input here...

(通过8个字节的块进行加密处理,我不想保存预加密的文件大小,因此将0x00附加到输入数据中,并在解码后保留在那里)

(encryption processing by 8 byte blocks, I don't want to save pre-encrypted file size, so append 0x00 to input data, and leave them there after decoding)

推荐答案

否,您可以在jpg文件的末尾添加一些位,而不会使其不可用. jpg文件的标题说明了如何读取该文件,因此读取该文件的程序将在jpg数据的末尾停止.

No, you can add bits to the end of a jpg file, without making it unusable. The heading of the jpg file tells how to read it, so the program reading it will stop at the end of the jpg data.

实际上,人们通过将zip数据附加到jpg数据的末尾,将zip文件隐藏在jpg文件中.由于这些格式的结构方式不同,生成的文件在两种格式下均有效.

In fact, people have hidden zip files inside jpg files by appending the zip data to the end of the jpg data. Because of the way these formats are structured, the resulting file is valid in either format.

这篇关于附在JPG上的随机数据会使它不可用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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