Skip to main content

The Griffinere cipher is a custom encryption algorithm in C# designed for reversible, base64-normalized encryption using a repeating key. Inspired by the Vigenère cipher, it adds configurable alphabet support, input validation, and padding-based encryption length enforcement.

Project description

Griffinere Cipher 🔐 — Python Edition

The Griffinere cipher is a reversible, Base‑64‑normalised encryption algorithm implemented in pure Python. Inspired by the classic Vigenère cipher, it adds:

  • Configurable alphabets (use any character set you like)
  • Input validation for safer usage
  • Padding‑based length enforcement so encrypted strings meet a minimum length

📦 Installation

pip install substitutionciphers

In your code:

from griffinere import Griffinere

✨ Features

  • 🔐 Encrypts & decrypts alphanumeric or custom‑alphabet strings
  • 🧩 Define your own alphabet (emoji? Cyrillic? go ahead!)
  • 📏 Optional minimum‑length padding for fixed‑width ciphertext
  • ✅ Strong validation of both alphabet and key integrity
  • 🧪 Unit‑tested with pytest

🧰 Usage

1 Create a cipher

1.1 Default alphabet

key = "YourSecureKey"
cipher = Griffinere(key)

The built‑in alphabet is:

A‑Z  a‑z  0‑9

1.2 Custom alphabet

custom_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ12345"
key = "YOURKEY"
cipher = Griffinere(key, custom_alphabet)
Alphabet rules
  1. Must not contain . (dot)
  2. All characters must be unique
  3. Every character in the key must appear in the alphabet

2 Encrypt & decrypt

2.1 Encrypt a string

plain_text = "Hello World 123"
encrypted = cipher.encrypt_string(plain_text)
# e.g. 'LUKsbK8 OK9ybKJ FC3z'

2.2 Encrypt with a minimum length

encrypted = cipher.encrypt_string(plain_text, minimum_response_length=24)
# e.g. 'cm9JbAxsIJg.LUKsbK8 OK9ybKJ FC3z.Fw'

3.1 Decrypt

decrypted = cipher.decrypt_string(encrypted)
assert decrypted == plain_text

⚠️ Exceptions & validation

Condition Exception
Alphabet contains . ValueError
Duplicate characters in alphabet ValueError
Key contains characters not present in alphabet ValueError
minimum_response_length < 1 ValueError

📄 License

MIT License © 2025 Riley Griffin

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

substitutionciphers-1.0.0.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.

substitutionciphers-1.0.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file substitutionciphers-1.0.0.tar.gz.

File metadata

  • Download URL: substitutionciphers-1.0.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for substitutionciphers-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c1a8b5b2c14cd6b3de15a0e0565c0b9ff02c18b5c2f3f6a09816ec6ed1c02863
MD5 9026555b2515145bc2f9481d0eb9620d
BLAKE2b-256 1a7bb3daad3fb634addc2404cd40d577c26e41f9c57f3f78b5c287620643fada

See more details on using hashes here.

File details

Details for the file substitutionciphers-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for substitutionciphers-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d280ed0694dbf593e885dfc0d8ca53629ac7609ca2e5caf9a82b68c45ba8e619
MD5 23b007d897d76e872978bf0391bfa9b6
BLAKE2b-256 dbb7e0ae330da2166be6b1839076818583c6a150f8ea844f827af19ab8e948af

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