Encrypt and Decrypt connection string in web config

Encrypting connectionstrings:-
The following steps are needed for encrypt and decrypt connection strings in web.config:-
step 1: open visual studio command prompt and go to 'c:\windows\system32>' and type the following Action,section name and path of folder
syntax:
aspnet_regiis.exe -pef 'connectionStrings' 'path of folder containing web.config file'
Example::
aspnet_regiis.exe -pef 'connectionStrings' 'd:\sampleweb'
once encryption successfull, you will see the following changes in web.config file
<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>kR8gJug4ty5mJNKlwNpgpLYIZ+3Xx+XI
+LO9QUm5UPbM3ddHWcfjRVOl7lLG/CtevZlR3AY5XgZ1amOI
+YhrM5AMMWQEQF6X70Ix16DUUJojgPyujNm2vrLDPb0vuKct
+ymDFc0VM8UgGkg9Rllo/PeE1vkT4WennJ5JFTH5Bqk18jnP
+iRnTCPkhlENQyALANKtEc2T5ypjhj7iA==>
</CipherValue>
</CipherData>
<EncryptedKey>
<KeyInfo>
<CipherData>
<CipherValue>y+X4FWyHYbipzmyTKsLQBdppHUO>
+Cp0Igu5aJvyxVk/2n2q2udVMm5eimIEztKHcdJEV6SHdBt
yOsKLrffsdfsdsdfsdfBj3lRETCl7v22Ke+ZKTH9dTSe7Ht
+7IGho+ZP9uQ+mVI+xEuxfExJ/VLuOwhfWs=>
</CipherValue>
</CipherData>
</EncryptedData>
</connectionStrings>

step 2: Decrypting connectionstring in web.config
syntax:
aspnet_regiis.exe -pdf 'connectionStrings'
'path of folder containing web.config file'
Example::
aspnet_regiis.exe -pdf 'connectionStrings' 'd:\sampleweb'