需要保护配置文件

发布于 2024-09-29 03:23:43 字数 113 浏览 0 评论 0原文

我需要确保配置文件不被篡改。它是简单的键值对文件。不过我也不想要任何像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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

知足的幸福 2024-10-06 03:23:43

计算 sha512 并存储在某处/用加密密钥签名?

Calculate sha512 and store somewhere / sign with cryptographic key ?

¢蛋碎的人ぎ生 2024-10-06 03:23:43

您可以对文件内容应用加密性强的哈希函数,并验证函数的结果是否已更改。然而,这是最容易的部分。接下来是困难的部分。

  • 在哪里以及如何存储哈希函数的结果,以便对手无法更改它以匹配被篡改文件的内容?
  • 如何确保执行验证的程序代码不被篡改?

如果您的程序运行在您无法控制的硬件和软件平台上(例如典型的 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.

  • Where and how do you store the hash function's result, so that an adversary can't change it to match the tampered file's contents?
  • How do you ensure that your program's code that performs the verification isn't tampered?

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文