需要保护配置文件
我需要确保配置文件不被篡改。它是简单的键值对文件。不过我也不想要任何像AES之类的强加密机制来确保其中的数据是加密的。 我只是想确保我知道该文件已被篡改。提供简单保护的某种方式。
请分享您的想法。
I have requirement to make sure that the configuration file is not tampered. It is simple key-value pair file. However I also do not want any strong encryption mechanism like AES and so on to ensure that the data in it is encrypted.
I just want to ensure that I know that the file was tampered. Some way in which a simple protection is provided.
Please share your thoughts.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
计算 sha512 并存储在某处/用加密密钥签名?
Calculate sha512 and store somewhere / sign with cryptographic key ?
您可以对文件内容应用加密性强的哈希函数,并验证函数的结果是否已更改。然而,这是最容易的部分。接下来是困难的部分。
如果您的程序运行在您无法控制的硬件和软件平台上(例如典型的 PC 安装),那么安全地解决这些问题是不可能的。您能做的最好的事情就是混淆程序的操作,以使对手难以破解您的系统。
You can apply a cryptographically strong hash function on the file's contents, and verify whether the function's result has changed. However, that's the easy part. The difficult parts come next.
If your program runs on a hardware and software platform that you can't control (e.g. a typical PC installation), then securely solving these problems is impossible. The best you can do is to obfuscate your program's operation in order to make it difficult for the adversary to crack your system.