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

  • 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: pytest -n auto

  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.2.2.tar.gz (7.7 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.2.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for core_ciphers-1.2.2.tar.gz
Algorithm Hash digest
SHA256 d3ddbfaa27b02155f09421db93772945ac2d83a864c6d656cf0e655c8617a5fd
MD5 acd20fd75d63549b64e673b32c1bbc9d
BLAKE2b-256 fe6658d9c4c91487fb9affc2184f00a2e2a73b51e1a5c1be49c76d2161d826d8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for core_ciphers-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b397ec474aafd67eae7dfd6b08044284a94b561b842cc03249a7d724fddf8c32
MD5 34e74b6ac104a5f79c1f075cb573d5e9
BLAKE2b-256 07f0d4546f15a84f07ea7b68325160f1425ce78e85638d9c9d2b3cdc93bb7241

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