enigmamachine


Nameenigmamachine JSON
Version 0.0.3 PyPI version JSON
download
home_page
SummaryA basic cryptography libary, simulating the Enigma Machine
upload_time2023-03-13 02:27:42
maintainer
docs_urlNone
authorTomas Rodrigues Alessi
requires_python
licenseMIT
keywords cryptography
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "enigmamachine",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "cryptography",
    "author": "Tomas Rodrigues Alessi",
    "author_email": "tomasalessi@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ee/ff/0d9a7ee1e4b1f8819d38aa59b3cac9763ae1e440080b69145dc408a3995d/enigmamachine-0.0.3.tar.gz",
    "platform": null,
    "description": "# Enigma-Machine-Libary\n\nThis 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\u00e3o Paulo, Brazil.\n\nFunctions\nThe library includes the following functions:\n\nThe following functions are part of an encryption/decryption system based on an enigma machine.\n\n----------------------------------------------------------------\n\n`to_one_hot`\n\nConverts a string of letters into a matrix representation using one-hot encoding.\n\nArgs:\nmessage: str containing the letters to be encoded.\n\nReturns:\nnp.ndarray: matrix with one-hot encoding of the input message.\n\n----------------------------------------------------------------\n\n`to_string`\n\nConverts a matrix of one-hot encoded characters into a string of letters.\n\nArgs:\nmatrix: np.ndarray containing the one-hot encoded characters.\n\nReturns:\nstr: string of letters corresponding to the input matrix.\n\n\n----------------------------------------------------------------\n\n`encrypt`\nEncrypts a message using a permutation matrix.\n\nArgs:\nmessage: str containing the message to be encrypted.\npermutation_matrix: np.ndarray representing the permutation matrix to be used for encryption.\n\nReturns:\nstr: encrypted message\n\n----------------------------------------------------------------\n\n`decrypt`\n\nDecrypts an encrypted message using a permutation matrix.\n\nArgs:\nencrypted_message: str containing the message to be decrypted.\npermutation_matrix: np.ndarray representing the permutation matrix to be used for decryption.\n\nReturns:\nstr: decrypted message.\n\n----------------------------------------------------------------\n\n`enigma_machine`\n\nEncrypts a message using a permutation matrix and an auxiliary matrix.\n\nArgs:\nmessage: str containing the message to be encrypted.\npermutation_matrix: np.ndarray representing the permutation matrix to be used for encryption.\nauxiliary_matrix: np.ndarray representing the auxiliary matrix to be used for encryption.\n\nReturns:\nstr: encrypted message.\n\n----------------------------------------------------------------\n\n`enigma_machine_decrypt`\n\nDecrypts an encrypted message using a permutation matrix and an auxiliary matrix.\n\nArgs:\nencrypted_message: str containing the message to be decrypted.\npermutation_matrix: np.ndarray representing the permutation matrix to be used for decryption.\nauxiliary_matrix: np.ndarray representing the auxiliary matrix to be used for decryption.\n\nReturns:\nstr: decrypted message.\n\n\nChange Log\n==========\n\n0.0.2 (07/03/2023)\n------------------\n- First Release\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A basic cryptography libary, simulating the Enigma Machine",
    "version": "0.0.3",
    "split_keywords": [
        "cryptography"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eeff0d9a7ee1e4b1f8819d38aa59b3cac9763ae1e440080b69145dc408a3995d",
                "md5": "2a21eeb72ef76b7b14b1b92192817565",
                "sha256": "2f99a22058b4edfe0d703bf1ebf9e57c6b9a3819b0982aefebae6ac3c0fa6e9c"
            },
            "downloads": -1,
            "filename": "enigmamachine-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "2a21eeb72ef76b7b14b1b92192817565",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3376,
            "upload_time": "2023-03-13T02:27:42",
            "upload_time_iso_8601": "2023-03-13T02:27:42.643460Z",
            "url": "https://files.pythonhosted.org/packages/ee/ff/0d9a7ee1e4b1f8819d38aa59b3cac9763ae1e440080b69145dc408a3995d/enigmamachine-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-13 02:27:42",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "enigmamachine"
}
        
Elapsed time: 0.15577s