Simplifying encryption
Project description
Overview
So I made this library for personal use to secure some files. It provides support for both fast and highly computationally intensive encryption. Also, it includes a database integration system which facilitates the restoration of files to their original state if necessary, and a graphical user interface (GUI) is also included to obviate the need to write code.
Installation
pip install litecrypt
Usage
from litecrypt import CryptFile, gen_key
key = gen_key()
CryptFile('file_of_any.type', key).encrypt()
# the file is now called ==> 'file_of_any.type.crypt
The encryption process is blazingly fast by default, to make it computationally intensive
Do this
from litecrypt import CryptFile, gen_key
key = gen_key()
CryptFile('anyfile.txt',
key=key,
intensive_compute=True,
iteration_rounds=10000
).encrypt()
Running
intensive_compute
with noiteration_rounds
sets the rounds to 50 (minimum) by default
To decrypt simply run:
from litecrypt import CryptFile
key = 'THE_KEY_YOU_USED'
CryptFile('anyfile.txt.crypt',key=key).decrypt()
For messages:
from litecrypt import Crypt, gen_key
key = gen_key()
encrypted = Crypt('any message', key).encrypt() # can also be a bytes message
print(encrypted) # Check the return value
Details
Algorithm: AES-256 CBC
Layout:
+-------------+ +--------+ +------------+ +-------------+ +-------------+ +------------------+
| HMAC | →| IV | →| Salt | →| Pepper | →| Iterations | →| KDF ID | →
+-------------+ +--------+ +------------+ +-------------+ +-------------+ +------------------+
+------------------+
| Ciphertext ...
+------------------+
AES and HMAC keys, each 32 bytes, are derived from the main key (gen_key()
) using the chosen KDF with SHA256. Iterations range from 50 to 100,000 the higher they go the more time it takes to compute, that's 4 bytes. IV that's 16, Salt, and Pepper are also 16 byte random values, both mixed with the KDF. The ciphertext size varies, with the crypto process employing PKCS7 padding.
Supported Databases
Currently, supports MySQL, PostgresSQL and SQLite.
Check the docs for more info.
GUI
Here's how it works
https://github.com/AshGw/litecrypt/assets/126174609/190b6ab8-3f8a-4656-9525-dbaf5e56db5e
License
Litecrypt is open-source project & licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file litecrypt-0.2.6.tar.gz
.
File metadata
- Download URL: litecrypt-0.2.6.tar.gz
- Upload date:
- Size: 26.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.2.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6542b0e1b6f3e12855ab00aa25476151f2c468d393b28762113ec877fc43481 |
|
MD5 | abe84fb607c0131eb454e98d6ee85cdb |
|
BLAKE2b-256 | fe872ae1920b26635f64cf8170d6f7129283b1dae748613d49c7b47a3ae9d28a |
File details
Details for the file litecrypt-0.2.6-py3-none-any.whl
.
File metadata
- Download URL: litecrypt-0.2.6-py3-none-any.whl
- Upload date:
- Size: 32.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.2.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8b871d7662c967f013d45918312b0e92470bf7afb01157e40af3efb264c252a |
|
MD5 | f61897683b27e7822b5019cf75b7fed4 |
|
BLAKE2b-256 | b4463bddba0fdef215489d10c1b1ead16bf904fea9ea5a59e3f13bdf59fe31d4 |