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







Options

The command accepts the following options:

Option

Description

Option

Description

[<password>]

The password you want to encrypt.

[-a|-alias]

Use this option to encrypt a password with an alias.

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 mz.cryptoservice.keystore.path and mz.cryptoservice.keystore.password. The keystore must also contain keys for all the aliases you want to use. For further information about these properties, see 2.6.4 Platform Properties in the System Administrator's Guide.

[-e]

Use this option to encrypt a password with another alias.



Return Codes

Listed below are the different return codes for the encryptpassword command:

Code

Description

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.