有没有办法验证元数据?
我只是在思考,我想知道 - 我们如何知道文件的元数据是正确的?如果某个程序修改了它怎么办?我们没有关于元数据本身的实际数据,因此我们无法验证其有效性?或者我们呢?我们可以使用任何方法/程序来验证它们吗?
I was just doing some thinking and I was wondering to myself - How do we know the metadata of a file is correct? What if some program modifies it? We have no actual data about the metadata itself and thus we would have no way of verifying its validity? Or do we? Are there any methods/programs we can use to validate them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想知道元数据是否有效,请让您信任的人对其进行签名并将签名附加为元数据。这样,您就可以通过验证签名来知道它是否被篡改。
请参阅 DKIM 电子邮件签名系统。它被设计为去中心化的,并且可以容忍对消息标头的一些更改,而不会使签名完全无效(如果需要的话)。
If you want to know that metadata is valid, have something you trust sign it and attach the signature as metadata. That way, you can know if it has been tampered with by validating the signature.
See the DKIM email-signing system. It's designed to be decentralized and can tolerate some changes to a message's headers without invalidating the signature completely (if so desired).
。这个问题是似是而非的。操作系统级元数据不可能是“错误的”。
如果访问“错误”?谁说什么是“错误”?如果系统管理员更改了权限,而您无法访问它,那么 - 好吧 - 你运气不好,但访问就是访问。谁来定义“错误”?
如果尺寸“错误”?您可以通过写入来更改文件的大小。要么你信任操作系统来处理这个问题,要么——好吧——你会得到另一份工作,在那里你可以担心诸如时间不工作、重力不工作以及操作系统不跟踪资源之类的事情。
如果创建日期“错误”?没有 API 可以更改此设置,因此您必须信任操作系统来维护此设置。
如果您担心超级复杂的类似病毒的软件可以秘密覆盖操作系统中的 inode 和 dnode,那么您遇到的问题比“元数据”更大。您的操作系统有病毒损坏。
The question is specious. OS-level metadata can't be "wrong".
If the access is "wrong"? Who says what's "wrong"? If the sysadmin changed the permissions, and you can't access it, then -- well -- you're out of luck, but the access is the access. Who defines "wrong"?
If the size is "wrong"? You change the size of a file by writing to it. Either you trust the OS to handle this, or -- well -- you get another job where you can worry about things like time not working, gravity not working, and OS not keeping track of resources.
If the creation date is "wrong"? There's no API to change this, so you have to trust the OS to maintain this.
If you're worried about super-complex virus-like software that can covertly overwrite inodes and dnodes in the OS, you have a bigger problem than "metadata". You have a virus corrupting the OS.