防止文件被编辑 [英] Prevent file from being edited

查看:71
本文介绍了防止文件被编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

防止文本文件(例如xml)被用户编辑的最明智的方法是什么?

我需要确保存储用户名和桌面应用程序特权的文件不能简单地进行编辑。

What's the smartest way to prevent a textfile (e.g. xml) from being edited by a user?
I need to make sure that the file in which I store the usernames and there privileges for the desktop application can't be simply edited.

也许我可以生成文件证书,而桌面应用程序会对此进行检查?

Maybe I can generate a certificate of the file and the desktop applications checks this?

我正在使用

推荐答案

您可以使用文件系统权限来防止编辑。

You could use File system permissions to prevent editing.

您可以使用加密使编辑变得困难

You could use encryption to make editing difficult

您可以获取文件的哈希值以检测编辑。

You could get a hash value for the file to detect editing.

我认为先加密文件,再解密。尽管用户足够聪明,仍然可以读取文件的内容。例如从内存中读取纯文本

I think encrypting the file, then decrypting it will be easiest. Though users might still be able to read the contents of the file if they're smart enough. e.g. reading the plain-text from memory

这篇关于防止文件被编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆