重新启动后,将加密密钥保留在本地服务内存中的安全方法?

发布于 2025-01-26 22:45:50 字数 209 浏览 2 评论 0原文

我正在编写Windows服务,该服务从我们的Web服务器接收加密密钥。此关键永远不会留下内存,并用于加密和解密敏感数据。除了重新启动系统的情况外,这效果很好。在这种情况下,网络尚未可用(需要先进行身份验证),因此我的服务无法连接到服务器,但是它仍然需要获得加密密钥。

因此,我想知道在重新启动系统后是否有一种方法可以安全地将加密密钥保留在内存中(而无需将其保存到明文中的磁盘,这将暴露它)?

I'm writing a Windows service that receives an encryption key from our web server. Such key never leaves memory and is used to encrypt and decrypt sensitive data. This works well, except for the situation when the system is rebooted. In that case, the network is not yet available (it needs to be authenticated first) thus my service cannot connect to the server yet, but it still needs to obtain the encryption key.

Thus I was wondering if there is a way to safely retain the encryption key in memory after the system is rebooted (without saving it to disk in plaintext, which will expose it)?

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

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

发布评论

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

评论(1

溺深海 2025-02-02 22:45:50

使用ncryptregisterProtectionDescriptOnname / ncryptCreateProtectionDescriptor以及ncryptProtectSecret / ncryptunprotectsecret?

这与Remy Lebeau的建议非常相似,仅使用已经存在的Windows API服务。它不会在内存中(由于靴子之间丢失内存),而是提供了存储此类数据的应有方法。

How about using NCryptRegisterProtectionDescriptorName / NCryptCreateProtectionDescriptor along with NCryptProtectSecret/NCryptUnprotectSecret?

This is very similar to Remy Lebeau 's suggestion, only using already-existing windows API services. It won't be "in memory" (as memory is lost between boots) but does provide a should-be-secure means of storing such data.

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