Microsoft Windows 2000和更高版本公开了为每个用户或每个系统上下文加密数据的Data Protection API(DPAPI)。调用者不提供用于加密数据的密钥。相反,数据使用从用户或系统证书导出的密钥进行加密。Linux上Data Protection API的等效
该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集成。
如果没有我的替代品,我的替代品是什么?
PGP是否利用用户或系统证书?我的理解是,对于PGP,您需要提供您自己的公钥/私钥对。 – 2011-05-17 15:16:48
DPAPI中的证书只是一个RSA公钥/私钥对,您认为您属于哪个关键(系统或用户)是您自己的看法,而不是关键的功能。 – 2011-05-17 15:18:32
@EdwinBuck“由于DPAPI专注于为用户提供保护,并需要密码才能提供此保护,它在逻辑上使用用户的登录密码进行保护。”这里的问题是你没有访问用户登录密码,但该功能为你提供了加密,密码是关键。这让你不用担心其他用户(甚至是root用户)可以访问你的数据(在Linux情况下,用户当前没有登录的额外警告)。 – chacham15 2013-05-11 01:34:12