Skip to main content

How can I encrypt the Autoform DM database connection password? - Knowledgebase / Autoform DM / Autoform DM FAQs - Formpipe Support Portal

How can I encrypt the Autoform DM database connection password?

Authors list

Autoform DM uses a password to connect to the database. This article shows how to encrypt the password.

This article only applies to standalone installations.


Two files are required for this process. These are:

  • efs-pbetool.jar

Click here for the Login Module Tool files

Installing the Login-Module

To install the Login-Module, follow these steps:

1. Extract the zip file

2. Extract pbeloginmodule-1.0.0-module zip file

3. Within the installation directory, open Autoform DM > Server_xx > wildfly_xx > modules > com

4. Copy and paste the extracted efstech folder (from pbeloginmodule-1.0.0-module) into the com folder of your installation, leaving you with two folders: Microsoft and efstech.

Encrypting the password

Please follow these steps in order to use the jar file to encrypt the password (Basic):

1. Open a command-line window with Admin rights.

2. Change the directory to the folder which has the jar file ‘efs-pbetool.jar’.

3. Run the command (replacing <password-to-encrypt> with the password): java -jar efs-pbetool.jar <password-to-encrypt>. 

For this example, using the password ‘pdm’, the command would be: 'java -jar efs-pbetool.jar pdm'.

4. Press Enter to run the command and wait for it to give you the encrypted password. Make a note of this password as you will need it later.

If you would like to make use of your own custom cipher key, this can be included in the command as below: (replacing <path/to/key-file> with the path to the keyfile)
java -jar efs-pbetool.jar <password-to-encrypt> <path/to/key-file>

As before, this will output the encrypted password (this time using your provided cipher key). Make a note of your encrypted password.

Configuring Autoform DM to use the encrypted password

To make use of the encrypted password you need to make a few changes to Autoform DM.

1. Go to the Autoform DM install directory and go into wildfly…./standalone/configuration There should be a folder path similar to the below:
 C:\Program Files (x86)\Formpipe Software\Autoform DM\Server_xx\wildfly-xx.Final\standalone\configuration

2. Copy the file ‘standalone.xml’ and paste this into your working directory (ideally a folder on the Autoform DM server called ‘Formpipe’ with a suitably named subfolder for Autoform DM password encryption).

3. Create another folder called ‘backup’ and paste another copy of the standalone.xml file into the backup folder for safekeeping.

4. Returning to your working folder, open the standalone.xml file with a text editor/source code editor (not Notepad). We recommend using editpadpro or notepad++.

5. Scroll down the file until you reach the section for Autoform DM’s connection to the database (about halfway down the file).
 Alternatively, you can search the file for the keyword ‘datasource’, which will bring you closer to the correct section of the code.

6. Replace the <security> section with the code below:

<security> <security-domain>EncryptedDSPassword</security-domain> </security>

It should now look like this:

7.  Locate the sectionsubsystem xmlns=“urn:jboss:domain:security. It will be near the bottom of the file. 

8. Add the following code to your file, replacing the appropriate credentials with your own. In the example below, it has been added to the bottom of the security-domain list section:

<security-domain name="EncryptedDSPassword"> <authentication> <login-module code="" flag="required" module=""> <module-option name="username" value="pdm"/> <module-option name="password" value="ENCRYPTED_PASSWORD"/> <module-option name="key-file" value="PATH_TO_KEY_FILE"/> <module-option name="managedConnectionFactoryName" value="jboss.jca:name=PDM,service=LocalTxCM" /> </login-module> </authentication> </security-domain>

9. Replace the ENCRYPTED_PASSWORD value in the password module option with the encrypted password you received from running the jar on the command line.
In this example, it is: 'B7YxHPMaJOv'.

10. If you used your own key-file when generating your encrypted password, replace the PATH_TO_KEY_FILE value in the key-file module-option with the actual path to your key file. OR remove the line from the configuration as it is not needed. In this example, the configuration does not make use of a key file, so the line has been removed:

11. Save the file.

12. Make a copy of your edited standalone.xml and return to the standalone/configuration folder in the AUTOFORM DM install directory:
 C:\Program Files (x86)\Formpipe Software\Autoform DM\Server_xx\wildfly-xxFinal\standalone\configuration

13. Change the current standalone.xml filename to 'standaloneOld.xml' (to provide another layer of backup).

14. Paste your encrypted password standalone.xml file into the folder and start the Autoform DM service.

If all of the changes have been made successfully then Autoform DM will start and allow you to log in and continue working as usual. If there is an issue with the configuration Autoform DM will not deploy, as the password it uses to connect to the database will not work.

Helpful Unhelpful

Add a comment

Please log in or register to submit a comment.

Need a password reminder?