Fast and portable cryptography library for Python, written in Rust.
Project description
TezCrypto
TezCrypto is a fast and portable cryptography library for Python, written in Rust. It is a migration of the original TgCrypto library.
Features
- AES-256-CBC
- AES-256-CTR
- AES-256-IGE
Installation
pip install tezcrypto
Usage
import tezcrypto
import os
key = os.urandom(32)
iv = os.urandom(32)
data = os.urandom(64)
# IGE Mode
encrypted = tezcrypto.ige256_encrypt(data, key, iv)
decrypted = tezcrypto.ige256_decrypt(encrypted, key, iv)
assert data == decrypted
# CTR Mode
iv_ctr = os.urandom(16)
state = bytes(1) # Initial state
encrypted_ctr = tezcrypto.ctr256_encrypt(data, key, iv_ctr, state)
decrypted_ctr = tezcrypto.ctr256_decrypt(encrypted_ctr, key, iv_ctr, state)
assert data == decrypted_ctr
# CBC Mode
iv_cbc = os.urandom(16)
encrypted_cbc = tezcrypto.cbc256_encrypt(data, key, iv_cbc)
decrypted_cbc = tezcrypto.cbc256_decrypt(encrypted_cbc, key, iv_cbc)
assert data == decrypted_cbc
Development
To build and install locally:
# Install maturin
pip install maturin
# Build and install
maturin develop --features python
Testing
# Run Rust tests
cargo test
# Run Python validation
python validate.py
License
LGPL-3.0
maturin develop
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 Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tezcrypto-0.1.0.tar.gz.
File metadata
- Download URL: tezcrypto-0.1.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1569361946f5858bd1affdf900d7dfc5308792040928b5025c660065a585d55
|
|
| MD5 |
49be9ef2e270da33c90ff818db8de959
|
|
| BLAKE2b-256 |
2435326cd262538af21cb8dbf517cdaa1692e1fad41fbd5baf890256a9c7f2e5
|
File details
Details for the file tezcrypto-0.1.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: tezcrypto-0.1.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 249.7 kB
- Tags: PyPy, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c0a6a18ecefcc916b5d1249f25343d4b5dba68caaf2ca90c441b153769f3f58
|
|
| MD5 |
aa4a0f0cf4e069d9d1d3913387e226a5
|
|
| BLAKE2b-256 |
83f046b83dd4f63b16089ba28642680cba347f64e3df54e26e571e5481fb87d9
|
File details
Details for the file tezcrypto-0.1.0-cp37-abi3-win_amd64.whl.
File metadata
- Download URL: tezcrypto-0.1.0-cp37-abi3-win_amd64.whl
- Upload date:
- Size: 112.0 kB
- Tags: CPython 3.7+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d55d37259d938e6399c6a49167c08bfb4a108e8d0ab274b2d6cf28dfbd001046
|
|
| MD5 |
d5fb6aca48e90b7ca3526c63965d83a7
|
|
| BLAKE2b-256 |
f6d5a376fd41c09245d0aa1bf6fec67697b497d2347dff8a34bb361a0c2466b7
|
File details
Details for the file tezcrypto-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: tezcrypto-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 250.7 kB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f88985e0040f975bd5ba9be521c54679cc854ce10a82d2d8c1b97d3ad1c580ef
|
|
| MD5 |
efad9955592525231e195a8d1099dc4e
|
|
| BLAKE2b-256 |
5bed81e375482b42e6329abebebd8479187e770d389a8d0a52d4e3417fe92e91
|
File details
Details for the file tezcrypto-0.1.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: tezcrypto-0.1.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 437.6 kB
- Tags: CPython 3.7+, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98abc4a9c91e33e2bc568076cb9c73831bdc59738502bca31636c6012c6d16ea
|
|
| MD5 |
9545929bd3e371856082f883a362acf1
|
|
| BLAKE2b-256 |
860cd15bfd9004628bf4dd0eb11b0a4ff024f3789a8a4d9fc405f8ac5a0ee72c
|