I'll just note that building an enigma simulator and/or code cracker is a common course project and there are several tutorials on doing so.