I,Aspnet_regiis.exeFile Path:
C: \ windows \ Microsoft. NET \ framework \ v2.0.50727
II, UtilizationDoSCommand to create an exportedRSAKey container, namedKey :
Aspnet_regiis-PC"Key"-Exp
III,Web. configConfiguring
<! --Encrypts database connection strings-->
<Configprotecteddata>
<Providers>
<Clear/>
< Add Name = " keyprovider " type =" system. configuration. rsaprotectedconfigurationprovider, system. configuration, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a, processorarchitecture = msil " keycontainername =" key " usemachinecontainer =" true "/>
</Providers>
</Configprotecteddata>
connectionstrings >
Add name = " connectionstr " connectionstring =" Data Source =. \ sqlexpress; initial catalog = membershiptest; Integrated Security = true "
Providername="System. Data. sqlclient"/>
</Connectionstrings>
Note:KeyIs the secret container name created in step 2
Note:The above configuration is inConfigurationAnd make sure thatConfigurationUnder the nodeXmlnsThe property has the following values:
<Configuration xmlns = "http://schemas.microsoft.com/.NetConfiguration/v2.0">
Iv. ExploitationDoSCommand pairWeb. configFile encryption:
Aspnet_regiis-Arg "connectionstrings" "D: \ test \ membership1"-prov "keyprovider"
Note:
Connectionstrings:Web. configNode name,
D: \ test \ membership1:Web. configPhysical path of the file (excluding the file name)
Keyprovider:Web. configName of the encryption node added to the file
V. ExploitationDoSCommand pairWeb. configFile decryption:
aspnet_regiis-PDF" connectionstrings "" D: \ test \ membership1 "