Encrypting & Decrypting the database connection strings in web 3.0

Web 3.0 utilizes the Microsoft .NET encryption to encrypt the connection strings in the web.config file.

If the connectionStrings section of the web.config file is already encrypted then you will need to decrypt it before adding any connection information.  If the configuration is not encyrpted then you can skip directly to the encryption section

To decrypt the connection strings:

  1. Open a command prompt as administrator
  2. Change directory to %windows%\Microsoft.NET\Framework\versionNumber
  3. Run the following command (replace "uluroweb30" with the name of the web 3.0 site in IIS)

    aspnet_regiis -pd "connectionStrings" -app "/"  -site “uluroweb30”

    or

    replace PATH with the path to the directory containing the web.config file

    aspnet_regiis -pdf "connectionStrings" “PATH”

To encrypt the connection strings:

  1. Open a command prompt as administrator
  2. Change directory to %windows%\Microsoft.NET\Framework\versionNumber
  3. Run the following command (replace "uluroweb30" with the name of the web 3.0 site in IIS)

    aspnet_regiis -pe "connectionStrings" -app "/"  -site “uluroweb30”

    or

    replace PATH with the path to the directory containing the web.config file

    aspnet_regiis -pef "connectionStrings" “PATH”

  4. Open the web.config file with a text editor to ensure the encryption has been set.

    The encrypted connection string should appear as
    <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>n/zynKbSuIPDiyR44df1zZcDJSTfND7qQ8vduh83yEU0GcI+fD3LHdFcAkMZyfHfnsKpfMXf6F3zd4UyDjSJDBduN17xe0COGLyrivFifFtw1VcpRHLwR+z9MF9yVyi9a2Sbj5YO8nU50zJgOnN53GaM5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oGApECgvDtRBN8BcFaflMWzX+GxL0NCvi4poQiuSsD58/j1I0rl4kTUzA499s+uYy8WuX7OVh6gbXzlaSBvqj08+VtA+ewqW8S5bcPQdiG8EjAj1Be6VPc8qJb43H9JJF/8BtQ7ve+w=</CipherValue>
       </CipherData>
      </EncryptedData>
     </connectionStrings>

 

0 Comments

Article is closed for comments.
Powered by Zendesk