在网页上显示解密的数据,但网页无法读取或保存它
我正在尝试解决以下问题:
用户有公钥-私钥对。公钥是已知的,而私钥由用户保密。
网络服务器具有使用用户的公钥加密的数据。
我希望用户能够使用他们的私钥(使用存储私钥的 MetaMask 等浏览器扩展)解密网络服务器数据,然后在网页中向用户显示该数据,同时还阻止网页能够存储该数据。
关于如何做到这一点有什么建议吗?
I'm trying to solve the following problem:
The user has a public-private keypair. The public key is known, while the private key is kept secret by the user.
The webserver has data that was encrypted using the user's public key.
I want the user to be able to decrypt the webserver data using their private key (using a browser extension like MetaMask that has their private key stored), and then display that data to the user in a web page, while also PREVENTING the web page from being able to store that data.
Any suggestions on how this might be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新;你确实可以使用 iframe 来做到这一点。事实上,iframe 的安全性令人惊讶。浏览器有效地将 iframe 与其父级分开,反之亦然,即使对于用户来说它们看起来像是同一页面。您可以将私人信息注入网页上受保护的 iframe 中,而无需授予该网页访问数据的权限。这是 Stripe 将信用卡输入字段直接嵌入网站的方法。
Update; you can indeed do this with an iframe. Iframes are surprisingly secure actually. The browser effectively partitions the iframe from its parent, and vice-versa, even though to the user they look like they're the same page to the user. You can inject private information into a protected iframe on a webpage without giving that webpage access to the data. This is the method Stripe uses to embed credit-card entry fields directly into websites.