我怎样才能securly存储在Windows与.net(C#)的AES密钥? [英] How can I securly store an AES key in Windows with .Net (C#)?

查看:371
本文介绍了我怎样才能securly存储在Windows与.net(C#)的AES密钥?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我寻找一种方式来存储,使得它不能被检索一个给定的AES密钥,但(使用C#),它可以仍然被用于加密和解密。我认为,相当于不对称密钥存储可以在这里找到 ,但我在找的东西,可以用于对称加密。 ?它在托管的形式存在(预.NET 4中)

I've looking for a way to store a given AES key so that it can't be retrieved, but it can still be used for encryption and decryption (using C#). I think the equivalent for asymetric key storage can be found here, but I'm looking for something that can be used for symmetric encryption. Does it exist in a managed form (pre .Net 4)?

推荐答案

视窗DPAPI(的 Win32文档),其.NET包装(的 ProtectedData类)不存储任何数据。相反,视窗DPAPI返回,你可以在任何地方你喜欢的,包括在多个服务器上存储加密暗号值。

Windows DPAPI (Win32 documentation), and its .NET wrapper (ProtectedData Class) does not store any data. Rather, Windows DPAPI returns a cryptographic cypher value which you can store anywhere you like, including on multiple servers.

在我工作的地方,我们使用DPAPI来生成一个暗号一个AES密钥,我们接着在注册表存储

At my place of work we use DPAPI to generate a cypher for an AES key which we then store in the Registry.

视窗DPAPI的唯一目的是对数据进行加密,使得只有一个给定的用户帐户或机器可以将其解密,而不需要存储的密码。

The sole purpose of Windows DPAPI is to encrypt data such that only a given user account or machine can decrypt it, without needing to store a password.

由于2.0的.NET ProtectedData类已经在.NET Framework。

The .NET ProtectedData class has been in the .NET Framework since 2.0.

我会与Windows DPAPI坚持在第三方产品,因为它是成熟的,稳定的,免费的,易于使用和.NET完全支持。

I would stick with Windows DPAPI over a third party product as it is mature, stable, free, easy to use and fully supported in .NET.

这篇关于我怎样才能securly存储在Windows与.net(C#)的AES密钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆