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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chronofidelius-1.0.0.tar.gz.
File metadata
- Download URL: chronofidelius-1.0.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09c805e1a4a4990194ca54bc8a173bec35efbe63ef94fb68a0bf34e82dde349a
|
|
| MD5 |
13e3580827e3464fda979f9b7b3484cf
|
|
| BLAKE2b-256 |
98cf2313d920a11ca8c5c87c5366ac4107c22778392c389c2583371835648076
|
File details
Details for the file ChronoFidelius-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ChronoFidelius-1.0.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c48051f742d5b508b908f471b823d2a2092e2d58bcc7b5ad46993c83d5109f3
|
|
| MD5 |
aa2321e0e3a5e07b24bdb969adf124e7
|
|
| BLAKE2b-256 |
3a31ff572f45d3994ef06ecf45c9342d0e7ec1f009a6d1f8f35c26e4a6cf7d76
|