在 ASP.Net 应用程序中安全地存储(加密)数据

发布于 2024-12-09 06:29:29 字数 580 浏览 0 评论 0原文

我有一个 asp.net 应用程序,人们可以使用网络浏览器通过互联网访问该应用程序。它在 Web 服务器上运行并与后端数据库进行通信。

一些用户希望使用该应用程序来存储一些私人数据。其要求是:

1)只有存储数据的用户才能看到它。

2)开发人员/数据库管理员不应该能够看到数据。

3) 如果网络服务器和数据库服务器遭到破坏,黑客一定无法解密数据。

所以,很明显我必须加密这些数据。如果我加密它,某处就会有一个密钥,可能还有一个盐/IV。问题是我在哪里存储用于执行解密的数据?如果我将其存储在数据库或 Web 服务器中,那么开发人员、数据库管理员或黑客就可以访问它并解密数据。

我认为我的理想解决方案是将私钥放在客户端计算机上,这样他们就完全负责。但我不确定如何使用 ASP.NET Web 应用程序来解决这个问题。

我相信我可以创建一个还存储私钥(PFX)的证书。客户公司可以使用组策略将证书部署到其域。但 ASP.Net 应用程序是否有可能请求 Web 浏览器将私钥发送给它,以便它可以执行解密?在客户端上解密是最好的,但除了在 javascript 中创建一些东西之外,我不知道这是怎么可能的。

欢迎任何建议。

I have an asp.net application, accessed by people over the internet using web browsers. It runs on a web server and it talks to a backend database.

Some of the users would like to use the application to store some private data. The requirements of this are:

1) Only the user who stored the data should be able to see it.

2) The developers/dbas should not be able to see the data.

3) If the web server and database server were compromised a hacker must not be able to decrypt the data.

So, it's obvious I'm going to have to encrypt this data. If I encrypt it there will be a key somewhere and probably a salt/IV. The question is where do I store the data which is used to perform the decryption? If I store it in the database or the web server then a developer, dba or hacker can access it and decrypt the data.

I think my ideal solution to this would be for the private key to be on the clients machine, that way they are entirely responsible for it. But I'm not sure of how to go about this with an asp.net web application.

I believe I can create a certificate which also stores a private key (PFX). The client companies could use group policy to deploy the certificate to their domain. But it is possible that the ASP.Net application can request the web browser to send the private key to it so that it can perform the decryption? Decrypting on the client would be best but other than creating something in javascript I don't see how this is possible.

Any advice welcome.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

无言温柔 2024-12-16 06:29:29

将密钥存储在用户的脑海中。使用您喜欢的任何基于密码/密码短语的密钥派生算法。标准是PBKDF2。算法的最佳选择将取决于您的安全要求和威胁模式。理想情况下,该决定和实施至少应由安全专家进行审查。

Store the key in the mind of the user. Use any password/passphrase based key derivation algorithm you like. The standard is PBKDF2. The optimum choice of algorithm will depend on precisely what your security requirements and threat mode is. Ideally, that decision and the implementation should at least be reviewed by a security expert.

剑心龙吟 2024-12-16 06:29:29

您是否可以将 ClickOnce 应用程序部署为解决方案的一部分? ClickOnce 可以轻松访问本地计算机上的证书存储,从而允许您执行客户端加密。

Is it possible that you deploy a ClickOnce application as a part of your solution? The ClickOnce could easily access the cert store on a local machine thus allowing you to perform client-side encryption.

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