Python Forum
Enigma Machine, I need help!
Thread Rating:
  • 3 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enigma Machine, I need help!
#61
I just got some new documentation that I sent for (includes taking an Enigma apart, and
explaining how each piece works) and much more. As soon as I finishing reading the applicable
sections, I'll pick this up again.
Reply
#62
Start on this again tomorrow
Reply
#63
(Dec-18-2017, 05:53 AM)Larz60+ Wrote: Start on this again tomorrow

Many thanks!
Reply
#64
Ok, I watched a video that came with the cd that I bought (from arrl.org, titled The Story of Enigma, History, Technology & Deciphering)
Once again, I am confident that I know how it works, but this time I see where I went wrong before, so I feel (as i said) confident, and will
feel so until ... perhaps I no longer am again!
Reply
#65
The github account is currently empty. I will create a push in the next few days.
Meanwhile, I have been reading the material I received from an ARRL.org purchase,
and have been in contact with a collector who has several original enigma's.
I wanted to post tonight, because I have found the most excellent simulator. This must have taken
a very long time and a lot of effort to create.
When I say excellent, I mean just that. See for yourself and download from: http://users.telenet.be/d.rijmenants/en/enigmasim.htm
More soon
Reply
#66
(Dec-23-2017, 02:22 AM)Larz60+ Wrote: When I say excellent, I mean just that.

You are absolutely correct. I haven't downloaded the file (yet), but I did glance through the user manual. If the same level of thought and attention to detail is as present in the software as it is in the manual, you're right, it must have taken the author a mighty effort.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#67
After all this time, this is kind of a cop out, but one with a solution.
I certainly did learn a lot about the enigma machine during the process.

As it turns out, there was already an enigma cipher/decipher algorithm available.
So here's a synopsis on how to use it:
  • Install package pycipher with
    pip install git+git://github.com/jameslyons/pycipher
  • Set up and use as in sample below (which contains an alpha to num and num to alpha functions for
       help in conversion of ringstellung and window settings.

This returns the proper code 'GVYWHF' for 'ENIGMA'
when

window = 'Q', 'u', 'O' (left to rih=ght)
rotors =  V, III, and I (left to right)
plugboard = M <--> Z and N <--> S
Rings set to 12, 4, 8 ('L', 'D', 'H')
Reflector = 'B'


import pycipher
import string


def num_to_letter(nums):
   """
   Convert number of alphabet to characters
   :param nums: list of numbers, 1 based
   :return: list of letters
   """
   alpha = string.ascii_uppercase
   alst = []
   for num in nums:
       alst.append(alpha[num - 1])
   return alst

def letter_to_num(letters):
   """
   Convert letters of alphabet to numbers
   :param letters: list of letters
   :return: list of numbers, 1 based
   """
   alpha = string.ascii_uppercase
   nlst = [ ]
   for letter in letters:
       nlst.append(alpha.index(letter) + 1)
   return nlst

if __name__ == '__main__':
   se = pycip = pycipher.Enigma(settings=('Q', 'U', 'O'),
                           rotors=(5, 3, 1),
                           reflector='B',
                           ringstellung=('L', 'D', 'H'),
                           steckers=[('M', 'Z'), ('N', 'S')])

   print(se.encipher('ENIGMA'))
   se.reset_settings()
   print(se.encipher('GVYWHF'))
Results:
Output:
GVYWHF ENIGMA
Reply
#68
Doesn't look like he has a real cool gui though.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#69
That's true.
But it's code that can be imported as a base.
As I stated earlier, twenty years ago, I would have solved this while sleeping,
But my attention span is a lot shorter now, and I don't like to admit it, but I was trying to
recreate the wheel.

Perhaps Kimkuq can use the plugboard code format (not necessarily the graphics), to do the graphics
portion. After looking at the great presentation of http://users.telenet.be/d.rijmenants/en/enigmasim.htm,
there's not much room for improvement.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Numeric Enigma Machine idev 8 258 Yesterday, 02:17 PM
Last Post: idev
  Enigma Decoding Problem krisarmstrong 4 634 Dec-14-2023, 10:42 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020