libciphers
A Python library providing implementations of classical cipher algorithms for cryptographic puzzles, CTF challenges, and educational purposes.
Install
pip install libciphers
Usage
from libciphers import caesar_encrypt, caesar_decrypt, vigenere_encrypt, vigenere_decrypt
# Caesar cipher
plaintext = "HELLO"
encrypted = caesar_encrypt(plaintext, 5)
decrypted = caesar_decrypt(encrypted, 5)
print(f"Caesar: {encrypted} -> {decrypted}") # MJQQT -> HELLO
# Vigenère cipher
encrypted = vigenere_encrypt("HELLO", "KEY")
decrypted = vigenere_decrypt(encrypted, "KEY")
print(f"Vigenère: {encrypted} -> {decrypted}") # RIJVQ -> HELLO
Supported Ciphers
Shift Ciphers
- Caesar (with brute force)
- ROT13, ROT-N
- Atbash
- Affine
Polyalphabetic Ciphers
- Vigenère
- Beaufort
- Variant Beaufort
- Autokey
- Running Key
- Porta
- Gronsfeld
- Quagmire variants
Transposition Ciphers
- Columnar
- Rail Fence
- Scytale
- Route
- Zigzag
Digraph Ciphers
- Playfair
- Four-Square
- Three-Square
Fractionated Ciphers
- Bifid
- Trifid
Other Ciphers
- Hill (2x2)
- Polybius Square
- Bazeries
- XOR
- Enigma (3-rotor)
Statistical Analysis
- Index of Coincidence
- Chi-squared
- N-gram scoring
- Kasiski examination
Development
git clone https://github.com/daedalus/libciphers.git
cd libciphers
pip install -e ".[test]"
# run tests
pytest
# format
ruff format src/ tests/
# lint
ruff check src/ tests/
# type check
mypy src/
Metadata
Release files for libciphers 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| libciphers-0.1.0.tar.gz | 15.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| libciphers-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.4 kB
Release files / libciphers-0.1.0.tar.gz
| Download URL | libciphers-0.1.0.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a83b2f99c06bddbbeefce5f851e2c0f67a6afdf4c9e5668d129c84ef0fff6b3b
|
|
BLAKE2b-256 checksum How to use checksums |
75146a2d8db480d9f09f1adc507e335171a571c51c758645b706cf4094651b92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 5, 2026.
Transparency logRelease files / libciphers-0.1.0-py3-none-any.whl
| Download URL | libciphers-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f371fbd30ad62d740332cd29ef153c23460e70e616b4f5f9ba8738e063ae04b
|
|
BLAKE2b-256 checksum How to use checksums |
b68eba350e7087513a10da5f82aac62ba3cd8a515be3c9a9a9c3e475495bb644
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 5, 2026.
Transparency log