XML 文件可以通过这种方式进行签名吗?
我需要 XML 文件的校验和,以验证该文件没有发生任何更改。
一旦我创建了 MD5 校验和,就可以将 MD5 校验和“嵌入”到同一个文件中。我想不会,但也许可以进行部分校验和 不基于文件的前 X 个字符。
非常感谢...
I need the checksum of an XML file in order to verify that no changes have been made to the file.
Once I have created the MD5 checksum is it possible to 'embed' the MD5 checksum inside the very same file. I guess not but perhaps if it is possible to make a partial checksum
not based on the first X characters of the file.
Thank you very much...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在文件中嵌入 MD5 哈希值。这将更改文件的哈希值,但这可以通过在验证哈希值之前反转修改来克服,当然要非常小心完全反转操作。
然而,这并不能提供任何真正的安全性,因为如果有人更改了文件,他们只需要记住也更改哈希值即可。
您应该生成密钥对并使用数字签名。
You can embed an MD5 hash in the file. This will change the hash of the file, but this can be overcome by reversing the modification before verifying the hash, being very careful of course to exactly reverse the operation.
However this doesn't offer any real security because if someone changes the file they just need to remember to change the hash value too.
You should instead generate a keypair and use a digital signature.