How to Encrypt Database Connection Strings
CAM provides a file that can be run by system administrators to encrypt database connection strings in the web application configuration files.
The system administrator can encrypt database connection strings in several web application configuration files, including those used in Purchasing, Reporting Applications, and the CAM Access Point, as well as other configuration files used for data retrieval functions.
Good to know:
- The program uses the local machine's certificate to encrypt the credentials.
- You must have Administrator privileges to install the program and encrypt or decrypt files.
- Run
Encryptwebconfigs.exe -help
to see a list of possible commands.
Install the Tool
- Contact Cherwell to obtain the file.
- Copy the file to the
C:\Program Files (x86)\Cherwell Asset Management\CAM Web
directory. - Run
C:\Program Files (x86)\Cherwell Asset Management\CAM Web\EncryptWebConfigs.msi
to install the program.The MSI file runs, but does not provide additional feedback. - Go to the following location to verify the installation was
successful:
C:\Program Files (x86)\Cherwell Asset Management\CAM Web\Encrypt Web Configs
Encrypt Web Application Configuration Files
- Open a command prompt as an Administrator.
- Change the directory to
C:\Program Files (x86)\Cherwell Asset Management\CAM Web\Encrypt Web Configs
- Run the following command to display all the files the tool is
going to encrypt, without actually encrypting them:
Encryptwebconfigs.exe -dryrun
- Run the following command to encrypt the files:
Encryptwebconfigs.exe -encrypt
Decrypt Web Application Configuration Files
- Open a command prompt as an Administrator.
- Change the directory to
C:\Program Files (x86)\Cherwell Asset Management\CAM Web\Encrypt Web Configs
- Run the following command to display all the files the tool is
going to decrypt, without actually decrypting them:
Encryptwebconfigs.exe -dryrun
- Run the following command to decrypt the files:
Encryptwebconfigs.exe -decrypt
Update the Database Server's Connection Details
- Open a command prompt as an Administrator.
- Change the directory to
C:\Program Files (x86)\Cherwell Asset Management\CAM Web\Encrypt Web Configs
- Run the following command to show all the files and values that
will change, without actually making the changes:
Encryptwebconfigs.exe -dryrun -server=servername -database=databasename -user=username -password=password
This command can be run for any combination of values. If a value is not specified in the command line, it's assumed the value stays the same. - Run the command without the dryrun:
Encryptwebconfigs.exe -server=servername -database=databasename -user=username -password=password
If the connection string is not already encrypted, this command automatically encrypts the string at the same time.
Encryptwebconfigs.exe -decrypt
Uninstall the Program
Uninstalling the program does not decrypt the files; it only removes the program from the server. If you need to later decrypt the files or change the database, reinstall the program.
- Open your Control Panel, then select
Cherwell Asset Management
Credential Encryption Tool.
Your path in the Control Panel may vary, depending on your version of Windows.
, then find and select
- Select Uninstall.