Kernel 8.0 APIs Banner
Office of Information and Technology (OIT) Banner
[skip navigation]

$$AESENCR^XUSHSH(): Returns AES Encrypted Ciphertext for String Entry

Reference Type: Supported, Category: Data Security, ICR#: 6189

Description

The $$AESENCR^XUSHSH extrinsic function returns the Advanced Encryption Standard (AES) encrypted ciphertext for a string entry. AES is a specification for the encryption of electronic data established by the U.S. National Institute of Standards and Technology (NIST) in 2001.

NOTE: This API was released with Kernel Patch XU*8.0*655.

Format

  $$AESENCR^XUSHSH(text,key[,iv])

Input Parameters

text:

(required) The plaintext string to be encrypted.

key: (required) The input key material 16, 24, or 32 characters long.
iv: (optional) The initialization vector. If this argument is present, it must be 16 characters long.

Output

returns:

Returns the AES encrypted ciphertext for the string entry in the text input parameter.

Example

NOTE: The AES encryption API returns Unicode ciphertext, which does not properly display on an ASCII roll-and-scroll terminal; so the example demonstrated output is Base64 encoded before display.

>W $$B64ENCD^XUSHSH($$AESENCR^XUSHSH("This is a test","Encr4pt10nK3y"))
STbvalBtOxy754eRo15Bkg==