EncryptStr function

Syntax

EncryptStr(ClearTextString, KeyString,CipherAlgorithm)

Description

Use the EncryptStr function to encrypt a string.

The value you use for KeyString must be the same for DecryptStr and EncryptStr.

The EncryptStr function uses the AES128 (Advanced Encryption Standard) cipher algorithm.

In this algorithm, the length of clear text after cipher will increase by three-quarters (¾) of the original input string, that is, input string plus three-quarters (¾) of the input string.

Parameters

Parameter Description

ClearTextString

Specify the string you want encrypted.

This parameter is required.

KeyString

Specify the key used for encrypting the string.

This parameter is optional. However, as a safe security practice, Oracle recommends that you generate an AES128 key. You may use the GenSecureKey function to generate a key. If you plan to generate a key on your own, you must have a thorough knowledge of the AES128 key size because Oracle does not provide guidelines on generating or managing keys.

Refer to the PeopleSoft Security Practices Technical Brief.

CipherAlgorithm

Specify the cipher algorithm. The default is AES128.

This parameter is optional.

Returns

An encrypted string (CipherBase64Text).

Example

Encrypted-Based64-String = EncryptStr("Cleartext String as required field", "Cleartext-KeyString as optional field", "AES128 as optional field and default as AES128");