-
-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created a simulation of the Enigma encryption as a historical crypto module. #38292
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing this! I'm not familiar enough with Enigma to check for correctness but it looks like you've done a good job including lots of tests. This was just a first pass at review, I probably missed a few things.
Make sure the tests pass and review the Sage developer guide, in particular:
# **************************************************************************** | ||
|
||
|
||
class Rotor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sage classes should inherit from SageObject
: https://doc.sagemath.org/html/en/developer/coding_in_python.html
) | ||
|
||
|
||
class Reflector: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inherit from SageObject
ValueError: Reflector must be a value between 1 and 3 | ||
""" | ||
|
||
wheels = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it fit on one line? Not a big deal though. We use a maximum line length of 80 characters.
# plugboard and reflector are static permutations anyway | ||
return Enigma(new_rotors, self._reflector, self._plugboard) | ||
|
||
def __repr__(self) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Classes inheriting from SageObject
should define _repr_
instead of __repr__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Classes should also define _latex_
As part of a study project from our University HAW Landshut we created a simulation of the Enigma machine used in World War II by the German Army.
This module includes the possibility to create all used Enigma machines and took it one step further, so you can create your own version.
Our goal was to give fellow students the possibility to play around with historical cryptography that was considered safe (at least from one side) unbreakable.
📝 Checklist
⌛ Dependencies