Home
Softono

EnigmaKit

Open source MIT Swift
119
Stars
11
Forks
0
Issues
5
Watchers
7 years
Last Commit

 About EnigmaKit

Enigma encryption in Swift

Platforms

Web Self-hosted macOS iOS

Languages

Swift

Links

Need Help Installing EnigmaKit?

We provide expert installation service for this software. Our team will install, configure, and secure EnigmaKit on your server. plans start at just $30.

๐•ฐ๐–“๐–Ž๐–Œ๐–’๐–†๐•ถ๐–Ž๐–™

CI Status Version License Platform Alt text

๐–€๐–˜๐–†๐–Œ๐–Š

// Will create an Enigma with an empty plugboard, rotors I, II, III and reflector B (wide).
let enigma = Enigma()
// Will output "ILBDA AMTAZ"
let result = enigma.encode("HELLO WORLD")
let enigma = Enigma()
// "HELLO WORLD"
let result = enigma.encode("ILBDA AMTAZ")

๐•ฎ๐–”๐–’๐–•๐–”๐–“๐–Š๐–“๐–™๐–˜

๐•ป๐–‘๐–š๐–Œ๐–‡๐–”๐–†๐–—๐–‰

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

๐•ฝ๐–”๐–™๐–”๐–—

// III rotor. EnigmaKit comes prebuilt with rotors I-VIII
let rotor = Rotor.III
rotor.setting = 5 // Ringstellung
rotor.position = 6 // Grundstellung

// Or initialize your own
let rotor = Rotor(name: "My custom rotor", wiring: "VZBRGITYUPSDNHLXAWMJQOFECK", notch: "QV")

๐•ฝ๐–Š๐–‹๐–‘๐–Š๐–ˆ๐–™๐–”๐–—

// EnigmaKit comes with reflectors A-C (wide) and B-C (thin)
let reflector = Reflector.B

// Or you can create your own reflector
let reflector = Reflector(name: "My custom reflector", wiring: "VZBRGITYUPSDNHLXAWMJQOFECK")

๐•ฐ๐–“๐–Ž๐–Œ๐–’๐–†

// Create an enigma with your own plugboard, rotors and reflector of choice
let enigma = Enigma(reflector: Reflector.C, rotors: [Rotor.III, Rotor.IV, Rotor.II], plugboard: Plugboard())

๐•ฝ๐–Š๐––๐–š๐–Ž๐–—๐–Š๐–’๐–Š๐–“๐–™๐–˜

Don't mention the war

๐•ด๐–“๐–˜๐–™๐–†๐–‘๐–‘๐–†๐–™๐–Ž๐–”๐–“

EnigmaKit is available through Swift Package Manager, CocoaPods.

๐•ฌ๐–š๐–™๐–๐–”๐–—

Joakim Gyllstrรถm, [email protected]

๐•ท๐–Ž๐–ˆ๐–Š๐–“๐–˜๐–Š

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