Skip to main content

This project/library contains common elements related to ciphers...

Project description

core-ciphers

This project/library contains common elements related to ciphers…


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

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

core_ciphers-1.3.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

core_ciphers-1.3.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file core_ciphers-1.3.0.tar.gz.

File metadata

  • Download URL: core_ciphers-1.3.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for core_ciphers-1.3.0.tar.gz
Algorithm Hash digest
SHA256 1b329dbdb8edbb88738c96a8749c05a2b6178d4428d154263f5631268e2dc21b
MD5 bc2c63abdacca3db1bd889e7d8f497bb
BLAKE2b-256 3b6d56bc93edff996d63053e70ebf596cc9d0be6b6e6dcd3a5f3eee239aba091

See more details on using hashes here.

File details

Details for the file core_ciphers-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: core_ciphers-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for core_ciphers-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6ba4c8d85c56170674b79d3bd2108850903907a072a55accfb758d668e0b0f4
MD5 9dfa00ffd121800f6442475142058090
BLAKE2b-256 503214caa6f05fcd43de13b0b15e49bf00dfc523df3602130d5647527725ed3e

See more details on using hashes here.

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