Skip to main content

An enhanced version of Rijndael encryption

Project description

Rijndael3D

Rijndael3D is my work-in-progress extension of the Rijndael cipher that works in 512-bit 4x4x4 blocks of bytes. This module uses new layer-based permutation algorithms together with modified versions of regular Rijndael components to utilize the 3 dimensional structure of blocks. This module is programmed in pure Python, it implements finite-field arithmetic in GF(28) and is boosted by the numba module internally.

Cipher Specifications

  • Key size: 512 bits
  • Block size: 512 bits
  • Number of rounds: 16 rounds
  • Structure: substitution–permutation network
  • Padding method: pseudo-randomized (seeded) padding using the SHA512 of the key.
  • Supported modes: the current version of Rijndael3D supports the following modes; ECB, CBC, CTR, and GCM.

Disclaimer

This module was built as a fun project to learn cryptography and cryptanalysis. It is not designed to withstand side channel attacks or other advanced cryptanalysis techniques.

Installation

This module is available only on PyPI, installation via pip:

pip install rijndael3d

Basic Usage

Because the block size is 512 bits, the keys and initialization vectors must all be in the matching size of 512 bits.

The basic usage of this module is as follows (CTR mode for example):

Importing the appropriate functions:

from rijndael3d.modes.ctr import ctr_encrypt, ctr_decrypt

Encrypting:

encrypted = ctr_encrypt(plaintext, key, iv)

Decrypting:

decrypted = ctr_decrypt(ciphertext, key, iv)

Advanced Usage

If you want to utilize the internal functions of this module or take a closer look at them, this is the section for you.

The functionality of this module are segmented into the appropriate files and directory:

  • block.py: All internal block manipulation functions.
  • cipher.py: Round performing and single block encryption/decryption.
  • constants.py: Contains all the constants used.
  • debug_operations.py: Debug-related functions, not used in normal usage of the module.
  • gf_arithmetic.py: The implementation for GF(28) arithmetic.
  • key_schedule.py: The key scheduling algorithm.
  • padding.py: The padding mechanism.
  • utils.py: Utility functions.
  • The modes directory that contains the code for each mode of operation.

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

rijndael3d-1.1.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

rijndael3d-1.1.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rijndael3d-1.1.1.tar.gz
Algorithm Hash digest
SHA256 a686a930214a1542c33c2f4d70f13b18695606e60e2fd5321b41be9f8135a119
MD5 e9de309ef7ceaf19e91938dbe88fa986
BLAKE2b-256 cd8b2c202755d34005686ebe092b5ac9d7913fce8fc68f68b94ef0c7334747ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for rijndael3d-1.1.1.tar.gz:

Publisher: pypi-publish.yml on Jebbex1/Rijndael3D

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

File details

Details for the file rijndael3d-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: rijndael3d-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rijndael3d-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d6d5be5c1cb2ee478c6e4f49435823f59a8c771bf7804aa4523082b6b1fb97a7
MD5 8c43386b1e9975a0ffa5f354cfe5c4a5
BLAKE2b-256 ca98efe7d5b1055edffba106391a8c508824f7c07eaf0b6eb56316e26e46ce94

See more details on using hashes here.

Provenance

The following attestation bundles were made for rijndael3d-1.1.1-py3-none-any.whl:

Publisher: pypi-publish.yml on Jebbex1/Rijndael3D

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