Skip to content

mikaoj/EnigmaKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EnigmaKit

CI Status Version License Platform Alt text

Usage

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.

Plugboard

// Create a plugboard and add a patch between A and D
let plugboard = Plugboard()
plugboard.addPatch(("A", "D"))

Rotor

// III rotor
let rotor = Rotor.III
rotor.setting = 5 // Internal ring position
rotor.position = 6 // Outer ring position

Reflector

let rotor = Reflector.B

Enigma

// 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)

Requirements

Don't mention the war

Installation

EnigmaKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "EnigmaKit"

Author

Joakim Gyllström, joakim@backslashed.se

License

EnigmaKit is available under the MIT license. See the LICENSE file for more info.

About

Enigma encryption in Swift

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published