Metadata-Version: 2.4
Name: cipherid-vwlau
Version: 0.1.0
Summary: A teaching tool for identifying common text encodings and classical ciphers
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Text Processing
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# cipherid

A small, dependency-free teaching package that guesses a few common text
encodings and classical ciphers. It can recognize Base64, hexadecimal,
URL percent-encoding, ROT13, some Caesar shifts, and plain English text.

Modern encryption such as AES is designed to look random. The package cannot
reliably tell which modern cipher was used or recover its plaintext without
the right key. Its language guesses are also uncertain for short samples.

## Use it from Python

From the project directory:

```python
from cipherid import identify

for guess in identify("SGVsbG8gd29ybGQ="):
    print(guess.name, guess.decoded)
```

To inspect a text file from Python:

```python
from cipherid import identify_file

for guess in identify_file("sample.txt"):
    print(guess.name, guess.decoded)
```

## Command line

```text
python -m cipherid "SGVsbG8gd29ybGQ="
python -m cipherid --file sample.txt
```

`TRAINING_EXAMPLES` in `__init__.py` provides 5,000 reproducible labeled
examples: 1,000 generated English phrases, each represented as plain text,
Base64, hexadecimal, URL percent-encoding, and ROT13. You can inspect them
from Python:

```python
from cipherid import TRAINING_EXAMPLES

print(len(TRAINING_EXAMPLES))  # 5000
print(TRAINING_EXAMPLES[:5])
```

These examples demonstrate known transformations; they are not examples of
modern encryption like AES. The detector uses structural checks for the
formats it supports, rather than training a statistical model on this
synthetic dataset. Modern encryption is designed to hide patterns, and
identifying it generally requires metadata or the key.
