The SET ENCRYPTION PASSWORD statement sets the default password and hint that will be used by the encryption and decryption functions. The password is not associated with authentication and is only used for data encryption and decryption.
For information about using this statement, see ENCRYPT_AES, ENCRYPT_RC2, ENCRYPT_TDES, and DECRYPT_BIT, DECRYPT_BINARY, DECRYPT_CHAR and DECRYPT_DB.
This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.
If a global variable
is referenced in the statement, the privileges held by the authorization
ID of the statement must include at least one of the following:

.- = -. >>-SET--ENCRYPTION PASSWORD--+-----+----------------------------> >--+-password-variable--------+---------------------------------> '-password-string-constant-' >--+--------------------------------------------+-------------->< | .-=-. | '-WITH HINT--+---+--+-hint-variable--------+-' '-hint-string-constant-'
The variable:
The variable:
Password protection: To prevent inadvertent access to the encryption password, do not specify password-string-constant in the source for a program, procedure, or function. Instead, use a variable.
When connected to a remote relational database, the specified password itself is sent "in the clear". That is, the password itself is not encrypted. To protect the password in these cases, consider using a communications encryption mechanism such as IPSEC (or SSL if connecting between System i® products).
Transaction considerations: The SET ENCRYPTION PASSWORD statement is not a commitable operation. ROLLBACK has no effect on the default encryption password or default encryption password hint.
Initial encryption password value: The initial value of both the default encryption password and the default encryption password hint is the empty string ('').
Encryption password scope: The scope of the default encryption password and default encryption password hint is the activation group and connection.
Set the ENCRYPTION PASSWORD to the value in :hv1.
SET ENCRYPTION PASSWORD :hv1