Skip to main content

Symmetric cryptography module

Project description

ListCrypt

Symmetric cryptographic algorithm built in python3.8



Example Use

>>> from listcrypt import encrypt,decrypt
>>>
>>> key = "example key"
>>> data = "testing 1.. 2.. 3.." 
>>>
>>> e = encrypt(key, data)
>>> print(e)
b'AV#\x18t*\x12\x1c@\x01\x1b%U4k>M*w z\x7f\x17]afh\x07 \x04'
>>>
>>> d = decrypt(key, e)
>>> print(d)
testing 1.. 2.. 3..

Easily Encrypt and Decrypt Files with the 'encrypt_file' and 'decrypt_file' Functions

>>> from listcrypt import encrypt_file, decrypt_file
>>>
>>> file_name = "file.txt"
>>> key = "example key"
>>>
>>> encrypt_file(key, path)
True
>>> decrypt_file(key, path)
True

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(key:str, 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

    remove_image_exif(path:str) -> bool
        Removes the metadata from the provided image, which may cause
        unwanted effects like image rotating, but will reduce the file size greatly

    encrypt_file(key:str, path:str, metadata_removal=True) -> bool
        This function enables the easy encryption of files


    decrypt_file(key:str, path:str) -> bool
        This function enables the easy 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.2.4.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

listcrypt-0.2.4-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for listcrypt-0.2.4.tar.gz
Algorithm Hash digest
SHA256 3a6e960fbb6a3b385ad95893275d6cdb3b068d6a1b3621a104aa7f132fec0eff
MD5 9cec6bab640fedef51b602cfe476453e
BLAKE2b-256 2ac88faba2bf64334a874abfe6ddd28a15650eb807727cf7230fa85aaa1a8e9a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for listcrypt-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e107c5a1a19b696fbbeff169f7df521f7024dac90d6ae3a4dc692ee1ac7b820e
MD5 097f96714dd5d4f0de952960f84f11c8
BLAKE2b-256 a973998b785e2b95f3159e0e33f54d14bf3838133f6a27b92a592e42660d3070

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