使用存储在 Windows 密钥库中的密钥作为 OpenSSL 中的预共享密钥
Use key stored in Windows key store as a pre-shared secret key in OpenSSL
我想知道这是否可能。我已经实现了一个使用 PSK 的 SSL 连接,但我想以某种方式保护 PSK,以便它只能由当前用户访问。我认为 windows 密钥库是最安全的。
有没有人能告诉我可以做到这一点? SSL 部分已经使用 OpenSSL 完成,但我不确定密钥存储。我一直在尝试 windows CNG api,但很难弄清楚如何使用存储的随机密钥作为 PSK。
I've already implemented an SSL connection that uses PSK, but I wanted to somehow secure the PSK so that it could only be accessible by the current user. I figured the windows key store would be the safest...
你要的叫"Protected Storage"。根据您使用的平台,它有不同的名称。例如,它称为 Keychain on Apple platforms, and KeyChain on Android 平台。
Microsoft 已保护存储,并根据您使用的技术进行了一些实施。早期微软称其为Protected Storage,由Protected Storage Service.
提供
Microsoft 在 Windows Server 2003 和 Windows XP 中弃用了 Protected Storage,并提供了 Protected Storage (Pstore) 对于那些操作系统。请参阅 MSDN 上的 Protected Storage (Pstore)。 Microsoft 还建议使用 Data Protection API (DPAPI) 来加密用户登录下的秘密。大约在 Windows 8.
左右结束
Microsoft 为 Windows 7 及更高版本提供 Credential Manager。它允许您存储用户登录密码和 PSK 密钥等位。
如果您需要更强大的密钥层次结构,那么 Cryptography API or Crypto API Next Generation can be used. If you use CryptoAPI or CNG, then I believe you need to create a public/private keypair, and then encrypt the PSK under the public key. You decrypt it with the private key when needed. You store the encrypted PSK anywhere you like, from the file system to the registry or online. Also see Softwariness's answer at How to deal with plaintext keys using CNG?
我想知道这是否可能。我已经实现了一个使用 PSK 的 SSL 连接,但我想以某种方式保护 PSK,以便它只能由当前用户访问。我认为 windows 密钥库是最安全的。
有没有人能告诉我可以做到这一点? SSL 部分已经使用 OpenSSL 完成,但我不确定密钥存储。我一直在尝试 windows CNG api,但很难弄清楚如何使用存储的随机密钥作为 PSK。
I've already implemented an SSL connection that uses PSK, but I wanted to somehow secure the PSK so that it could only be accessible by the current user. I figured the windows key store would be the safest...
你要的叫"Protected Storage"。根据您使用的平台,它有不同的名称。例如,它称为 Keychain on Apple platforms, and KeyChain on Android 平台。
Microsoft 已保护存储,并根据您使用的技术进行了一些实施。早期微软称其为Protected Storage,由Protected Storage Service.
提供Microsoft 在 Windows Server 2003 和 Windows XP 中弃用了 Protected Storage,并提供了 Protected Storage (Pstore) 对于那些操作系统。请参阅 MSDN 上的 Protected Storage (Pstore)。 Microsoft 还建议使用 Data Protection API (DPAPI) 来加密用户登录下的秘密。大约在 Windows 8.
左右结束Microsoft 为 Windows 7 及更高版本提供 Credential Manager。它允许您存储用户登录密码和 PSK 密钥等位。
如果您需要更强大的密钥层次结构,那么 Cryptography API or Crypto API Next Generation can be used. If you use CryptoAPI or CNG, then I believe you need to create a public/private keypair, and then encrypt the PSK under the public key. You decrypt it with the private key when needed. You store the encrypted PSK anywhere you like, from the file system to the registry or online. Also see Softwariness's answer at How to deal with plaintext keys using CNG?