Salsa20¶
Overview¶
Salsa20 is a stream cipher designed by Daniel J. Bernstein and submitted to the eSTREAM project; Salsa20/8 and Salsa20/12 are round-reduced variants. It is closely related to the ChaCha stream cipher.
Key: Salsa20 uses a key of 16 or 32 bytes (128 or 256 bits).
Nonce: Salsa20 uses a nonce of 8 bytes (64 bits).
Counter: Salsa uses a counter of 8 bytes (64 bits). The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes.
Status¶
| Field | Value |
|---|---|
| Implementation | Partial |
| Parity | Unknown |
| Availability | Available |
| Input requirement | Required |
| Features | none |
| Side effects | [] |
| Deterministic | true |
Input¶
Declared input type: String.
Output¶
Declared output type: Bytes. Redirect stdout or use --output-file for exact binary bytes.
Arguments¶
| # | Argument | Type | Required | Default | Allowed | Sensitive | Description |
|---|---|---|---|---|---|---|---|
| 1 | Key | Bytes |
yes | <empty> |
— | yes | Key (16 or 32 bytes) |
| 2 | Nonce | Bytes |
no | <empty> |
— | no | Nonce (8 bytes) |
| 3 | Counter | UnsignedInteger |
no | 0 |
— | no | Initial counter value |
| 4 | Rounds | Enum |
no | 20 |
20, 12, 8 | no | Number of rounds (20, 12, or 8) |
| 5 | Input | Enum |
no | Raw |
Raw, Hex | no | Input format (Raw, Hex) |
| 6 | Output | Enum |
no | Raw |
Raw, Hex | no | Output format (Raw, Hex) |
Implementation¶
The implementation is in src/operations/salsa20.rs and declares String input and Bytes output. The operation module owns conversion and domain-error rules; registry resolution, argument validation, input-requirement enforcement, tracing, and output validation are performed by rxchef::execution.
Command-line use¶
This operation requires input. Supply literal UTF-8 with --input, exact bytes with --input-file, or pipe bytes on stdin.
rxchef run "Salsa20" --input-file input.bin --output-file output.bin
Arguments may be supplied positionally in the table order or by name with repeatable --arg NAME=VALUE. Omitted optional arguments use the documented defaults.
Pipeline use¶
Place the operation anywhere a String value is valid. Its Bytes result becomes the next step's input. Compact syntax uses the operation name followed by comma-separated arguments; JSON/YAML recipes use an op field and an args array.
Error conditions¶
Schema violations are rejected before the operation runs. Malformed input, unsupported parameter combinations, unavailable optional backends, and domain processing failures produce structured errors and a non-zero CLI status; partial output is never reported as success.
CyberChef compatibility¶
Parity status: Unknown. Unknown records an unassessed compatibility claim; it does not imply equality or incompatibility.
Security considerations¶
Declared side effects: []. Treat parser inputs as untrusted and apply execution limits to large data. Arguments marked sensitive in the schema are redacted from metadata-aware History displays.
Testing evidence¶
Correctness tests: - tests/tests/operations/salsa20.rs
Performance classification¶
Excluded from the committed representative benchmark set: No stable representative benchmark case is defined; operation remains Partial until performance evidence is reviewed.