encrypt

Description

The encrypt command takes a plaintext string and produces an encrypted value using the Detect encryption key. The resulting encrypted string can be stored in configuration files or databases instead of the original plaintext.

Syntax

encrypt -p "<plaintext_to_encrypt>" [-key-file-path "<path_to_key_properties_file>"]

Examples

Encrypt using the default key:
CliTool.bat encrypt -p "MySecretPassword"

Linux :

./CliTool.sh encrypt -p "MySecretPassword"
Note: Currently, the encrypt syntax does not support properties files.

Parameters

Parameter Required Description
-p <plaintext_to_encrypt> Yes The plaintext string value to encrypt. Enclose in quotes if the value contains spaces or special characters.
-key-file-path <path_to_file> No Path to a .properties file containing the active encryption key. If omitted, the default built-in key is used and a warning is printed.

Sample Output

Encrypted value: aGVsbG8gd29ybGQ=...
Note:
  • The -p flag must immediately precede the plaintext value.
  • If -key-file-path is not provided, the command will print:

    [WARN] No key file path provided, using default key.

  • Store the resulting encrypted value " it is required as input to the decrypt command.