Enigma: Initialize an M3 Enigma machine

Description Usage Arguments Examples

View source: R/enigma.R

Description

Available rotors: I-VIII and reflectors B and C.

Usage

1
2
3
Enigma(rotors = c("III", "II", "I"), start_positions = c("A", "A",
  "A"), ring_settings = c("A", "A", "A"), reflector = "B",
  plugboard = c())

Arguments

rotors

Rotors used, from left to right. (I - VIII)

start_positions

Start positions (e.g. c("A", "A", "A")).

ring_settings

Ring settings (e.g. c("D", "E", "F")).

reflector

Which reflector is used ("B" or "C").

plugboard

Plugboard settings. Should be a named list.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Initialize an enigma machine
enigma <- Enigma(rotors = c("II", "I", "III"), 
                 start_positions = c("D", "E", "F"),
                 ring_settings = c("F", "A", "R"),
                 reflector = "B",
                 plugboard = c(
                     A = "D",
                     C = "Y",
                     F = "Q",
                     G = "R",
                     I = "L",
                     W = "M",
                     Z = "U"
                   )
                )
# Encrypt a few words:
encrypt(enigma, "helloworld")               

pjhop/EnigmulatoR documentation built on Nov. 5, 2019, 12:52 a.m.