Skip to main content

A Python library for for plaintext encryption using homophonic substitution and historical character frequencies.

Project description

ChronoFidelius

ChronoFidelius is a Python library for plaintext encryption using homophonic substitution and historical character frequencies. It provides configurable error injection, frequency-based key generation, and advanced encryption techniques inspired by historical cryptography.


Features

  • Homophonic Substitution Cipher: Encrypts plaintext with multiple cipher options for each character.
  • Frequency-Based Key Generation: Supports even and uneven key generation using historical unigram frequencies.
  • Error Injection: Introduces errors (additions, deletions, or doubles) into plaintext for obfuscation.
  • Custom Configurations: Control error frequency, character spacing, and more.

Installation

Install ChronoFidelius using pip (after publishing the package to PyPI):

pip install ChronoFidelius

Or, install directly from the source:

git clone https://github.com/mbruton0426/ChronoFidelius.git
cd ChronoFidelius
pip install .

Usage

Basic Example:

from chronofidelius import ChronoFidelius

# Initialize the ChronoFidelius object
cf = ChronoFidelius(
    plaintext="Hello, World!",
    include_errors=True,
    error_type="all",
    set_seed=42
)

# Perform all encryption methods using included historical frequencies
cf.encrypt_homophonic()

# Access the generated ciphertext and encryption dictionary
print(cf.pt_ct_dict)

Specific Encryption Method Example

To specify the type of encryption:

cf.encrypt_homophonic(key_type="even")

Custom Frequency-Based Encryption Example

You can also provide custom character frequencies

# Custom frequency dictionary
custom_frequencies = {"A": 0.1, "B": 0.2, "C": 0.3, "D": 0.4}

# Perform uneven encryption
cf.encrypt_homophonic(key_type="uneven", set_frequencies=custom_frequencies)

License

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

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

chronofidelius-1.0.1.tar.gz (47.0 kB view details)

Uploaded Source

Built Distribution

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

ChronoFidelius-1.0.1-py3-none-any.whl (46.4 kB view details)

Uploaded Python 3

File details

Details for the file chronofidelius-1.0.1.tar.gz.

File metadata

  • Download URL: chronofidelius-1.0.1.tar.gz
  • Upload date:
  • Size: 47.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for chronofidelius-1.0.1.tar.gz
Algorithm Hash digest
SHA256 aaba760bd8a94f5cb291c2740f7add35b06cc6f37b3246a4744af27c96ae287f
MD5 02fd0cd0e8efc060d4492f76f385db09
BLAKE2b-256 10a4bfea8040d72cc9fa6b25d0da8d81a85fda0dd6230d5b43a2e2b558bd5121

See more details on using hashes here.

File details

Details for the file ChronoFidelius-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: ChronoFidelius-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 46.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ChronoFidelius-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 86e59d75f2339730a5c708ce37ae40a74387b957e7c7673354cc16458001787c
MD5 5bfd8590294eea7a4e2e183f2c52bbf5
BLAKE2b-256 2866bdaf1347d7c486bda6ea0610163dfe3111a22324da7b30f717e4e357e77f

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