检查文件是否未被修改或更改的最佳方法
我正在研究一个解决方案,其中一个功能是检查某些文件是否未被篡改,即被黑客攻击。我原本计划将 MD5 和与创建日期和修改日期混合使用,但想看看是否有人以前做过类似的事情。我目前使用的是 C#,但你可以建议任何其他语言。我只想听听它的技术部分或架构。
I'm working on a solution and one of the features is to check that some files have not been tampered in other words hacked. I was planning on using the MD5 sum with a mixture of created and modified dates, but wanted to see if anybody has done something like this before. I'm using C# at the moment but you could suggest any other language. I just want to hear the technique part of it or architecture.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
出于安全原因,我们有一个检查文件有效性的应用程序。使用简单的字典查找将 CRC32 校验和存储在单独的文件中。 CRC32、MD5 或任何其他散列/校验和功能中的哪一个纯粹是选择:您只需要知道文件是否已更改(至少您是这么说的)。由于文件的每个字节都包含在计算中,因此任何更改都将被拾取,包括简单的字节交换。
不要使用文件日期:太不可靠并且很容易更改。
We have an application that checks file validity for safety reasons. The CRC32 checksums are stored in a separate file using a simple dictionary lookup. Which of CRC32, MD5, or any other hashing/checksumming feature is purely choice: you simply need to know if the file has changed (at least that's what you've said). As each byte of the file is included in the calculation, any changes will be picked up, including simple swapping of bytes.
Don't use file dates: too unreliable and can be easily changed.