客户端加密的有效用例是什么? [英] What are the valid use cases for client side encryption?

查看:162
本文介绍了客户端加密的有效用例是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚阅读了关于 Stanford Javascript Crypto Library jsfiddle示例),它完全支持JavaScript中的SHA256,AES和其他标准加密方案。图书馆似乎很漂亮,但我不知道合理的用例。



As

用例1



本地存储空间如何?您可能想要存储一些数据,但是要加密,以便计算机的其他用户无法访问?



例如:




  • 用户通过HTTPS连接到服务器。

  • 服务器验证用户。

  • 服务器提供加密密码


  • 某些数据存储在本地(用密码加密)。

  • 用户流氓

  • 用户稍后回到站点。

  • 用户通过HTTPS连接。
  • $服务器验证用户。
  • 服务器提供用户的加密密码。

  • 客户端JS使用加密密码解密本地数据

  • 用户可以使用现在解密的内存本地数据在本地执行某些操作或其他操作。



在您拥有胖客户端的情况下,这可能会很有用,需要在会话之间使用大量(敏感)数据,服务器数据由于大小而不可行。我不能想到应用这种情况的许多情况...



在应用程序的用户生成敏感数据和数据的情况下也可能很有用不需要(或不应该)发送(或存储在)服务器。



对于一个应用示例,您可以存储用户的信用卡详细信息本地加密,并使用JS自动将其输入到表单中。您可以这样做,而不是存储数据服务器端,并以这种方式提供预先填充的表单,但是使用此方法,您不必在服务器上存储其信用卡详细信息(在某些国家/地区有严格的法律)。显然,关于存储加密在用户机器上的信用卡信息是否存在与存储服务器端相比的安全风险是有争议的。



可能更好应用示例...



我不知道使用这种技术的任何现有项目。



使用案例2



通过HTTPS进行性能改进,通过密码共享来实现?



例如: p>


  • 用户通过HTTPS连接到服务器。

  • 服务器验证用户。

  • 服务器提供特定于该用户的加密密码。

  • 服务器然后重定向到HTTP(其开销远远低于HTTPS),因此在性能方面要好得多)

  • 由于服务器和客户端都具有加密密码(并且该密码通过安全连接共享),因此它们现在可以发送和接收安全加密没有使用HTTPS加密/解密整个请求的开销。这意味着服务器可以提供一个只有敏感部分被加密的网页。客户端然后可以解密加密的部分。



这种用例可能不是全部值得的,因为HTTPS通常具有可接受的性能级别,但是如果您需要更多的速度,则会有所帮助。



用例3



主机验证存储。您可以加密数据客户端,然后将其发送到服务器。服务器可以存储数据并共享数据,但不知道客户端的私钥,则无法对其进行解密。这被认为是 lastpass 等服务的基础。


I just read about the Stanford Javascript Crypto Library (jsfiddle example) which supports SHA256, AES, and other standard encryption schemes entirely in javascript. The library seems very nifty, but I don't know of a reasonable use case for it.

As some questions have already pointed out, client side encryption is not a safe way to pass secure data to a server. HTTPS should be used instead. So, are there any projects that would benefit from or require client side encryption?

解决方案

Use Case 1

How about local storage? You might want to store some data, but encrypt it so that other users of the computer cannot access it?

For example:

  • User connects to server over HTTPS.
  • Server authenticates user.
  • Server serves an encryption password specific to this user.
  • User does some stuff locally.
  • Some data is stored locally (encrypted with the password).
  • User wanders off
  • User comes back to site at later stage.
  • User connects over HTTPS.
  • Server authenticates user.
  • Server serves the user's encryption password.
  • Client-side JS uses encryption password to decrypt local data.
  • User does something or other locally with their now-decrypted, in-memory local data.

This could be useful in cases where you have a fat client, with lots of (sensitive) data that needs to be used across sessions, where serving the data from the server is infeasible due to size. I can't think of that many instances where this would apply...

It could also be useful in cases where the user of the application generates sensitive data and that data does not need to (or shouldn't) ever be sent to (or stored on) the server.

For an applied example, you could store the user's credit card details locally, encrypted and use JS to auto-enter it into a form. You could have done this by instead storing the data server side, and serving a pre-populated form that way, but with this approach you don't have to store their credit card details on the server (which in some countries, there are strict laws about). Obviously, it's debatable as to whether storing credit card details encrypted on the user's machine is more or less of a security risk than storing it server side.

There's quite probably a better applied example...

I don't know of any existing project which use this technique.

Use Case 2

How about for performance improvements over HTTPS, facilitated via password sharing?

For example:

  • User connects to server over HTTPS.
  • Server authenticates user.
  • Server serves an encryption password specific to this user.
  • Server then redirects to HTTP (which has much less of an overhead than HTTPS, and so will be much better in terms of performance).
  • Because both the server and the client have the encryption password (and that password was shared over a secure connection), they can now both send and receive securely encrypted sensitive data, without the overhead of encrypting / decrypting entire requests with HTTPS. This means that the server could serve a web page where only the sensitive parts of it are encrypted. The client could then decrypt the encrypted parts.

This use case is probably not all that worthwhile, because HTTPS generally has acceptable performance levels, but would help if you need to squeeze out a bit more speed.

Use Case 3

Host proof storage. You can encrypt data client side and then send it to the server. The server can store the data and share it, but without knowing the client's private key, it cannot decrypt it. This is thought to be the basis for services such as lastpass.

这篇关于客户端加密的有效用例是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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