Encrypt the database password

To encrypt a password, you can execute the CustomizeDeploy.dll file located in the PowerBuilder IDE installation folder (%AppeonInstallPath%\PowerBuilder [version]\Pstools\CustomizeDeploy) or in the deployed application on the Web server.

To execute the CustomizeDeploy.dll file located in the PowerBuilder IDE installation folder, there is no need to install the ASP.NET Core Runtime as it is already installed with PowerServer Toolkit.

To execute the CustomizeDeploy.dll file located in the deployed application on the Web server, you will need to install the ASP.NET Core Runtime first, as explained in the following steps.

To encrypt a password (such as the database login password) for the database connection cache:

  1. Install the ASP.NET Core Runtime 3.1 or later.

  2. Open the command prompt. (You'd better run the command prompt using an administrator by right-clicking it and then selecting "Run as administrator").

  3. Navigate to the PowerBuilder IDE installation folder (%AppeonInstallPath%\PowerBuilder [version]\Pstools\CustomizeDeploy) or Web server root folder > [application] folder > "1.01" (for example, C:\inetpub\wwwroot\pssales\1.01).

  4. Execute the CustomizeDeploy.dll file using the dotnet command.

    dotnet CustomizeDeploy.dll -encrypt=<string>
    dotnet CustomizeDeploy.dll -encrypt=<string> -outfile=<output file>

    The "encrypt" argument should be set to the value that needs to be encrypted.

    The "outfile" argument can save the encrypted value in the specified location and file.



    When creating a database connection cache in the PowerServer project painter > Database Configuration, or in the PowerServer C# solution > ServerAPIs project > AppConfig > Applications.json file, instead of inputting the plain text of the database login password, you can encrypt it using the above command, and then input the encrypted value instead of the plain text.

    Note

    If special characters are contained in the value, use double quotation marks (in Windows) or single quotation marks (in Linux) to include the entire value. For example,

    In Windows, to encrypt the value post!gres

    dotnet CustomizeDeploy.dll -encrypt="post!gres"

    If the quotation mark is contained as part of value, then place the escape character \ before the quotation mark. For example, to encrypt the value postgr”es

    dotnet CustomizeDeploy.dll -encrypt="postgr\”es"