是否有用于将摘要放入要摘要的文件的算法? [英] Are there algorithms for putting a digest into the file being digested?

查看:110
本文介绍了是否有用于将摘要放入要摘要的文件的算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有用于将摘要放入正在被摘要的文件中的算法?

Are there algorithms for putting a digest into the file being digested?

换句话说,是否有算法或库,或者甚至可能对哈希/摘要文件中包含的文件进行哈希/摘要.出于显而易见的原因,例如内置的ISO摘要,这将很方便.我已经尝试使用诸如"MD5注入"和在文件的文件中摘要"之类的信息进行搜索.没有运气(可能是有充分的理由.)

In otherwords, are there algorithms or libraries, or is it even possible to have a hash/digest of a file contained in the file being hashed/digested. This would be handy for obvious reasons, such as built in digests of ISOs. I've tried googling things like "MD5 injection" and "digest in a file of a file." No luck (probably for good reason.)

不确定在数学上是否可行.似乎您可以滚动浏览文件,但随后您必须蛮弄最后一点(假设摘要是文件或对象中的最后一件事.)

Not sure if it is even mathematically possible. Seems you'd be able to roll through the file but then you'd have to brute the last bit (assuming the digest was the last thing in the file or object.)

谢谢, 钦茨

推荐答案

执行此操作的唯一方法是定义文件格式,以便哈希仅适用于文件中不包含哈希的部分.

The only way to do this is if you define your file format so the hash only applies to the part of the file that doesn't contain the hash.

但是,将文件中的哈希(例如内置到ISO中)包含在内,会破坏哈希的整个安全性.您需要从其他渠道获取哈希值,并将其与文件进行比较.

However, including the hash inside a file (like built into an ISO) defeats the whole security benefit of the hash. You need to get the hash from a different channel and compare it with your file.

这篇关于是否有用于将摘要放入要摘要的文件的算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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