Skip to main content

High-Performance Cryptography Extension Library for Kurigram

Project description

TgrCrypto

Rust-powered, AES-NI accelerated drop-in replacement for TgCrypto

CI License Python

[!NOTE] The cryptographic algorithms implemented in this library — AES-256-IGE, AES-256-CTR, and AES-256-CBC — are provided for educational and experimental purposes. While the implementation follows NIST FIPS 197 specifications and has been validated against official test vectors, it has not undergone a formal third-party security audit. Use in production systems requiring certified cryptographic modules is at your own discretion.

Requirements

  • Python 3.9 - 3.14
  • Rust 1.83+ (build from source only)

Installation

[!TIP] uv is the recommended package manager for TgrCrypto. It provides significantly faster installs and reliable dependency resolution.

# Recommended
uv add TgrCrypto

# Alternative
uv pip install TgrCrypto

# pip
pip install TgrCrypto

Usage

import tgcrypto
import os

# IGE-256 (data must be a multiple of 16 bytes)
data = os.urandom(1024)
key = os.urandom(32)
iv = os.urandom(32)

enc = tgcrypto.ige256_encrypt(data, key, iv)
dec = tgcrypto.ige256_decrypt(enc, key, iv)

# CTR-256 (arbitrary length)
data = os.urandom(1024)
key = os.urandom(32)
iv = os.urandom(16)
state = bytes(1)

enc = tgcrypto.ctr256_encrypt(data, key, iv, state)
dec = tgcrypto.ctr256_decrypt(enc, key, iv, state)

# CBC-256 (data must be a multiple of 16 bytes)
data = os.urandom(1024)
key = os.urandom(32)
iv = os.urandom(16)

enc = tgcrypto.cbc256_encrypt(data, key, iv)
dec = tgcrypto.cbc256_decrypt(enc, key, iv)

Streaming API

For incremental processing of large data:

import tgcrypto
import os

key = os.urandom(32)
iv = os.urandom(16)
data = os.urandom(1024)

stream = tgcrypto.Ctr256(key, iv)
chunk1 = stream.update(data[:512])
chunk2 = stream.update(data[512:])

IGE also supports incremental block-aligned processing:

import tgcrypto
import os

key = os.urandom(32)
iv = os.urandom(32)
data = os.urandom(1024)

stream = tgcrypto.Ige256(key, iv)
chunk1 = stream.encrypt(data[:512])
chunk2 = stream.encrypt(data[512:])

Compatibility

TgrCrypto is a transparent drop-in replacement for TgCrypto:

import tgcrypto  # works with both TgCrypto and TgrCrypto

Function names, arguments, and return types are identical.

Contributing

# Run Rust tests
cargo test --release

# Run Python API tests on the default uv environment
uv sync --python 3.14
uv run python -m unittest discover -s tests -v

# Build a wheel through the configured PEP 517 backend
uv build --wheel

# Run with clippy
cargo clippy --all-targets --all-features -- -D warnings

License

LGPL-3.0-or-later — see COPYING and COPYING.lesser.

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

tgrcrypto-1.0.0.tar.gz (46.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tgrcrypto-1.0.0-cp314-cp314-win_amd64.whl (201.9 kB view details)

Uploaded CPython 3.14Windows x86-64

tgrcrypto-1.0.0-cp314-cp314-manylinux_2_34_x86_64.whl (296.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

tgrcrypto-1.0.0-cp314-cp314-macosx_11_0_arm64.whl (259.4 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

tgrcrypto-1.0.0-cp313-cp313-win_amd64.whl (201.7 kB view details)

Uploaded CPython 3.13Windows x86-64

tgrcrypto-1.0.0-cp313-cp313-manylinux_2_34_x86_64.whl (296.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

tgrcrypto-1.0.0-cp313-cp313-macosx_11_0_arm64.whl (259.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

tgrcrypto-1.0.0-cp312-cp312-win_amd64.whl (201.6 kB view details)

Uploaded CPython 3.12Windows x86-64

tgrcrypto-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl (295.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

tgrcrypto-1.0.0-cp312-cp312-macosx_11_0_arm64.whl (259.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

tgrcrypto-1.0.0-cp311-cp311-win_amd64.whl (203.4 kB view details)

Uploaded CPython 3.11Windows x86-64

tgrcrypto-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl (296.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

tgrcrypto-1.0.0-cp311-cp311-macosx_11_0_arm64.whl (259.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

tgrcrypto-1.0.0-cp310-cp310-win_amd64.whl (203.6 kB view details)

Uploaded CPython 3.10Windows x86-64

tgrcrypto-1.0.0-cp310-cp310-manylinux_2_34_x86_64.whl (296.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

tgrcrypto-1.0.0-cp310-cp310-macosx_11_0_arm64.whl (259.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

tgrcrypto-1.0.0-cp39-cp39-win_amd64.whl (206.0 kB view details)

Uploaded CPython 3.9Windows x86-64

tgrcrypto-1.0.0-cp39-cp39-manylinux_2_34_x86_64.whl (298.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

tgrcrypto-1.0.0-cp39-cp39-macosx_11_0_arm64.whl (260.7 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file tgrcrypto-1.0.0.tar.gz.

File metadata

  • Download URL: tgrcrypto-1.0.0.tar.gz
  • Upload date:
  • Size: 46.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tgrcrypto-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e7e207f7ee78d0ee6115098b42c6952621d1325c18eb8b5b39657b2ba9967379
MD5 5dbf3427b61d439199b636d6adf75255
BLAKE2b-256 96582f1186ba03c3fa788405feddeed861485846d3a26577e61d53fb5239e1d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0.tar.gz:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: tgrcrypto-1.0.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 201.9 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tgrcrypto-1.0.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 0df7ac401f4b5ddca76878b00e2a9a2c412cf064b39ef028b423913e42140202
MD5 2e2ac27364e689ef65f331e5adcb8a0c
BLAKE2b-256 f64d881ad92fe90e366951a0faafcdaeecc98e74664299feb3dfcf718161497e

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp314-cp314-win_amd64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.0.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a8bed9522a33b3a12bb03edca2e5c967fcb7dcb6d60b85840a62048426d2a790
MD5 9cbb060ef0a9a6912e357ab36defad2f
BLAKE2b-256 c59ae27816be56b37c868e77aee6ced1c6d78ec6b37ab6da512ad8c1fb36952f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp314-cp314-manylinux_2_34_x86_64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.0.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a233db9e6418d9733994677a3545820fd8ee2c2f7a92d19cbe341bba6ebfd8a4
MD5 f39dac068a1cb7303b908fa1b6f5d930
BLAKE2b-256 b4a088030bf8dad0373c287f7d9e39f836fe64fc0d09c6896424716a1133ef65

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: tgrcrypto-1.0.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 201.7 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tgrcrypto-1.0.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d99b986c6ac7a3eb53b3dd42fa7f0433d70f6fbfab362aed2d0d9d667dad350a
MD5 cf1025259968a4c9866e894dc15e8568
BLAKE2b-256 4c78c74016557b633303b75f6498a3ca93e26e55a2de41dc5fb37838b7f57957

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp313-cp313-win_amd64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.0.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4ea5c2faf6fb782d7028475826fd68b51b73ad1753a5759daa0cd2333617cf84
MD5 ccfc1622241d34f1f408a7e5bd061aaa
BLAKE2b-256 ed1f20626f236e33e61ad49066f6723130d85e09c97b9748af3ece81d82d50f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp313-cp313-manylinux_2_34_x86_64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bd8db6650d6ed863505912401b1389b3a1f041b000f2475788defa5428a8b701
MD5 54ed0d0ede9bfa7da114a56da6f1ed36
BLAKE2b-256 75734393f8631900da548f4e175858ee7f8255c028ee444ea855768cd9f5d055

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: tgrcrypto-1.0.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 201.6 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tgrcrypto-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f6902aaa91b2b2eec87002edf9815735a8528ce8dbc3ab6d0b84e870f534422d
MD5 f5d85a2e407bc1046b27fa83da088f2e
BLAKE2b-256 d8aabbb440faa417b7e1de5bff165db265f2d964e0d46f572193e765f86dc5b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp312-cp312-win_amd64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b8aac69eedd16858b0160812f992cb8ab7006a78b0b6a0c446c5d75a3c42ed0d
MD5 b34c5d3603fe1cd7a426990cdf828511
BLAKE2b-256 bc5627bd72fcf469e4cad6406a68b2ee44898c184064e9a431ee5e5ae0bcbf81

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 92d030a96b7162a071119ac9da12e272d886b369acde444cdf272f8495924dc0
MD5 bf4d03645729f800a1646bb77a1810ec
BLAKE2b-256 0775344ae4c7711bad33c0355bb67ad127fa492ee30532ba7c1ef8e89a9a275c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: tgrcrypto-1.0.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 203.4 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tgrcrypto-1.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 95bb98ebbefa2f2d7f8dc53c580790f47e6b0d01823f6be097feb8b109f1902b
MD5 12dffe34d73f6c2ee6e2e4de7b22d36a
BLAKE2b-256 0a47b1e9addc3674ccce8b5a49cd1c01460ff970cb9148a623cafef50f5f41b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp311-cp311-win_amd64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1ffe71fd6ab2fb45a43a7150df69310562ae90697229f8d747a6468897f74567
MD5 fabc03efd98ad224ebbb8a38a21e0de6
BLAKE2b-256 357df5382dd2f4117db67812a96da14b993bc695530a4f8b9631a436e1815598

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 111e02304c28dd6219f2b33c016acc69a0d0402848d8063bab0bfc0b77a9c4af
MD5 aa69c7a69f8f4833534145590b8b19df
BLAKE2b-256 069800d3e0226d794fdecb650196ad4e56ccb2d466024f8f16d37f9f44326b3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: tgrcrypto-1.0.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 203.6 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tgrcrypto-1.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3388467a16c42caca24d8b5691b044aa3595d9db75299775f024feba49cca32b
MD5 ee801b4c5a2f3ca4c7c4d579a2366e72
BLAKE2b-256 b1893a565b99ea7a31e7665c69417102e4c1774ae3644c53f0674c3d22fdfcc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp310-cp310-win_amd64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.0.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 697fae7e762a50a81abbef51692a2f214a56335b07f3be5e7ddca1fe4c96de77
MD5 ee0ab5bad315964db2d09b1da2d8f112
BLAKE2b-256 456b2bbe98a3da25d06bbc78a498cd7507ddeb633051d7ed32d51f791ad70152

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6d409dd33866bb967fc4a7a925c7e589bde64358b7c9f1dc7c9779347f9490b8
MD5 13d8da4ca7e13f68fa6da73ef21671a2
BLAKE2b-256 25dcd7a9bb5d57429587150848506bd504223c47ed277bc0019bc87a676dca60

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: tgrcrypto-1.0.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 206.0 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tgrcrypto-1.0.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ec296cbe92000786aba4260bfa957be20334afa66428c6c313062c8e4c3edf41
MD5 0d5301ff226756374cc037988a2f98d7
BLAKE2b-256 acdea7b5cb268415bdea269580f2e24b6085ddc998addd6c5184a94982f95148

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp39-cp39-win_amd64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.0.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 daa084f973fcdbf36e8d0164b7bae9b8a02280e7ec33b12be03a5a6515469366
MD5 e482a8cf071c8efe1ea23392f374c887
BLAKE2b-256 e2b321e832acff6e090ec972fe2e77967b0019ffe99495098739c9fb71e0c736

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp39-cp39-manylinux_2_34_x86_64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgrcrypto-1.0.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.0.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 904c5d1ceca53086a23a2493a2cd516fcaac5d29d2aa284fefe500e2504bd169
MD5 578948902a65ba0ba91bbcedcb1f69cf
BLAKE2b-256 74d8110d38e23be606149f696eaf5a4f3b3dad8d5b19007ca17bb6c431239a54

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.0.0-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: pypi.yml on joyccn/TgrCrypto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page