A modular CTF/crypto library toolkit for encodings, classic ciphers, and autodetection. CLI included :3.
pydecodr is a Python package that lets you encode, decode, encrypt or decrypt text using classical, polyalphabetic, modern, and stream ciphers, all through a Python API and a CLI interface
- classical ciphers: (caesar, atbash, affine, rot13, substitution, hill, polybius, 4square, bacon)
- polyalphabetic: (vigenere, autokey_vigenere, beaufort, playfair, gronsfeld)
- fractionation: (bifid, ADFGX, trifid, ADFGVX)
- transposition: (railfence, columnar, double transposition, myszkowski, route)
- stream: (xor, repeating xor, rc4)
- modern: (aes, rsa, hash utilities)
- encodings: (b32, b64, hex, URL-safe, morse, base85)
- detection & utils: (file magic detection, I/O helpers)
- cli interface
pip install pydecodrYou can use any cipher module directly with Python's -m flag:
# caesar cipher
python3 -m pydecodr.ciphers.classical.caesar encrypt "HELLO" 3
# -> KHOOR
python3 -m pydecodr.ciphers.classical.caesar decrypt "KHOOR" 3
# -> HELLOfrom pydecodr.ciphers.classical import caesar
from pydecodr.ciphers.polyalphabetic import vigenere
print(caesar.encrypt("HELLO", 3))
# KHOOR
print(vigenere.encrypt("HELLOWORLD", "KEY"))
# RIJVSUYVJNOr load dynamically using the global registry:
from pydecodr import load_module
mod = load_module("adfgx")
ciphertext = mod.encrypt("DEFEND THE EAST WALL", "FORTIFICATION", "CIPHER")
print(mod.decrypt(ciphertext, "FORTIFICATION", "CIPHER"))Check this for more usage: usage