0.0
No commit activity in last 3 years
No release in over 3 years
Enigma machine simulator
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
~> 0.8.2
 Project Readme

EnigmaMachine

This is a simulator for an Enigma Machine. It currently simulates both the Enigma I/M3 and the Enigma M4. It also allows for specifying your own custom rotor/reflector configurations.

Installation

Add this line to your application's Gemfile:

gem 'enigma_machine'

And then execute:

$ bundle

Or install it yourself as:

$ gem install enigma_machine

Usage

e = EnigmaMachine.new(
  :reflector => :B,
  :rotors => [[:i, 10], [:ii, 14], [:iii, 21]],
  :plug_pairs => %w(AP BR CM FZ GJ IL NT OV QS WX)
)
e.set_rotors('V', 'Q', 'Q')

result = e.translate('HABHV HLYDF NADZY')

See integration_spec.rb for some more examples

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request