Mat*_*tus 16 .net java linux windows security
Microsoft Windows 2000及更高版本公开了Data Protection API(DPAPI),它为每个用户或每个系统的上下文加密数据.呼叫者不提供用于加密数据的密钥.而是使用从用户或系统凭证派生的密钥对数据进行加密.
此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
)
Run Code Online (Sandbox Code Playgroud)
Linux上是否有等效的API? 奖励是它可以方便地与Java集成.
如果没有,我有什么选择?
它看起来并不比 PGP 或Pretty Good Privacy更先进(或更不先进) 。有一些可用于 PGP 的 API,我记得其他人称赞的 API 是Bouncy Castle。
根据您的具体需求,可能会有更好的 API 或解决方案。
归档时间: |
|
查看次数: |
3437 次 |
最近记录: |