https://github.com/lusingander/enigma
Terminal Enigma machine simulator ⚙️
https://github.com/lusingander/enigma
bubbletea enigma enigma-machine enigma-simulator go tui
Last synced: 7 months ago
JSON representation
Terminal Enigma machine simulator ⚙️
- Host: GitHub
- URL: https://github.com/lusingander/enigma
- Owner: lusingander
- License: mit
- Created: 2022-07-20T12:29:35.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-10-03T14:00:46.000Z (over 2 years ago)
- Last Synced: 2025-07-11T17:03:11.500Z (7 months ago)
- Topics: bubbletea, enigma, enigma-machine, enigma-simulator, go, tui
- Language: Go
- Homepage:
- Size: 346 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pkg.go.dev/github.com/lusingander/enigma)

# Enigma
Terminal [Enigma machine](https://en.wikipedia.org/wiki/Enigma_machine) simulator

## Installation
`$ go install github.com/lusingander/enigma/cmd/enigma-simulator@latest`
(require Go 1.18+)
## Usage
### Keybindings
|Key|Description|
|-|-|
|A - Z|input|
|Ctrl+c|quit|
|Esc|reset|
### Using as a library
```go
import "github.com/lusingander/enigma/enigma"
func main() {
e := enigma.NewM3(
[3]enigma.Rotor{
enigma.NewRotor1('A', 'A'), // (initial position, ring setting)
enigma.NewRotor2('A', 'A'),
enigma.NewRotor3('A', 'A'),
},
enigma.NewReflectorB(),
enigma.NewPlugboard(),
)
e.EncodeString("HELLO") // returns "MFNCZ"
e.EncodeString("HELLO") // returns "RHOZF"
}
```
## License
MIT