ASP.NET加密和解密数据库连接字符串

大家知道,在应用程序中进行数据库操作需要连接字符串,而如果没有连接字符串,我们就无法在应用程序中完成检索数据,创建数据等一系列的数据库操作。当有人想要获取你程序中的数据库信息,他首先看到的可能会是Web.Config文件。而多数情况下我们不希望那些高度敏感的数据信息被别人看到,所以我们就需要对其加密。这篇文章我将演示怎么实现加密和解密数据库的连接字符串。

目录

1.创建一个新项目

2.添加一个连接字符串

3.加密连接字符串

4.解密连接字符串

需要的工具

Visual Studio

SQL Server

1.创建一个新项目

File->New->New Project->Name the project->Select Empty->Click

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXYAAAEdCAIAAACXD9urAAAgAElEQVR4nO2da3AUR4Ln2Yi7uPuwX24j7svdh7sAVwuBWt16tV5YEuiB0KPFQyBhwDxkLIHAYFpCqG1kgZFWGoHxgC0jrMVawjCM5ZAZQzNgMCBPa/tib+w9CO04GIdnOG69h88Omd6JjfHc7kXfh+yuzqx3dVd1Fa1/xe+D1F2VlVmV+et8VGUucDrdAABgEgssjwEAII2BYgAAJgLFAABMBIoBAJgIFAMAMJEF5eU1AABgIIxiFvh/DQAARsEqphWKAQAYCauYJigGAGAkaCgBAEwEigEAmAgUAwAwESgGAGAirGJKoRgAgJGwiumUUEzbg0h8e/BQNcS2B5Gvgl/qikTbg0gk8qTNiPQUBH+MMNuPb7ydSDgJpAIA+/PDH/9124e/13VI/61/jEQiH/39D+7Tv6E/d5/+zUd//0MkEum/9Y8Khys/F/PlG98zWmkLPi5Qi5Cmwjn1JPK9elAJUBD8UYsHVYFiQFry+7k/ffl//njnd/8kRuEosWU0+mWBSl/M24+/0l8LgGKSYcPFr//jwD38Oz//VYAUcslNtZDT/H7uT796+If3Pv+e5pcPwpFIRPnAkzPfRiKRXz38w5/3f/Hn/V/86uEfIpHIyZlvVc+o3N37MBCJBKakj2SaJHRNJ144HwZoQ739+KvIkzaplpegPMuE/OUb30cCU1++8b1SC0hSMQXBH6mGWLxqRs4bPx1lPT1Reh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BQAgCYCBQDADARKAYAYCJ4gQAAYCKsYkqhGACAkaChBAAwESgGAGAieA0SAGAieA0SAGAiaCgBAEwEigEAmAgUAwAwESgGAGAiUAwAwESgGACAiWC+GACAieA1SACAiUAxAAATgWIAACYCxQAATASKAQCYCN60BgCYCNZRAgCYiGAyh/8PV+J87oimm+cAAAAASUVORK5CYII=" alt="" />

接下来连接数据库。工具->连接数据库,你可以选择连接本地或者服务器数据库。

ASP.NET加密和解密数据库连接字符串

2.添加连接字符串

我们需要将连接字符串的属性添加在web config文件的configuration标签下:

<connectionStrings>
<add name="myConnection" connectionString="Data Source=SIBEESHVENU\SQLEXPRESS;Initial Catalog=ReportServer$SQLEXPRESS;Integrated Security=True" />
</connectionStrings>

然后创建一个web页面,在页面加载事件中,获取这个连接字符串并输出,代码如下:

 using System;  

    namespace EncryptConnectionString
{
public partial class Default: System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
try
{
string myCon = System.Configuration.ConfigurationManager.ConnectionStrings["myConnection"].ConnectionString;
if (myCon != null)
{
Response.Write("My connection string is :" + myCon);
}
}
catch (Exception)
{
throw;
}
}
}
}
}

运行页面结果:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAigAAAAhCAIAAAB8/8czAAAgAElEQVR4nO29V3AbWbomWC+7+7ARE7ExMTGPOzGzN2JmYub2zK2u26Zsd5eqSmVkSlUypZKhJIqS6CQa0ZOgtwBJGAIE6EHvAXrvHei9B0jCe++B/PcBFEUhExBV1dO3bwxPIBSJk7/5/u87eU5mIpN6b2pq+vxz/jn/nH/OP+efv9nnPThv5+28nbfzdt7+hu09BEG87D7ZiyCId0svEU77eo9z2szLXk8974oQM+CvxPCu7Yz8e997rs4ZMbxrO1fnrenc0P4aDO/aztV5azo3tL8Gw7s27+7vAYqytwrmMsCsxJMSZ1TFSyf6KyYMdCHo1GgXT5i927v5ngXtW6t2K81TUZ7auTrn6qA7z9Xx7oX2PVfnf7U676HRePdH83I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Pa8XLd8a560B0ZG9pzh75L9KQO8u72p2rs5fN6B3l3c1O1fnrxvQu8u7mp2r864B/39PxDGgxCNVigAAAABJRU5ErkJggg==" alt="" />

3.加密连接字符串

在操作之前,以管理员权限打开命令窗口,输入如下命令:

cd C:\Windows\Microsoft.NET\Framework\v4.0.30319

输入完后,返回项目,复制文件夹地址,我的地址为:F:\Visual Studio\EncryptConnectionString\EncryptConnectionString。回到刚才的命令提示行,输入:

ASPNET_REGIIS -PEF "connectionStrings" "F:\Visual Studio\EncryptConnectionString\EncryptConnectionString"

点击Enter,输出结果如下:

ASP.NET加密和解密数据库连接字符串

这里要注意connectionStrings大小写要写正确。一旦输错,就会得到这样的结果:

C:\Windows\Microsoft.NET\Framework\v4.0.30319>ASPNET_REGIIS -PEF "connectionstrings" "F:\Visual Studio\EncryptConnectionString\EncryptConnectionString"

Microsoft (R) ASP.NET RegIIS version 4.0.30319.0

Administration utility to install and uninstall ASP.NET on the local machine.

Copyright (C) Microsoft Corporation. All rights reserved.

Encrypting configuration section...

The configuration section 'connectionstrings' was not found.

Failed!

所以在输入时一定要仔细。最后打开程序的web.config,我们就会看到连接字符串已经加密了:

    <connectionStrings configProtectionProvider="RsaProtectedConfigurationProvider">
<EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>Rsa Key</KeyName>
</KeyInfo>
<CipherData>
<CipherValue>B4B3oZrbpQsYM7Eaq5smukqDj9XUYUCwygBYRG1iasN4ll5W4wAKVCIFCRfvOJGoIXzgqpyjAI30IKf5pnZ/xWqmo3p/wGfOKdMrzd041dt9llLGbxFpLJs0Nkm583PJ1FppXLAy7FOD0YoBVhG/PBtBgLjTQqcXRNbVcgufzuArlv/EH+7lzSNRclXSTMOPMtISF65hPI9ICj9qLx7RBGhVZ6uFZVFteyyuRd2i3D2r7wJfr6KflFkakdxp1OWE2JK4Ldb8kZSwAy3bNaI/qaV9EgIWt9wM6RZO/IrI3kI/bX8JuvirPw3j/+TLDB3MoIgKjSbLpR3GYTm9csPu8g==</CipherValue>
</CipherData>
</EncryptedKey>
</KeyInfo>
<CipherData>
<CipherValue>0n1Y6ScSNZDR4x1sXfK05w9h+pp2OrAEQFQsoAUP5Y/hPsfpJS/7jv21PbPlkYmdCzycM4PGGb0+fuffR3RuL1x0tn7rfyUdA9llTfkyRQKwS9xOmkMsVFXgQDr8P4aXGef1fZPE2gjhcjm/JQToLwsfQZK1gNr4d6cIPFNqKD6wt24F7fuySJPX3OgLb8wXfQMd7ij+JcZzNlnyNHbq/DIjxSpPOnMrC52t06Jj8F8+MsSud9GcijcFB2UhvLVXQwyZ51nEj6Tf36Zbca8bgw==</CipherValue>
</CipherData>
</EncryptedData>
</connectionStrings>

4.解密连接字符串

解密连接字符串的方法一样,输入命令:

cd C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319

输入后,执行下一个命令:

ASPNET_REGIIS -PDF "connectionStrings" "F:\Visual Studio\EncryptConnectionString\EncryptConnectionString"

输出结果:

ASP.NET加密和解密数据库连接字符串

这时Web config里的连接字符串也就被解密了。

希望这篇文章对你有帮助!

上一篇:Spring Boot的@SpringBootApplication无法引入的问题


下一篇:小型IT部门建设之我见