Skip to content

Instantly share code, notes, and snippets.

@KentaKudo
Created July 19, 2017 20:02
Show Gist options
  • Save KentaKudo/4e0950b62bc3a1d22a8efae34c7eb8c2 to your computer and use it in GitHub Desktop.
Save KentaKudo/4e0950b62bc3a1d22a8efae34c7eb8c2 to your computer and use it in GitHub Desktop.
var enigma = Enigma(rotor0: swissK[0], rotor1: swissK[1], rotor2: swissK[2], plugboard: plugboard, key: (.A, .A, .A))
let message = "HELLOWORLD"
let message2 = "AAAAAAAAAA"
let ciphered = enigma.cipher(message)
let ciphered2 = enigma.cipher(message2)
var _enigma = Enigma(rotor0: swissK[0], rotor1: swissK[1], rotor2: swissK[2], plugboard: plugboard, key: (.A, .A, .A))
let deciphered = _enigma.cipher(ciphered)
let deciphered2 = _enigma.cipher(ciphered2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment