2.1.4 encryptpassword
usage: encryptpassword [[<password>] | [-a|-alias <alias> [<password> | -e <encryptedpassword>]]]
Encrypts a password and prints out the result. Use this command to create an encryption of a password.
When you run encryptpassword in non-interactive mode, special shell characters must be escaped or the password may become truncated. You can use backslash (\) to escape a special character.
Example - Escaping special character
$ mzsh encryptpassword example\$password
You can escape all special characters in a string by surrounding it with single quotes (').
Example - Escaping all characters in a string
$ mzsh encryptpassword '`examplepassword!#$&()|\";'<> '
If single quote characters are part of the password, these can be escaped with backslash (\).
Example - Escaping single quote characters
$ mzsh encryptpassword '&example#'\'password
Hint!
Options
The command accepts the following options:
Option | Description |
---|---|
[<password>] | The password you want to encrypt. |
[-a|-alias] | Use this option to encrypt a password with an alias. Note! In order to use this option, an alias must have been generated with the Java keytool. When this option is not used, the system default key will be used.If you want to use this option, the path and password to the keystore has to be indicated by setting the Platform properties |
[-e] | Use this option to encrypt a password with another alias. |
Note!
-a
and -e
options.Return Codes
Listed below are the different return codes for the encryptpassword
command:
Code | Description |
---|---|
0 | Will be returned if the command was successful. |
1 | Will be returned if the argument count is incorrect. |
3 | Will be returned if the encryption went wrong. |