DES Encrypt
Single DES (56-bit effective, 8-byte key) Encryption (FIPS 46-3 Legacy)
Overview
Encrypts data using the legacy 64-bit Single Data Encryption Standard (DES) (FIPS 46-3) with an 8-byte key (56 effective key bits plus 8 parity bits) across CBC, ECB, CTR, CFB, or OFB modes.
Single DES is cryptographically broken due to its 56-bit key space and is provided strictly for legacy protocol interoperability (such as ISO/IEC 9797-1 Retail MACs, legacy smartcard APDUs, and educational Feistel network analysis).
When to Use
- Reproducing legacy FIPS 46-3 test vectors, Retail MAC intermediate steps, or historical 8-byte block protocols.
Parameter Configuration
| Parameter (ID) | Type & Default | Visibility Condition | Description & Options |
|---|---|---|---|
Cipher Modemode |
selectDefault: ECB |
Always visible | Selects CBC, ECB, CTR, CFB, or OFB mode. See Block Cipher Modes for full details.
|
Paddingpadding |
selectDefault: None |
Always visible | 8-byte block padding scheme applied in ECB and CBC modes. See Padding Schemes for full details.
|
Unify ErrorserrorUnify |
booleanDefault: false |
Always visible | Replaces built-in errors with a custom error code/message when enabled. |
Unified Error CodeerrorUnifyCode |
textDefault: "" (empty) |
When errorUnify is true |
Custom error code when Unify Errors is enabled. |
Unified Error MessageerrorUnifyMessage |
textDefault: "" (empty) |
When errorUnify is true |
Custom error message when Unify Errors is enabled. |
Port I/O Specification
See Ports & Connections for general wiring rules, data type colors, and dynamic port creation.
Input Ports
Port Nature: Fixed Input Ports (3 total; conditionally visible ports depend on parameter settings as shown below).
| Port Name | Port ID | Data Type | Required | Visibility Condition | Description |
|---|---|---|---|---|---|
Key |
key |
Bytes |
Required | Always visible | 8-byte (64-bit, 56-bit effective) DES key. |
Plaintext |
plaintext |
Bytes |
Required | Always visible | Plaintext bytes (Uint8Array) to encrypt. |
IV |
iv |
Bytes |
Optional | When mode is CBC |
8-byte IV for CBC, CTR, CFB, and OFB modes (defaults to 8 zero bytes if unconnected). |
Output Ports
Port Nature: Fixed Output Ports (1 total).
| Port Name | Port ID | Data Type | Visibility Condition | Description |
|---|---|---|---|---|
Ciphertext |
ciphertext |
Bytes |
Always visible | Encrypted output bytes (Uint8Array). |
Error Cases
When any of the following conditions occurs at runtime, this node transitions to an ERROR state and downstream nodes connected to its outputs do not execute. Enabling Unify Errors (errorUnify) replaces all error codes below with your configured unified error code and message.
| Error Code | Default Engine Message | Trigger Condition |
|---|---|---|
INVALID_KEY_LENGTH |
Invalid key length | Raised when Key is not exactly 8 bytes. |
PLAINTEXT_NOT_BLOCK_ALIGNED |
In NoPad mode the plaintext length must be a multiple of the block size | Raised in ECB/CBC mode when Padding = None and Plaintext length is not a multiple of 8 bytes. |
Examples
Encrypting an 8-Byte Block with Single DES-ECB
Run a raw single-block DES encryption without padding.
- Set Cipher Mode to
ECBand Padding toNone. - Connect an 8-byte key to
Keyand an 8-byte block toPlaintext.