SIGABA
Category: Bletchley
Status: Registered and callable in the CyberChef 11.3.0 compatibility inventory.
Input / output: string → string
Background: https://wikipedia.org/wiki/SIGABA
What it does
Encipher/decipher with the WW2 SIGABA machine. SIGABA, otherwise known as ECM Mark II, was used by the United States for message encryption during WW2 up to the 1950s. It was developed in the 1930s by the US Army and Navy, and has up to this day never been broken. Consisting of 15 rotors: 5 cipher rotors and 10 rotors (5 control rotors and 5 index rotors) controlling the stepping of the cipher rotors, the rotor stepping for SIGABA is much more complex than other rotor machines of its time, such as Enigma. All example rotor wirings are random example sets. To configure rotor wirings, for the cipher and control rotors enter a string of letters which map from A to Z, and for the index rotors enter a sequence of numbers which map from 0 to 9. Note that encryption is not the same as decryption, so first choose the desired mode. Note: Whilst this has been tested against other software emulators, it has not been tested against hardware.
Note
Status here means the operation name is implemented and callable. It does not by itself promise byte-for-byte parity for every upstream option. See Compatibility and current status for the verified scope and known boundaries.
Warning
Historical machine presets currently cover a documented compatibility subset.
Arguments and options
Arguments are positional. Keep their order when using bake() or
Pipeline.then().
Index |
Name |
UI type |
PyChef default |
Accepted values / format |
|---|---|---|---|---|
|
1st (left-hand) cipher rotor |
|
|
|
|
1st cipher rotor reversed |
|
|
|
|
1st cipher rotor initial value |
|
|
|
|
2nd cipher rotor |
|
|
|
|
2nd cipher rotor reversed |
|
|
|
|
2nd cipher rotor initial value |
|
|
|
|
3rd (middle) cipher rotor |
|
|
|
|
3rd cipher rotor reversed |
|
|
|
|
3rd cipher rotor initial value |
|
|
|
|
4th cipher rotor |
|
|
|
|
4th cipher rotor reversed |
|
|
|
|
4th cipher rotor initial value |
|
|
|
|
5th (right-hand) cipher rotor |
|
|
|
|
5th cipher rotor reversed |
|
|
|
|
5th cipher rotor initial value |
|
|
|
|
1st (left-hand) control rotor |
|
|
|
|
1st control rotor reversed |
|
|
|
|
1st control rotor initial value |
|
|
|
|
2nd control rotor |
|
|
|
|
2nd control rotor reversed |
|
|
|
|
2nd control rotor initial value |
|
|
|
|
3rd (middle) control rotor |
|
|
|
|
3rd control rotor reversed |
|
|
|
|
3rd control rotor initial value |
|
|
|
|
4th control rotor |
|
|
|
|
4th control rotor reversed |
|
|
|
|
4th control rotor initial value |
|
|
|
|
5th (right-hand) control rotor |
|
|
|
|
5th control rotor reversed |
|
|
|
|
5th control rotor initial value |
|
|
|
|
1st (left-hand) index rotor |
|
|
|
|
1st index rotor initial value |
|
|
|
|
2nd index rotor |
|
|
|
|
2nd index rotor initial value |
|
|
|
|
3rd (middle) index rotor |
|
|
|
|
3rd index rotor initial value |
|
|
|
|
4th index rotor |
|
|
|
|
4th index rotor initial value |
|
|
|
|
5th (right-hand) index rotor |
|
|
|
|
5th index rotor initial value |
|
|
|
|
SIGABA mode |
|
|
|
Recipe template
Important
This is a call template built from the documented defaults. Replace placeholder values such as empty keys, paths, patterns, or lookup data before running it.
from pychef import bake
input_value = "example"
args = ['SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '6201348957', '0123456789', '6201348957', '0123456789', '6201348957', '0123456789', '6201348957', '0123456789', '6201348957', '0123456789', 'Encrypt']
result = bake(input_value, [{"op": 'SIGABA', "args": args}])
print(result)
Pipeline example
from pychef import Pipeline
args = ['SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '6201348957', '0123456789', '6201348957', '0123456789', '6201348957', '0123456789', '6201348957', '0123456789', '6201348957', '0123456789', 'Encrypt']
transform = Pipeline().then('SIGABA', *args)
result = transform("example")
Direct call
pychef.ops.run_operation runs any registered operation as a plain function,
under the active ExecutionPolicy (safe defaults, no network):
from pychef.ops import run_operation
args = ['SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '6201348957', '0123456789', '6201348957', '0123456789', '6201348957', '0123456789', '6201348957', '0123456789', '6201348957', '0123456789', 'Encrypt']
result = run_operation('SIGABA', "example", args=args)
Common operations also have typed helpers in Direct operations.
Low-level operation module
Warning
The module below is an internal implementation detail. It applies no execution
policy, resource limits, or error sanitization; prefer bake(), Pipeline,
or pychef.ops for application code.
The registered entry point lives in
pychef.operations.by_operation.sigaba. Direct calls
receive the input value and a positional argument tuple:
from pychef.operations.by_operation.sigaba import run
result = run("example", tuple(['SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'SRGWANHPJZFXVIDQCEUKBYOLMT', False, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '6201348957', '0123456789', '6201348957', '0123456789', '6201348957', '0123456789', '6201348957', '0123456789', '6201348957', '0123456789', 'Encrypt']))
- pychef.operations.by_operation.sigaba.run(value, args)
Run this operation using its shared internal implementation.
- Parameters:
value (str | bytes)
args (Sequence[Any])
- Return type:
str | bytes