我可以加密我的 JSON 数据吗? [英] Can I encrypt my JSON data?

查看:26
本文介绍了我可以加密我的 JSON 数据吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个将从 DVD 本地执行的 JQuery Web 应用程序.该应用程序将读取 JSON 文件的所有内容.

I'm developing a JQuery web app that will be executed locally from a DVD. The app will read all the contents of a JSON file.

有没有好的方法可以加密或混淆 JSON 内容,以便只有应用程序可以读取它?

Is there a good way to encrypt or obfuscate the JSON content so that only the app can read it?

推荐答案

如果您只想防止他们复制并粘贴到其他内容中,您可以将其存储在 BSON 而不是 JSON 中.http://bsonspec.org/#/specification

If all you want is to prevent them from copying and pasting into something else, you could store it in BSON instead of JSON. http://bsonspec.org/#/specification

现在只会混淆它,并且不会阻止知识渊博的人(如果他们愿意)使用它.

Now that only OBFUSCATES it, and will not prevent a knowledgeable person from using it if they want to.

您也可以对其进行加密,但您仍然会遇到类似的问题,因为您会将解密密钥存储在加载加密 Json 的 javascript 中.

You could also encrypt it, but you still have a similar issue as you would be storing the decrypt key inside the javascript that loads the encrypted Json.

任何真正想要您的数据的人都将能够获得它.大多数浏览器都有 javascript 调试器,可让您在运行时提取或查看数据.

Anyone that really wants your data is going to be able to get it. Most browser have javascript debuggers that will let you extract, or view the data at runtime.

所以这主要取决于您想付出多少努力来使您的数据难以获取.一个非常积极的人,无论您做什么,都能获取您的数据.

So it mostly comes down to how much effort you want to put into making your data difficult to get at. A significantly motivated person with get at your data no matter what you do.

这篇关于我可以加密我的 JSON 数据吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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