如何在.NET应用程序中隐藏加密密钥? [英] How do you hide an encryption key in a .NET application?

查看:259
本文介绍了如何在.NET应用程序中隐藏加密密钥?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个内部网应用程序(C#),它使用一些我们想保持私有的数据(本地的Web服务器)。此数据使用旧版数据存储库进行加密(AES)。我们不能完全阻止对机器的物理访问。

I'm developing an intranet application (C#) that uses some data (local to the web server) that we'd like to keep private. This data is encrypted (AES) using a legacy data repository. We can't totally prevent physical access to the machine.

显然,我们永远不会有完美的安全性。但是,我们希望让任何人都能够尽可能地获取未经授权的访问数据。

Clearly, we're never going to have perfect security here. However, we want to make it as hard as possible for anyone to gain unauthorized access to the data.

问题是如何最好地存储密钥。

The question is how best to store the key. Encrypting it based on some machine specific ID is an option, but that information would be readily available to anyone running a diagnostic tool on the machine.

在应用程序中对其进行编码是一种选择,但是该信息对于在机器上运行诊断工具的任何人都是可用的。一个选项(它是一个一次性应用程序)。但是,.NET程序集很容易反编译。

Encoding it in the application is an option (it's a one off application). However, .NET assemblies are pretty easy to decompile. So, would it be best to obfuscate it, use an encryption launcher, compile it?

还是有一个我缺少的选项?

Or is there an option I'm missing?

正因为如此,我知道,如果有人决心,我知道这是一个失败的原因,但我们希望在限制范围内尽可能地努力。

Just so we're clear, I know it's pretty much a lost cause if someone is determined, but we're looking to make it as hard as possible within the constraints.

推荐答案

加密是内置于.NET配置系统中的。您可以加密应用程式/ web.config档案的区块,包括您储存私人密钥的位置。

Encryption is built into the .NET configuration system. You can encrypt chunks of your app/web.config file, including where you store your private key.

http://www.dotnetprofessional.com/blog/post/2008/03/ 03 / Encrypt-sections-of-WebConfig-or-AppConfig.aspx

这篇关于如何在.NET应用程序中隐藏加密密钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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