Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justscott/listcrypt
Symmetric cryptographic algorithm built with python3
https://github.com/justscott/listcrypt
cryptography encryption python38 symmetric-cryptography symmetric-key-cryptography
Last synced: 9 days ago
JSON representation
Symmetric cryptographic algorithm built with python3
- Host: GitHub
- URL: https://github.com/justscott/listcrypt
- Owner: JustScott
- License: mit
- Created: 2022-03-24T00:18:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-03T21:07:03.000Z (almost 2 years ago)
- Last Synced: 2024-11-02T06:48:31.673Z (15 days ago)
- Topics: cryptography, encryption, python38, symmetric-cryptography, symmetric-key-cryptography
- Language: Python
- Homepage: https://pypi.org/project/listcrypt/
- Size: 66.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#
ListCrypt
Symmetric cryptographic algorithm built in python3.8
( ListCrypt is NOT intended for production use )
# Example Use
```python
>>> 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
```python
>>> 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
```python
'''
Functions:
sha256(data: str) -> str:
Simple hashing function, utilizes the builtin hashlib moduledata_verification(key:str, data:str) -> bool:
Verifies that your data will be encrypted and decrypted without errorconvert_data(key:str, data:'any data type') -> str and str:
Converts the data to a string format for encryptionconvert_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 datacreate_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 datasegment_data(data:str, segments:int) -> list
Splits the data evenly amongst the amount of 'segments' requiredpull_metadata(key:str, data:bytes) -> dict
Pulls metadata from the encrypted bytes and puts it in a dictionary for easy readibilityencrypt(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 encryptiondecrypt(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 decryptionremove_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 greatlyencrypt_file(key:str, path:str, metadata_removal=True) -> bool
This function enables the easy encryption of filesdecrypt_file(key:str, path:str) -> bool
This function enables the easy decryption of files
'''
```