Skip to main content

This is a simple script for encrypting and decryption file by chunk using cryptography package, decryption includes download from url. Project repository url is not yet available, mostly because of its inactive development status.

Encrypting files:

from chunkcrypt.cryptchunk import encrypt_file
# encrypt_file(key, file, output_file, chunk_size)

# encrypting without a provided key
encrypt_file(None, '/home/user/myfile.txt', '/home/user/encryfile.txt')
# "myfile.txt" is now encrypted and the encrypted file is located at "/home/user/encrytfile.txt"

# encrypting with a provided key
encrypt_file('CemuWNzkXti7OVAmFV0SIpZAxkF2wybK', '/home/user/myfile.txt', '/home/user/encrytfile.txt')

# specifying a chunksize, default is 1024
encrypt_file(None, '/home/user/myfile.txt', '/home/user/encryfile.txt', 2048)
# the length of bytes of a encrypted chunk is also written on the encrypted file on a 4 element array of bytes format
# this is needed since Fernet returns additional bytes whenever it encrypted data

Decrypting files:

from chunkcrypt.cryptchunk import decrypt_file, downl_decrypt
# decrypt_file(key, encrypted_file, output_file)
# downl_decrypt(url, output_file, key, silent=True,  pre='', suff='', msg_v='')
# decryption can also be done on file encrypted using encrypt_file()

# decrypting a file
decrypt_file('CemuWNzkXti7OVAmFV0SIpZAxkF2wybK', '/home/user/encrytfile.txt', '/home/user/decryptfile.txt')

# decrypting from url, only works on direct download link or hotlink
downl_decrypt('https://sampledownl.com/download/encryptedfile.txt', '/home/user/decryptfile.txt', 'CemuWNzkXti7OVAmFV0SIpZAxkF2wybK')

# decrypting from url, with message
downl_decrypt(
    'https://sampledownl.com/download/encryptedfile.txt', 
    '/home/user/decryptfile.txt', 
    'CemuWNzkXti7OVAmFV0SIpZAxkF2wybK',
    False,
    ' * ',
    ' - Test',
    'MyFile'
)
# Output:
#  * Attempting to Download MyFile - Test
#  * Finished Downloading MyFile - Test
#  * Attempting to Decrypt Downloaded MyFile. Please wait, this might take a while depending on the size of file - Test
#  * Finished decrypting MyFile - Test

Metadata

Release files for chunkcrypt 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 chunkcrypt 0.0.3
File Size Uploaded
chunkcrypt-0.0.3.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chunkcrypt 0.0.3
File Interpreter ABI Platform
chunkcrypt-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / chunkcrypt-0.0.3.tar.gz

Download URL chunkcrypt-0.0.3.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a8d942c3fa324cb68ff561a0cc8512e37499b0c79dd4f9888977547e79b105a7
BLAKE2b-256 checksum
How to use checksums
71206abf32362875097a8e5ff71c20015c959fab20b31383266ee1aa36190c39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / chunkcrypt-0.0.3-py3-none-any.whl

Download URL chunkcrypt-0.0.3-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22c8cd8617d762aa78dd1947db5fdacd2240905072c21caadd7f742bf56951ee
BLAKE2b-256 checksum
How to use checksums
1747e4929c813e3d8ddad97679030f04397597da0032f94fd2c3192eff7a1740
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

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