Colossus

Category: Bletchley

Status: Registered and callable in the CyberChef 11.3.0 compatibility inventory.

Input / output: string → JSON

Background: https://wikipedia.org/wiki/Colossus_computer

What it does

Colossus is the name of the world’s first electronic computer. Ten Colossi were designed by Tommy Flowers and built at the Post Office Research Labs at Dollis Hill in 1943 during World War 2. They assisted with the breaking of the German Lorenz cipher attachment, a machine created to encipher communications between Hitler and his generals on the front lines. To learn more, Virtual Colossus, an online, browser based simulation of a Colossus computer is available at virtualcolossus.co.uk. A more detailed description of this operation can be found here.

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.

Arguments and options

Arguments are positional. Keep their order when using bake() or Pipeline.then().

Index

Name

UI type

PyChef default

Accepted values / format

0

Input

label

None

Any value supported by this argument type

1

Pattern

option

'KH Pattern'

'KH Pattern', 'ZMUG Pattern', 'BREAM Pattern'

2

QBusZ

option

''

'', 'Z', 'ΔZ'

3

QBusΧ

option

''

'', 'Χ', 'ΔΧ'

4

QBusΨ

option

''

'', 'Ψ', 'ΔΨ'

5

Limitation

option

'None'

'None', 'Χ2', 'Χ2 + P5', 'X2 + Ψ1', 'X2 + Ψ1 + P5'

6

K Rack Option

argSelector

'Select Program'

'Select Program', 'Top Section - Conditional', 'Bottom Section - Addition', 'Advanced'

7

Program to run

option

''

'', 'Letter Count', '1+2=. (1+2 Break In, Find X1,X2)', '4=5=/1=2 (Given X1,X2 find X4,X5)', '/,5,U (Count chars to find X3)'

8

K Rack: Conditional

label

None

Any value supported by this argument type

9

R1-Q1

editableOptionShort

'SWITCHES'

'.', '', 'x'

10

R1-Q2

editableOptionShort

'SWITCHES'

'.', '', 'x'

11

R1-Q3

editableOptionShort

'SWITCHES'

'.', '', 'x'

12

R1-Q4

editableOptionShort

'SWITCHES'

'.', '', 'x'

13

R1-Q5

editableOptionShort

'SWITCHES'

'.', '', 'x'

14

R1-Negate

boolean

False

True or False

15

R1-Counter

option

''

'', '1', '2', '3', '4', '5'

16

R2-Q1

editableOptionShort

'SWITCHES'

'.', '', 'x'

17

R2-Q2

editableOptionShort

'SWITCHES'

'.', '', 'x'

18

R2-Q3

editableOptionShort

'SWITCHES'

'.', '', 'x'

19

R2-Q4

editableOptionShort

'SWITCHES'

'.', '', 'x'

20

R2-Q5

editableOptionShort

'SWITCHES'

'.', '', 'x'

21

R2-Negate

boolean

False

True or False

22

R2-Counter

option

''

'', '1', '2', '3', '4', '5'

23

R3-Q1

editableOptionShort

'SWITCHES'

'.', '', 'x'

24

R3-Q2

editableOptionShort

'SWITCHES'

'.', '', 'x'

25

R3-Q3

editableOptionShort

'SWITCHES'

'.', '', 'x'

26

R3-Q4

editableOptionShort

'SWITCHES'

'.', '', 'x'

27

R3-Q5

editableOptionShort

'SWITCHES'

'.', '', 'x'

28

R3-Negate

boolean

False

True or False

29

R3-Counter

option

''

'', '1', '2', '3', '4', '5'

30

Negate All

boolean

False

True or False

31

K Rack: Addition

label

None

Any value supported by this argument type

32

Add-Q1

boolean

False

True or False

33

Add-Q2

boolean

False

True or False

34

Add-Q3

boolean

False

True or False

35

Add-Q4

boolean

False

True or False

36

Add-Q5

boolean

False

True or False

37

Add-Equals

editableOptionShort

'SWITCHES'

'.', '', 'x'

38

Add-Counter1

boolean

False

True or False

39

Add Negate All

boolean

False

True or False

40

Total Motor

editableOptionShort

'SWITCHES'

'.', '', 'x'

41

Master Control Panel

label

None

Any value supported by this argument type

42

Set Total

number

0

A Python integer or floating-point value

43

Fast Step

option

''

'', 'X1', 'X2', 'X3', 'X4', 'X5', 'M37', 'M61', 'S1', 'S2', 'S3', 'S4', 'S5'

44

Slow Step

option

''

'', 'X1', 'X2', 'X3', 'X4', 'X5', 'M37', 'M61', 'S1', 'S2', 'S3', 'S4', 'S5'

45

Start Χ1

number

1

A Python integer or floating-point value

46

Start Χ2

number

1

A Python integer or floating-point value

47

Start Χ3

number

1

A Python integer or floating-point value

48

Start Χ4

number

1

A Python integer or floating-point value

49

Start Χ5

number

1

A Python integer or floating-point value

50

Start M61

number

1

A Python integer or floating-point value

51

Start M37

number

1

A Python integer or floating-point value

52

Start Ψ1

number

1

A Python integer or floating-point value

53

Start Ψ2

number

1

A Python integer or floating-point value

54

Start Ψ3

number

1

A Python integer or floating-point value

55

Start Ψ4

number

1

A Python integer or floating-point value

56

Start Ψ5

number

1

A Python integer or floating-point value

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 = ['', 'KH Pattern', '', '', '', 'None', 'Select Program', '', '', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', False, '', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', False, '', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', False, '', False, '', False, False, False, False, False, 'SWITCHES', False, False, 'SWITCHES', '', 0, '', '', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
result = bake(input_value, [{"op": 'Colossus', "args": args}])
print(result)

Pipeline example

from pychef import Pipeline

args = ['', 'KH Pattern', '', '', '', 'None', 'Select Program', '', '', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', False, '', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', False, '', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', False, '', False, '', False, False, False, False, False, 'SWITCHES', False, False, 'SWITCHES', '', 0, '', '', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
transform = Pipeline().then('Colossus', *args)
result = transform("example")

Dedicated operation module

The registered entry point lives in pychef.operations.by_operation.colossus. Direct calls receive the input value and a positional argument tuple:

from pychef.operations.by_operation.colossus import run

result = run("example", tuple(['', 'KH Pattern', '', '', '', 'None', 'Select Program', '', '', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', False, '', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', False, '', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', 'SWITCHES', False, '', False, '', False, False, False, False, False, 'SWITCHES', False, False, 'SWITCHES', '', 0, '', '', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]))
pychef.operations.by_operation.colossus.run(value, args)

Run this operation using its shared internal implementation.

Parameters:
  • value (str | bytes)

  • args (Sequence[Any])

Return type:

str | bytes