This documentation is for WSO2 Carbon 4.4.0. View documentation for the latest release.
Page Comparison - Encrypting Passwords with Cipher Tool (v.55 vs v.56) - Carbon 4.4.0 - WSO2 Documentation
Due to a known issue do not use JDK1.8.0_151 with WSO2 products. Use JDK 1.8.0_144 until JDK 1.8.0_162-ea is released.

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


  1. The first step is to update the file and the file with information of the passwords that you want to encrypt. 

    1. Open the file stored in the <PRODUCT_HOME>/repository/conf/security folder. The file should contain information about the files in which the passwords (that require encryption) are located as shown below:

      Code Block

      For example, if you want to encrypt the admin user password in the user-mgt.xml file, the following should be added to the file:

      Code Block

      Either the relative path or the absolute path of each file starting from <PRODUCT_HOME> should be given. The last value that follows the file path is set to 'true' or 'false' indicating whether or note the value to be encrypted is an attribute. 

    2. Open the file stored in the <PRODUCT_HOME>/repository/conf/security folder. This file should contain the secret alias names and the corresponding plain text passwords (enclosed within square brackets) as shown below.

      Code Block

      For example, if you want to encrypt the admin user password in the user-mgt.xml file, the following should be added to the file:

      Code Block

    By default, the file and the file files that is are shipped with your product pack will contain information on the most common passwords that require encryption. If a required password is missing in the default files, you can add them manually. For example, if you want to encrypt a the password that is used to connect to an LDAP user store connection password (configured in the user-mgt.xml file), add the following: 

    1. Add a new entry to the file as shown below. Note that the <alias> value should be the same value that is hard coded in the relevant Carbon component. In the case of user store connection password, there are two possible alias values as shown below.

      • Using the UserStoreManager.Property.ConnectionPassword alias:

        Code Block
      • Using the UserManager.Configuration.Property.ConnectionPassword alias:

        Code Block
    2. Add a new entry to the file corresponding to the new entry in the file:

      Code Block
      //Use the alias corresponding to the value in the file.
    3. Save the information.

  2. Open a command prompt and go to the <PRODUCT_HOME>/bin directory, where the cipher tool scripts (for Windows and Linux) are stored. 

  3. Execute the cipher tool script from the command prompt using the command relevant to your OS: 

    • On Linux: ./ -Dconfigure

    • On Windows: ./ciphertool.bat -Dconfigure

  4. The following message will be prompted:  "[Please Enter Primary KeyStore Password of Carbon Server :]". Enter the keystore password (which is "wso2carbon" for the default keystore) and proceed. If the script execution is successful, you will see the following message: "Secret Configurations are written to the property file successfully".


    If you are using the cipher tool for the first time, the-Dconfigure command will first initialize the tool for your product. The tool will then start encrypting the plain text passwords you specified in the file.

    Shown below is an example of an alias and the corresponding plain text password (in square brackets) in the file:

    Code Block

    If a password is not specified in the file for an alias, the user needs to provide it through the command line. Check whether the alias is a known password alias in Carbon configurations. If the tool modifies the configuration element and file, you must replace the configuration element with the alias name. Define a Secret Callback in the configuration file and add proper namespaces for defining the Secure Vault.

  5. Now, to verify the password encryption: 
    • Open the file and see that the plain text passwords are replaced by a cipher value.

    • Open the file from the <PRODUCT_HOME>/repository/conf/security/ folder and see that the default configurations are changed.