https://github.com/denismaggior8/micropython-enigma-python
The Enigma Python wrapper package for Micropython environment
https://github.com/denismaggior8/micropython-enigma-python
Last synced: 19 days ago
JSON representation
The Enigma Python wrapper package for Micropython environment
- Host: GitHub
- URL: https://github.com/denismaggior8/micropython-enigma-python
- Owner: denismaggior8
- Created: 2025-02-03T07:42:59.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2025-02-05T11:37:57.000Z (2 months ago)
- Last Synced: 2025-02-05T12:30:38.284Z (2 months ago)
- Language: Python
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-micropython - enigmapython - A simple yet faithful library to emulate different Enigma machines models using MicroPython. (Libraries / Cryptography)
- trackawesomelist - enigmapython (β1) - A simple yet faithful library to emulate different Enigma machines models using MicroPython. (Recently Updated / [Mar 25, 2025](/content/2025/03/25/README.md))
README
# The [enigmapython](https://github.com/denismaggior8/enigma-python) wrapper package for MicroPython environment
I'm thrilled to announce that [enigmapython](https://github.com/denismaggior8/enigma-python), my powerful Enigma machine emulator, is now available on [MicroPython](https://micropython.org)! π
πΉ Why is this exciting?
[enigmapython](https://github.com/denismaggior8/enigma-python) isnβt just a package... itβs a historically accurate and educational tool that allows students, researchers, and history enthusiasts to explore WWII cryptography hands-on.
Now, with MicroPython support, you can run it on embedded devices like ESP32, Raspberry Pi Pico, and other microcontrollers!
πΉ How This Helps Education & Research
β Cryptography Lessons β Learn how encryption shaped history by experimenting with real Enigma machine settings on resource-constrained devices.
β Historical Research β Recreate encoded wartime messages and decrypt them just like WWII codebreakers.
β STEM & Embedded Systems β Run an Enigma emulator on a microcontroller, making learning cryptography more interactive than ever!
## Installation
Using mip (on network enabled devices):
```python
import mip
mip.install("github:denismaggior8/micropython-enigma-python", version="1.2.3")
```## Releases
This repo mirrors the **enigmapython** releases on PyPi, meaning that by installing **micropython-enigma-python** version 1.2.3 (as in the example above) you get the **enigmapython** 1.2.3 PyPi equivalent.
## Examples
This is a very simple MicroPython snippet that shows how to use the library (once installed in the system)
```python
# Import enigmapython modules
from enigmapython.EnigmaB_A133RotorI import EnigmaB_A133RotorI
from enigmapython.EnigmaB_A133Etw import EnigmaB_A133Etw
from enigmapython.EnigmaB_A133 import EnigmaB_A133
from enigmapython.ReflectorUKW_EnigmaB_A133 import ReflectorUKW_EnigmaB_A133# Setup Enigma machine components
rotor1 = EnigmaB_A133RotorI(ring=0,position=0)
rotor2 = EnigmaB_A133RotorI(ring=0,position=0)
rotor3 = EnigmaB_A133RotorI(ring=0,position=0)
reflector = ReflectorUKW_EnigmaB_A133()
etw = EnigmaB_A133Etw()# Setup Enigma B machine
enigma = EnigmaB_A133(rotor3, rotor2, rotor1, reflector, etw, True)# Let's encrypt a string
print(enigma.input_string("denis"))
```To get more examples you can inspect this repo's [examples](./examples) folder or the original **enigmapython** examples [here](https://github.com/denismaggior8/enigma-python/tree/master/examples).
## Tested hardware
| Machine | enigmapython version | MP version | HW architecture |
|---|---|---|---|
| ESP32 Wroom 32 | 1.2.3 | 1.24.1 | Xtensa 32-bit LX6 |
| macOS Sequoia 15.3 | 1.2.3 | 1.24.1 | Apple Silicon (M2 Max) |
| | | | |If you run **enigmapython** on hardware not yet listed here, drop me an email at denis.maggiorotto[at]gmail.com or open a PR.
>**Be aware:**
>**ESP8266**-like boards are currently UNSUPPORTED due to their low memory## Support
Found it useful/funny/educational? Please consider to [](https://www.buymeacoffee.com/denismaggior8)