Skip to main content

core-ciphers

This project/library contains common elements related to ciphers…


PyPI Downloads Python Versions License Pipeline Status Docs Status Security

Security - Cryptographic Library

This project uses ``pycryptodome`` (version >=3.21.0) for cryptographic operations, not the deprecated pycrypto library.

Important Note: Security scanners like bandit may report false positives (B413 warnings) when scanning this codebase. This occurs because both pycrypto (deprecated) and pycryptodome (actively maintained) use the same Crypto import namespace, causing scanners to incorrectly flag the imports as deprecated.

Verification: - Check pyproject.toml dependencies: pycryptodome>=3.21.0. - pycryptodome is actively maintained and regularly updated. - It is the recommended drop-in replacement for the deprecated pycrypto.

The B413 bandit warnings can be safely ignored as they are false positives.

Installation

Install from PyPI using pip:

pip install core-ciphers
uv pip install core-ciphers  # Or using UV...

Features

Core Components:

  • ICipher Interface - Abstract base class for implementing custom cipher algorithms.

  • AESCipher - Advanced Encryption Standard (AES) implementation with multiple cipher modes.

AES Cipher Capabilities:

  • Key Sizes: Support for 128, 192, and 256-bit encryption keys (MODE_SIV requires a double-length key: 32, 48, or 64 bytes)

  • Authenticated Encryption Modes:
    • MODE_GCM (Galois/Counter Mode) - Default, recommended for most use cases

    • MODE_EAX (EAX Mode)

    • MODE_CCM (Counter with CBC-MAC)

    • MODE_SIV (Synthetic Initialization Vector)

    • MODE_OCB (Offset Codebook Mode)

  • Block Cipher Modes:
    • MODE_ECB (Electronic Code Book)

    • MODE_CBC (Cipher Block Chaining)

  • Stream Cipher Modes:
    • MODE_CFB (Cipher Feedback)

    • MODE_OFB (Output Feedback)

    • MODE_CTR (Counter Mode)

Additional Features:

  • Automatic key generation if not provided.

  • Automatic padding for modes that require it (ECB, CBC).

  • Authentication tag generation and verification for authenticated modes.

  • Configurable character encoding (default: UTF-8).

  • Hex-encoded output for easy serialization.

  • Built on pycryptodome for secure, actively maintained cryptographic operations.

Quick Start

Installation

Install the package:

pip install core-ciphers
uv pip install core-ciphers  # Or using UV...
pip install -e ".[dev]"    # For development...

Setting Up Environment

  1. Install required libraries:

pip install --upgrade pip
pip install virtualenv
  1. Create Python virtual environment:

virtualenv --python=python3.12 .venv
  1. Activate the virtual environment:

source .venv/bin/activate

Install packages

pip install .
pip install -e ".[dev]"

Check tests and coverage

python manager.py run-tests
python manager.py run-coverage

Contributing

Contributions are welcome! Please:

  1. Fork the repository

  2. Create a feature branch

  3. Write tests for new functionality

  4. Ensure all tests pass: python -m unittest discover -s tests -p "tests_*.py"

  5. Run linting: pylint core_ciphers

  6. Run security checks: bandit -r core_ciphers

  7. Submit a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.

Support

For questions or support, please open an issue on GitLab or contact the maintainers.

Authors

Metadata

Release files for core-ciphers 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for core-ciphers 1.3.1
File Size Uploaded
core_ciphers-1.3.1.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for core-ciphers 1.3.1
File Interpreter ABI Platform
core_ciphers-1.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / core_ciphers-1.3.1.tar.gz

Download URL core_ciphers-1.3.1.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a7c0047fd40718a1de830665290c1125770d52bdfebd7d9425ef2b9fd2fcad57
BLAKE2b-256 checksum
How to use checksums
395769437a119c47907abee2007a028d8ab4199796d5ec574fa491314d3e6a0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / core_ciphers-1.3.1-py3-none-any.whl

Download URL core_ciphers-1.3.1-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abe4ce68ed0707f5c64d29c8329381cbaf8301187c1d454347d8ad9fe76eee40
BLAKE2b-256 checksum
How to use checksums
036dc34fc2ad338d0ea1d1987941269ca21c4ed1427cd44848d97bc04d65c379
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

1.3.1 This release

2 release files

1.3.0

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page