Microsoft Windows 2000 及更高版本公开了 Data Protection API (DPAPI) 为每个用户或每个系统上下文加密数据。调用者不提供用于加密数据的 key 。相反,数据是使用从用户或系统凭据派生的 key 加密的。
此 API 通过 ProtectedData 在 .NET 中方便地公开类:
// Encrypts the data in a specified byte array and returns a byte array
// that contains the encrypted data.
public static byte[] Protect(
byte[] userData,
byte[] optionalEntropy,
DataProtectionScope scope
)
// Decrypts the data in a specified byte array and returns a byte array
// that contains the decrypted data.
public static byte[] Unprotect(
byte[] encryptedData,
byte[] optionalEntropy,
DataProtectionScope scope
)
Linux 上是否有等效的 API? 一个好处是它可以方便地与 Java 集成。
如果没有其他选择,我有什么选择?
最佳答案
关于java - 等效于 Linux 上的数据保护 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6032880/