Skip to main content

# Enigma-Machine-Libary

This library provides functions for simulating the Enigma Machine, a historical encryption device used during World War II. The library was created as part of an assessment for INSPER college in São Paulo, Brazil.

Functions The library includes the following functions:

The following functions are part of an encryption/decryption system based on an enigma machine.


to_one_hot

Converts a string of letters into a matrix representation using one-hot encoding.

Args: message: str containing the letters to be encoded.

Returns: np.ndarray: matrix with one-hot encoding of the input message.


to_string

Converts a matrix of one-hot encoded characters into a string of letters.

Args: matrix: np.ndarray containing the one-hot encoded characters.

Returns: str: string of letters corresponding to the input matrix.


encrypt Encrypts a message using a permutation matrix.

Args: message: str containing the message to be encrypted. permutation_matrix: np.ndarray representing the permutation matrix to be used for encryption.

Returns: str: encrypted message


decrypt

Decrypts an encrypted message using a permutation matrix.

Args: encrypted_message: str containing the message to be decrypted. permutation_matrix: np.ndarray representing the permutation matrix to be used for decryption.

Returns: str: decrypted message.


enigma_machine

Encrypts a message using a permutation matrix and an auxiliary matrix.

Args: message: str containing the message to be encrypted. permutation_matrix: np.ndarray representing the permutation matrix to be used for encryption. auxiliary_matrix: np.ndarray representing the auxiliary matrix to be used for encryption.

Returns: str: encrypted message.


enigma_machine_decrypt

Decrypts an encrypted message using a permutation matrix and an auxiliary matrix.

Args: encrypted_message: str containing the message to be decrypted. permutation_matrix: np.ndarray representing the permutation matrix to be used for decryption. auxiliary_matrix: np.ndarray representing the auxiliary matrix to be used for decryption.

Returns: str: decrypted message.

Change Log

0.0.2 (07/03/2023)

  • First Release

Metadata

Release files for enigmamachine 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for enigmamachine 0.0.3
File Size Uploaded Provenance Actions
enigmamachine-0.0.3.tar.gz 3.4 kB Without provenance Details for enigmamachine-0.0.3.tar.gz

Release files / enigmamachine-0.0.3.tar.gz

Download URL enigmamachine-0.0.3.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2f99a22058b4edfe0d703bf1ebf9e57c6b9a3819b0982aefebae6ac3c0fa6e9c
BLAKE2b-256 checksum
How to use checksums
eeff0d9a7ee1e4b1f8819d38aa59b3cac9763ae1e440080b69145dc408a3995d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.10

Security for enigmamachine 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page