let enigma = Enigma() // Will create an Enigma with an empty plugboard, rotors I, II, III and reflector B (wide).
let result = enigma.encode("Hello world")
To run the example project, clone the repo, and run pod install
from the Example directory first.
// Create a plugboard and add a patch between A and D
let plugboard = Plugboard()
plugboard.addPatch(("A", "D"))
// III rotor
let rotor = Rotor.III
rotor.setting = 5 // Internal ring position
rotor.position = 6 // Outer ring position
let rotor = Reflector.B
// Create an enigma with your own plugboard, rotors and reflector of choice
let enigma = Enigma(plugboard: Plugboard(), rotors: [Rotor.III, Rotor.IV, Rotor.II], reflector: Reflector.C)
Don't mention the war
EnigmaKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "EnigmaKit"
Joakim Gyllström, joakim@backslashed.se
EnigmaKit is available under the MIT license. See the LICENSE file for more info.