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.1.1.tar.gz (48.3 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.1.1-cp314-cp314-win_amd64.whl (201.5 kB view details)

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

tgrcrypto-1.1.1-cp314-cp314-macosx_11_0_arm64.whl (262.1 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

tgrcrypto-1.1.1-cp313-cp313-win_amd64.whl (201.5 kB view details)

Uploaded CPython 3.13Windows x86-64

tgrcrypto-1.1.1-cp313-cp313-manylinux_2_34_x86_64.whl (296.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

tgrcrypto-1.1.1-cp313-cp313-macosx_11_0_arm64.whl (262.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

tgrcrypto-1.1.1-cp312-cp312-win_amd64.whl (201.4 kB view details)

Uploaded CPython 3.12Windows x86-64

tgrcrypto-1.1.1-cp312-cp312-manylinux_2_34_x86_64.whl (295.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

tgrcrypto-1.1.1-cp312-cp312-macosx_11_0_arm64.whl (262.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

tgrcrypto-1.1.1-cp311-cp311-win_amd64.whl (203.0 kB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

tgrcrypto-1.1.1-cp311-cp311-macosx_11_0_arm64.whl (262.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

tgrcrypto-1.1.1-cp310-cp310-win_amd64.whl (203.2 kB view details)

Uploaded CPython 3.10Windows x86-64

tgrcrypto-1.1.1-cp310-cp310-manylinux_2_34_x86_64.whl (296.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

tgrcrypto-1.1.1-cp310-cp310-macosx_11_0_arm64.whl (262.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

tgrcrypto-1.1.1-cp39-cp39-win_amd64.whl (205.8 kB view details)

Uploaded CPython 3.9Windows x86-64

tgrcrypto-1.1.1-cp39-cp39-manylinux_2_34_x86_64.whl (297.9 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

tgrcrypto-1.1.1-cp39-cp39-macosx_11_0_arm64.whl (263.7 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for tgrcrypto-1.1.1.tar.gz
Algorithm Hash digest
SHA256 6991458af8cea5b67f251c01f0d7a34a66e15b0dc4133ed461bb9a204e4ee57f
MD5 a2913b65305491d923b79e88b2113947
BLAKE2b-256 39034d12ebd7e063c942bfa0636bf247697755e45e1c57454a40597a7b7b3846

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1.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.1.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: tgrcrypto-1.1.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 201.5 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.1.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 1409de1750e5255751560bae8e08d2ab94db62b437893665c34f3b1b93d48af4
MD5 869702193401a2930559859168f87e5b
BLAKE2b-256 e31766bd263697bbf289d07a9bba3d6f5e1d39b64437c2bef06c864cfc314ea9

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.1.1-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 66bd442e4465b8179e7a6ce4458786431013a5fe83e4e6eb85c7b4b1d2d7f91b
MD5 cc0db2cb4f474a20c1e3bcb2727fcc74
BLAKE2b-256 3ddb206b9c3a0957f85ba148717b0839467775c88c1d173d84dbeb0a7cdf0682

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.1.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 22c7d392266e3b24d64172f27c7431e158fc53960947284f5f867579dec52b15
MD5 1358795dfbb5dde7392e021d19a3a0f5
BLAKE2b-256 88efe4972a35cc3b82ef2477232c8768781246363c55c9aab4c2232f71a1438a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: tgrcrypto-1.1.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 201.5 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.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ca5d07f72d861a16e206b3e46c89d440266c5d0e9ebed955a69d925a93ae8fb3
MD5 67378b90f95e22ccad43a8f41da178e4
BLAKE2b-256 3053f7b7c0313e872e7a5f769a7a057d8a3082896ed928bc404152ced979793e

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.1.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 907122578ac3d45a5bafadc74cee69a4e3fd26948427000ca3046fead8a6ac00
MD5 55693f55909bb883c35477f229835910
BLAKE2b-256 363a35f11dc244e9b75ce8e304c8bc25d970801b2cfced410518cfc413515f90

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.1.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2ae47ffac917ea969a19d22ba2dccf3fb261de29a6bdbd7817e2f931457b3387
MD5 a5c75bf7f4e90b625573ba5d422ed1b0
BLAKE2b-256 77ff53122573793d07b34fed25d247f65d79259858cf4c310d2f5a5833c8d73a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: tgrcrypto-1.1.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 201.4 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.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0efcb4880dba8b05b7b5036333745c6e88847b4915d569822c9c2b175bc3ee7d
MD5 46ab9294423909a0ec0613aabb899c1f
BLAKE2b-256 f39607980620a8dfbda7a507823687c4ee29733674b9281def29cfe3b3ab6adc

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.1.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 afedf6952a8ac06b1e3921e5da2ec93a0a849322299b3fd6cdfbe91dbeaac0c6
MD5 987f687dd89fe50edc60ca1fbdc6d835
BLAKE2b-256 da524797bc75cad6c5ffc4e1cf1dbda2ff4b7e71668c490c23f10a4630d24a8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4ad2a64e37cf4a9c058731cd7b2b1d53aacf9b18facac370581f22ab078edd93
MD5 08ac56b12eb6d3e1fd5fbfc652c3befe
BLAKE2b-256 c9b4261f689103bf1afb67a2fd70417dd34ddf39526f5b382ce1a603383d1a28

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: tgrcrypto-1.1.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 203.0 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.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 76729a560adfa6d79657cbb0f25c6df1800ccbd183f32162b8ffeb8e1866cd55
MD5 dfc588d10f5d58015711c5fcc02d1b31
BLAKE2b-256 7b40542bb6f6603cf22e2e560bef8fd06c770acf3484e5bf67cc4f30476d1cee

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.1.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bcca352d96ec3fba07191a08f8e29dff4d58fb90dd11471454a5a9960c271755
MD5 d79ed33796d041b71970bf5d79bedec8
BLAKE2b-256 a32ada5e33f6fe9b480b449725cf7b5e8080a3fe4c5c7b364ae68396818fe2ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 114b4d5b68325c2f93e52a046453f1b9228795b35751480fd5cf7385933d5434
MD5 4922f52a78d625539a6c1a4cbc638ec0
BLAKE2b-256 0ec7b62a3c6273860a1ac34f7f00ce620ef468732d113138712522dfdcc9aa2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: tgrcrypto-1.1.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 203.2 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.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 aed137a76273cdb7e310f297cee1c428d0971edc93f86af2c0374bd02033f5bd
MD5 d71762dd6e8c3dae014c1e36b56faa33
BLAKE2b-256 7a0178e1d70865f0230aeb4e6dccf011b56704346fa817c72e00c6031819c18f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.1.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bd665be84aa9229bef4c72f5b49921e3e57fcdb33aede2306868bf23e14134c0
MD5 7954816e1d26a7e515e44dc16a6f0ed7
BLAKE2b-256 c64de809439b4cea81a0d589101b815673243ef994ec7953f306f7f0fced7ab4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6b008492f58b5b819419a030278ea794c8c28748321e6b6ff5ef3ef2aa65c2a0
MD5 86aba3559c7ae6d928ef316e12c71648
BLAKE2b-256 105123396bc1f296b74e85c4182efab0fb2770e16f78fdd1d832b5523157d716

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: tgrcrypto-1.1.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 205.8 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.1.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5239bfbbcc032e64039ad7399a53fb70d0fa8eaba3ca8c82fe0a2bc090f4ca72
MD5 c11cdf7d69bd758e9c441c3eadea7d17
BLAKE2b-256 430455c22cd7fa8c22473c3e6c3404b2274e67c0c84ec0e50eaeb71565616347

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.1.1-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b74bb3f6f0d301be18105eb3f5ed7151927f715040bc3c590d0d41122d1bef20
MD5 e134251e37aaeaf692d4d86e1ce4ac2b
BLAKE2b-256 f681da6ecf3d054c2df5d50b8ce388e65bc561fc8432f906164751890fa787bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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.1.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tgrcrypto-1.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ec3984c9ebc4d711a59ce4a6a6477bf9ea0308d5c0f370aeb24c2a62945fd4a3
MD5 b5fb09fa59335d8b11d121399b4edba9
BLAKE2b-256 4b72145ba67aebf5c9af8d7f0a79161bf7978d484088b771c3c395ff592e29c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgrcrypto-1.1.1-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