Skip to content
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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

tobikenobix
Copy link

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

  • [X ] The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Copy link
Contributor

@vincentmacri vincentmacri left a 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:
Copy link
Contributor

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:
Copy link
Contributor

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 = [
Copy link
Contributor

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:
Copy link
Contributor

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__

Copy link
Contributor

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_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants