AES ECB Encryption and Decryption Support

Updated 

Guided Workflows supports AES ECB (Electronic Codebook) encryption and decryption to help secure data exchanged within workflows and external integrations.

You can use AES ECB encryption to:

  • Secure workflow variables before transmitting them to external systems.
  • Encrypt sensitive data in integration payloads.
  • Exchange encrypted information with third-party applications.
  • Meet integration requirements for systems that expect AES ECB–encrypted data.

Supported Scenarios

AES ECB encryption can be used to:

  • Encrypt sensitive workflow data before sending it to external applications.
  • Decrypt previously encrypted values during workflow execution.
  • Support integrations that require AES ECB encryption.
  • Secure URLs, tokens, identifiers, and other workflow variables.
  • Maintain compatibility with external platforms that consume AES ECB–encrypted payloads.

Encrypt Data in HEX Format

Use HEX output when a downstream system requires encrypted values encoded as hexadecimal characters.

Common Use Cases

Use HEX encryption when:

  • An API or external application requires encrypted values in hexadecimal format.
  • An integration partner mandates HEX-encoded AES-encrypted payloads.
  • Encrypted output must contain only hexadecimal characters (0-9 and A-F).

Syntax

JavaScript

encryptAESECB(encryptionKey, valueToEncrypt, "HEX")

Parameters

Parameter

Description

encryptionKey

AES encryption key. Must be 16 characters long.

valueToEncrypt

String to encrypt.

"HEX"

Returns the encrypted output in hexadecimal format.

Example

JavaScript

encryptAESECB("1234567890123456", "CustomerData", "HEX")

The function returns the encrypted value as a HEX string.

Output Format

HEX encryption returns a string containing only:

  • 0-9
  • A-F

This format can be passed directly to systems that require hexadecimal encrypted values.

Considerations

  • AES ECB encryption requires a 16-character key.
  • Specify "HEX" as the third parameter to generate hexadecimal output.
  • The encrypted value is returned as a hexadecimal string that can be sent directly to external systems.

Encrypt and Decrypt Data in Base64 Format

By default, AES ECB encryption returns output in Base64 format.

Encrypt Data

Use the following function to encrypt a value:

JavaScript

encryption_utils.encryptAESECB(key, value)

Parameters

Parameter

Description

key

16-character encryption key

value

Value to encrypt

Note: The encryption key must contain exactly 16 characters. Use the same key for both encryption and decryption operations.

Decrypt Data

Use the following function to decrypt an encrypted value:

JavaScript

encryption_utils.decryptAESECB(key, encryptedValue)

Parameters

Parameter

Description

key

The same 16-character key used during encryption

encryptedValue

Encrypted value to decrypt

Note: Decryption succeeds only when the same key used for encryption is provided during decryption.

Example

Step 1: Encrypt Data

JavaScript

var encryptedValue = encryption_utils.encryptAESECB(

"1234567890ABCDEF",

workflowVariable

);

Step 2: Store or Pass the Encrypted Value

Use the encrypted value in workflow variables, API requests, or integration payloads.

Step 3: Decrypt Data

​

JavaScript

var decryptedValue = encryption_utils.decryptAESECB(

"1234567890ABCDEF",

encryptedValue

);

Result

When the same key is used for both operations, the decrypted value matches the original input.

HEX vs. Base64 Output Formats

Criteria

HEX Format

Base64 Format

Character Set

Uses hexadecimal characters (0-9, A-F)

Uses letters, numbers, and additional encoding characters

Available Characters

16 possible characters

64 possible characters

Output Representation

Hexadecimal string

Base64-encoded string

Readability

Easy to identify as HEX data

More compact representation

Output Size

Larger output

Smaller, more compact output

Typical Usage

Required by systems that expect hexadecimal encrypted values

Common format for representing encrypted data

Function Usage

encryptAESECB(key, value, "HEX")

encryptAESECB(key, value, "BASE64")

Choosing an Output Format

  • Use HEX when an integration explicitly requires hexadecimal encrypted values.
  • Use Base64 when a compact encoded representation is preferred or when no specific format is required.

Key Requirements

  • AES ECB encryption requires a 16-character encryption key.
  • The same key must be used for encryption and decryption.
  • Output can be generated in either HEX or Base64 format depending on integration requirements.