Random Value
Generates a cryptographically secure random value of a user-selected type (bytes/string/int/bool)
Overview
Generates a fresh cryptographically secure pseudorandom value on every workflow execution using the platform CSPRNG (crypto.getRandomValues). Depending on the selected Type parameter, it produces random Bytes of a specified byte length, a random printable ASCII String, a uniform random Int within an inclusive range [Min, Max], or a random Bool.
Unlike deterministic fallback defaults on cipher nodes, Random Generator produces a new unpredictable value each time you click Run, making it ideal for generating fresh session keys, nonces, salts, and fuzzing inputs.
When to Use
- Generating fresh symmetric keys (16, 24, or 32 bytes), initialization vectors (16 bytes), AEAD nonces (12 bytes), or KDF salts (16+ bytes) on each run.
- Creating random challenges, nonces, or fuzz-testing payloads of configurable length or integer range.
- Testing signature or encryption round-trips with randomized inputs rather than fixed static constants.
Parameter Configuration
| Parameter (ID) | Type & Default | Visibility Condition | Description & Options |
|---|---|---|---|
Typetype |
selectDefault: bytes |
Always visible | Chooses the primitive data type generated at runtime (bytes, string, int, or bool).
|
Lengthlength |
numberDefault: 16 |
When type is bytes or string |
Number of bytes to generate when Type = bytes, or number of printable ASCII characters (0x21..0x7E) when Type = string. Clamped to the range 1..65536. |
MinintMin |
numberDefault: 0 |
When type is int |
Inclusive lower bound when Type = int. If Min > Max, the engine automatically swaps the bounds. |
MaxintMax |
numberDefault: 100 |
When type is int |
Inclusive upper bound when Type = int. |
Port I/O Specification
See Ports & Connections for general wiring rules, data type colors, and dynamic port creation.
Input Ports
This node has no input ports.
Output Ports
Port Nature: Fixed Output Ports (1 total).
| Port Name | Port ID | Data Type | Visibility Condition | Description |
|---|---|---|---|---|
Value |
bytes |
Bytes |
Always visible | Outputs the generated random value in the selected data type (Bytes, String, Int, or Bool). |
Error Cases
This node has no runtime failure cases (errorProfile: none) and always succeeds for any valid typed input.
Examples
Generating a Fresh 12-Byte AES-GCM Nonce
Produce a random 96-bit nonce for authenticated encryption.
- Set Type to
Bytesand Length to12. - Connect the
Randomoutput port to theNonceinput port of AES Encrypt (withCipher Mode = GCM) and also to the corresponding AES Decrypt node.