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, and CTR. GCM is planned to be added.

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.0.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.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rijndael3d-1.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 c72ee86c6218ae50bb2ba0c7e92c1a4207b2993965570f099ec47ee28c02473d
MD5 3fe2dd43b338990313b2c38a99937bd7
BLAKE2b-256 0d7c8661cbf38e3ac45f88c4c370072c5713fcf0bc90b559b0e2c6840e032fec

See more details on using hashes here.

Provenance

The following attestation bundles were made for rijndael3d-1.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: rijndael3d-1.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83a88f15063e55f8a47bb7dab298479f6400e7c206dc30068879ff819625b9d5
MD5 0fc7aebb711375e34b0f93ab87c365c5
BLAKE2b-256 8f59a61aed2dbc66a439d9b711aac198f19274b3d16fcc908ea6b359c2f8dcc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for rijndael3d-1.1.0-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