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

Uploaded CPython 3.14Windows x86-64

tgrcrypto-1.1.0-cp314-cp314-manylinux_2_34_x86_64.whl (296.0 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

tgrcrypto-1.1.0-cp314-cp314-macosx_11_0_arm64.whl (262.4 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

tgrcrypto-1.1.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.1.0-cp313-cp313-macosx_11_0_arm64.whl (262.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

tgrcrypto-1.1.0-cp312-cp312-win_amd64.whl (201.2 kB view details)

Uploaded CPython 3.12Windows x86-64

tgrcrypto-1.1.0-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.0-cp312-cp312-macosx_11_0_arm64.whl (262.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

tgrcrypto-1.1.0-cp311-cp311-manylinux_2_34_x86_64.whl (295.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

tgrcrypto-1.1.0-cp311-cp311-macosx_11_0_arm64.whl (262.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

tgrcrypto-1.1.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.1.0-cp310-cp310-macosx_11_0_arm64.whl (262.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

tgrcrypto-1.1.0-cp39-cp39-win_amd64.whl (205.7 kB view details)

Uploaded CPython 3.9Windows x86-64

tgrcrypto-1.1.0-cp39-cp39-manylinux_2_34_x86_64.whl (297.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

tgrcrypto-1.1.0-cp39-cp39-macosx_11_0_arm64.whl (263.9 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: tgrcrypto-1.1.0.tar.gz
  • Upload date:
  • Size: 48.0 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.0.tar.gz
Algorithm Hash digest
SHA256 91150927d8855aa573826992de8474bb68938c4e0c91304eafc9bbafc82d5bc5
MD5 6859665aa83d9e26d97fd9da4ad07117
BLAKE2b-256 603523f90f78c45379a37df33a1594f2bd75eb31a6171c32dfe250bfb4e4ca6e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tgrcrypto-1.1.0-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.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 a947fc5e3b7a3fc49eb79007f8176a097f29103b455209a12270e10506dc7a36
MD5 82e6a854a7351d51c2d6939b82ce12fc
BLAKE2b-256 cf8f46bc400e5e870f734e3af5c1a0a062ae539f954666fe553d94652aabe4c4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tgrcrypto-1.1.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b7276ff9629e5a95a601452cd9a4832b4da433a4b64a445158895127a5ec4164
MD5 ac4013199895c0fe40d35218f8868d07
BLAKE2b-256 9a2af1c3437c810c9c37e06b0198347977149fc032a096f55ded8201a500cd1a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tgrcrypto-1.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5e347d2a2666fe64bded363ce744536f948c26b55ba70885580f28662682790b
MD5 db9b37b0716497b85f3b8e44a33c1a8d
BLAKE2b-256 e4db275210452cdaa71f40553652d244b9fe2771a1c15ffecd35aec932f6896b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tgrcrypto-1.1.0-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.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4b0e5b3c6544eebc9c56f1412bce70e9915a659828f78575a05a996c14c4aaa6
MD5 18f3f6b345e06b1e2748fb1d228c84ec
BLAKE2b-256 c748b2f3774658151b23b990d97a67ddd774f4d930063515127cc5a16cbe3451

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tgrcrypto-1.1.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 15b48469f5e460e8751700102e403f13c25ab43261e921592dc702b988b31c66
MD5 e2af1f3a4f1e5a37a985832c518d99c2
BLAKE2b-256 8629d07b321ee9f9a9a1455fc5738bfa5f94914f99bbf39e130fd6f3644d740f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tgrcrypto-1.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d9f534293b7aef2ad4bf36a92482de9f158768bfe2dc1094234f422000b67fe8
MD5 013b2689f8b2c8d4823ffe069af1b13d
BLAKE2b-256 6404affd7f660288f8043548728f9bcd665da299a529dc5e51fd15e425547dcd

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tgrcrypto-1.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 201.2 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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ab23c0014b894dd8d5254d4b39039cfb0164a808780eca43aae9468feaf59d4d
MD5 d74c9510136eeaa889f56751f39127c5
BLAKE2b-256 0e596cef99930414bf3682bb05df42429936589e8963397e844682d5365c4ab9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tgrcrypto-1.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 553d04c16185099fcc93f7eada2fadd4993f8c60d671e40d13dbb3637732e7b1
MD5 4dfccb85d31c698fc51ae2c09f1f2fb8
BLAKE2b-256 f914a2987b396878572505e6c1db506d9971c9dbb44d057a810b2dad2a3251d9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tgrcrypto-1.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8c8d7e5f2e59ca12afc715c4757b45676e348c2fdb4b86a3e9e9a15901596094
MD5 a4586802f730186322090e3d5d0c448d
BLAKE2b-256 15cd59eefa36d633980e0ae03819d524121b93197bf33af906088e634bc686cc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tgrcrypto-1.1.0-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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 76ec7566818419fcde45a8f59e756f81694c769fc685e9c3ea6d0d7a95029b6e
MD5 c3b6bd42ccb67122f0e3abfbf1481683
BLAKE2b-256 f67bf96bbb744aad6988029a6b1b22405351e57cdd7b0aec435f20ed19f4fd18

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tgrcrypto-1.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d270b00914f6deeeecf02e637811e89bb132bee58897c787cf2d7e7d9a54f1e9
MD5 a75319fe72fd5304c9f401529e529adb
BLAKE2b-256 ccd1ebfb918072fe3fbae8d7bdfd351eed19b46536f0abf344869d89b0bdd9ee

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tgrcrypto-1.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 df3d3f18aec8c3e7754ba7e56ef36251497d8d2cc9072257e159841cb181412d
MD5 a737ba04e0a47917bcdc6930e5d3c4ab
BLAKE2b-256 e043dc68089ce00efce54f36f1d50265a6b48ac3611c5832196719b6507dc5a7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tgrcrypto-1.1.0-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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6ace36e031e80e67dfe8152fc848167f8b9078bc84344da3e204740fa8a68f57
MD5 fd918c583d6148b2d5936c047305667c
BLAKE2b-256 29699f24100fe9637b88b07883c34f03971f713ff367a392bb18479206bc3f0a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tgrcrypto-1.1.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4b7228a6663dbaced63b39c3d2626e2ef97e2305b1ebbbde4766618397755bc1
MD5 676eb4a01812aa15bf376948efa73ad2
BLAKE2b-256 3e27fecff058a4edf40833f220f71b4e69da1864d1820f7001f198490a4de6dc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tgrcrypto-1.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b6dd8db2c8be2710daf54c89d11df26a811f484dcc4b4d4f3858bb177d894598
MD5 f2d62ce7c5bc5d6011075025e5e3c0d4
BLAKE2b-256 7d5c13ec653a4daafc1d4050b0a0b86fdfb882524b1af91e7a9d5110014853ef

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tgrcrypto-1.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 205.7 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.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 da83525c8b53412bc36038cb6a0b024f6977d90e41f3ce9b948aa97d6aa29953
MD5 6e15a41c539519ae0dd0a1d59188c537
BLAKE2b-256 56bee289dc2998c1a7eb36626b2ffdc347063cb1842d4cc72968803415539542

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tgrcrypto-1.1.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6062ddf5ccd52afdf846bf563cef4479814cfa28c78860dd54d1ba380359d6b0
MD5 f791821916f2821d28abed2f55735ecb
BLAKE2b-256 a97a130523b3e29076dd65e6849f5af346aa1f4cb8c8f911f9ec0e73bc77fb79

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tgrcrypto-1.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 febad14b5c7d320764f721c4583e6f5619da1e4837725884f112184a1cba77d2
MD5 4c788dfc2fe4ea87a1fcab9625f82a4e
BLAKE2b-256 f876cb0ac162467f49521d42691b31b1247c24d725e30e2e1d7478458e9b8192

See more details on using hashes here.

Provenance

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