encrypt_message
Encrypt or decrypt a message using a historically accurate Enigma machine emulator with configurable rotors, reflector, and plugboard settings. Specify the machine model and rotor order to match historical operation.
Instructions
Encrypt or decrypt a message using a specified Enigma machine configuration.
Args:
machine_model: Exact machine model name. MUST be one of: 'M3', 'M4', 'I', 'I_Norway', 'I_Sondermaschine', 'K', 'K_Swiss', 'D', 'Z', 'B_A133'. Do not add 'Enigma' prefix.
Supported models and their explicitly required reflectors:
- 'M3', 'I': UKWA, UKWB, UKWC
- 'M4': UKWBThin, UKWCThin
- 'I_Norway': UKW_EnigmaINorway
- 'I_Sondermaschine': UKW_EnigmaISonder
- 'K', 'K_Swiss', 'D': UKW_EnigmaCommercial
- 'Z': UKW_EnigmaZ
- 'B_A133': UKW_EnigmaB_A133
message: The plaintext or ciphertext to process.
- For Enigma Z: MUST contain ONLY digits (1234567890).
- For Enigma B_A133: MUST contain ONLY Swedish letters (abcdefghijklmnopqrstuvxyzåäö). Note: 'w' is strictly forbidden.
- For all other machines: MUST contain ONLY standard letters (A-Z).
- Spaces, punctuation, and special characters are strictly forbidden in all machines.
rotors: List of RotorConfig objects. MUST be ordered exactly as: [Fastest/Rightmost, Middle, Slowest/Leftmost, Greek (if M4)].
reflector: The ReflectorConfig object.
plugboard_pairs: Optional dict for plugboard connections (e.g. {"A": "B", "C": "D"}). Ignored if the machine has no plugboard.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| machine_model | Yes | ||
| message | Yes | ||
| rotors | Yes | ||
| reflector | Yes | ||
| plugboard_pairs | No |