Encrypt the password

In the following areas where you need to specify a password, you can encrypt the password, and then input the encrypted value instead of the plain text:

  • the database login password in the compiled Web APIs > AppConfig folder > Applications.json file,

    Note: There is no need to encrypt the password in the project painter, the IDE will automatically encrypt it for you when deploying the project.

  • the proxy server password in the compiled Web APIs > UserConfig.json file > "ProxyOptions", or

  • the email account password in the compiled Web APIs > UserConfig.json file > "EmailOptions"

To encrypt a password, you can execute the CustomizeDeploy.dll file located in the PowerBuilder IDE installation folder or on the server. We recommend you execute the CustomizeDeploy.dll file located in the PowerBuilder IDE installation folder, so that you need not to install the ASP.NET Core Runtime as it is already installed with PowerServer Toolkit.

If you execute the CustomizeDeploy.dll file located on the server, you will need to install the ASP.NET Core Runtime first (see instructions in the previous section).

To encrypt a password:

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

  2. Navigate to the PowerBuilder IDE installation folder (%AppeonInstallPath%\PowerBuilder [version]\Pstools\CustomizeDeploy).

  3. 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.



    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"