Skip to main content

Symmetric cryptography module

Project description

ListCrypt

Symmetric cryptographic algorithm built entirely with python3



Example Use

from listcrypt import encrypt,decrypt

'''
    The key can be any data type
    example --> key = ['testing',123,{'name':'JustScott'}]
'''
key = "example key"

'''
    The data can also be any data type
    example --> data = (4,{435,123},5)
'''
data = "testing 1.. 2.. 3.." 

e = encrypt(key, data)

d = decrypt(key, e)

Easily Encrypt and Decrypt Files with the 'file_manager' Function

from listcrypt import file_manager

file_name = "file.txt"
key = "example key"
method = "encrypt"

#Creates a new encrypted bytes file named 'file' in your current directory, and deletes the old file
file_manager(key, file_name, method, encrypted_file_path="file")

method = "decrypt"

#Creates 'file.txt' and decrypts the data from 'file' into it
file_manager(key, file_name, method, encrypted_file_path="file")

Documentation

'''
Functions:
    sha256(data: str) -> str:
        Simple hashing function, utilizes the builtin hashlib module

    data_verification(key:str, data:str) -> bool:
        Verifies that your data will be encrypted and decrypted without error

    convert_data(key:str, data:'any data type') -> str and str:
        Converts the data to a string format for encryption

    convert_data_back(metadata: list) -> any
        Converts the data back to its origional type as given by the 'origional_data_type' parameter
        in the 'metadata' list.  This is built to work seamlessly with the 'convert_data' function.

    range_finder(data:str or bytes) -> int:
        Finds the character with the largest integer equivalent in your data

    create_key(key:str, data_length:int) -> bytes
        Uses the sha256 hash of the 'key' parameter to create and concatenate more keys (based upon the origional) to a new
        key variable that is either the same size as or slighty larger than the length of the data

    segment_data(data:str, segments:int) -> list
        Splits the data evenly amongst the amount of 'segments' required

    pull_metadata(data:bytes) -> dict
        Pulls metadata from the encrypted bytes and puts it in a dictionary for easy readibility

    encrypt(key:'any data type', data:'any data type', processes=cpu_count()) -> bytes
        Encrypts the data by adding each characters integer equivalent to the integer equivalent of the character in
        the same position in the new key variable generated by the 'key parameter'

        Nested Function:
            multiprocess_decryption(data:str, segment:int, shared_dictionary:dict) -> bool
                Takes chuncks of data and adds them to a shared dictionary,
                with the keys being the segments origional position for concatenation
                after encryption

    decrypt(key:"any data type", encrypted_data:bytes, processes=cpu_count()) -> "origional data"
        Encrypts the data by adding each characters integer equivalent to the integer equivalent of the character in
        the same position in the new key variable generated by the 'key parameter'

        Nested_Function:
            multiprocess_encryption(data:str, segment:int, shared_dictionary:dict) -> bool
                Takes chuncks of data and adds them to a shared dictionary,
                with the keys being the segments origional position for concatenation
                after decryption

    file_manager(key:str, path:str, method:str, encrypted_data=None, encrypted_file_path=None, metadata_removal=True, remove_old_file=True) -> bool or bytes
        Allows for easy encryption and decryption of files
'''

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

listcrypt-0.1.7.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

listcrypt-0.1.7-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file listcrypt-0.1.7.tar.gz.

File metadata

  • Download URL: listcrypt-0.1.7.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for listcrypt-0.1.7.tar.gz
Algorithm Hash digest
SHA256 9f8caa2e530a39fd22682cb13d6c82ae81d8221d670b146e5232babbcbf2bf94
MD5 1a05a1fb13c9f2dc3c8051ecd1afd219
BLAKE2b-256 a20c0b0b3a967196387890ca5970afa3695af8dce9ea4f5c7542d58a4440486a

See more details on using hashes here.

File details

Details for the file listcrypt-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: listcrypt-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for listcrypt-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 44ec0a0a82f07bd84746026ef999caf68fcb2cade8aabef7ea0d17b55dbdde47
MD5 d448a20d78e0c905d718b72a1b984ffb
BLAKE2b-256 c510ba6d8cfdf85e5bd5a9e05afada04c5e3439627d6fe9aa19315951214f3c3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page