移动设备上的本地存储(html5)的安全性? [英] Security of local storage (html5) on mobile?

查看:130
本文介绍了移动设备上的本地存储(html5)的安全性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您使用Android上的javascript将数据写入本地存储,请执行以下操作:

if you write data to local storage with javascript on Android like this:

localStorage.data = "test";

可以通过某种方式访问​​和查看此数据吗?我有一些重要的数据要保存,如用户个人信息,我不希望任何人看到这些数据(即使他们在这方面付出了一些努力)。解决方案?

Can this data be access and viewed in some way? I have some important data to save like user personal information and I would not like for anybody to see this data (even if they put some effort in this). Solutions?

推荐答案

如果您有权访问浏览器,则根本没有受到保护。

There aren't protected at all if you have access to the browser.

从用户浏览器连接到您网站的任何人都可以在开发人员的工具中输入 console.log(localStorage)(使用Ctrl-uppercase-i on大多数浏览器)要清楚地看到它。

Anybody connecting to your site from the user's browser can simply type console.log(localStorage) in the developer's tools (use Ctrl-uppercase-i on most browsers) to see it in clear.

解决方案可能是使用服务器提供的密钥加密数据,但这不是那么安全:它很容易(例如,使用扩展名)一旦您访问浏览器(并让用户返回该站点),就更改已执行的javascript。我建议在服务器上存储这些数据。

A solution might be to encrypt the data using a server provided key, but this wouldn't be so secure : it's easy (for example using an extension) to change the executed javascript once you get access to the browser (and you have the user to come back to the site). I'd suggest to store on the server those data.

这篇关于移动设备上的本地存储(html5)的安全性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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