Metadata-Version: 2.1
Name: ViginereBreaker
Version: 0.0.2
Summary: This file implements a viginere breaker.
Home-page: https://github.com/mauricelambert/ViginereBreaker
Author: Maurice Lambert
Author-email: mauricelambert434@gmail.com
Maintainer: Maurice Lambert
Maintainer-email: mauricelambert434@gmail.com
License: GPL-3.0 License
Project-URL: Documentation, https://mauricelambert.github.io/info/python/security/ViginereBreaker.html
Keywords: Viginere,ViginereBreaker,Decryptor,Breaker
Platform: Windows
Platform: Linux
Platform: MacOS
Classifier: Programming Language :: Python
Classifier: Development Status :: 5 - Production/Stable
Classifier: Topic :: Security :: Cryptography
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.9
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE.txt

![ViginereBreaker logo](https://mauricelambert.github.io/info/python/security/ViginereBreaker_small.png "ViginereBreaker logo")

# ViginereBreaker

## Description

This file implements a viginere breaker.

## Requirements

This package require :
 - python3
 - python3 Standard Library

## Installation
```bash
pip install ViginereBreaker
```

## Usages

### Command line

#### Module

```bash
python3 -m ViginereBreaker cipher.txt
```

#### Python executable

```bash
python3 ViginereBreaker.pyz cipher.txt
```

#### Command

##### Basic

```bash
ViginereBreaker cipher.txt
ViginereBreaker cipher.txt -k 4 -a "ABCDEFGHIJKLMNOPQRSTUVWXYZ" -s "{\"E\":10,\"A\":7}"
```

### Python script

```python
from ViginereBreaker import ViginereBreaker
from codecs import encode

text=encode("""
Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch
antidisestablishmentarianism
counterimmunoelectrophoresis
oesophagogastroduodenoscopy
ethylenediaminetetraacetate
hexadecyltrimethylammonium
diisopropylfluorophosphate
ethylenediaminetetraacetic
uvulopalatopharyngoplasty
great-great-granddaughter
styrene-butadiene-styrene
cholangiopancreatography
tetracyanoquinodimethane
oligodeoxyribonucleotide
phosphatidylethanolamine
proto-industrialization
hypergammaglobulinaemia
politico-administrative
intracerebroventricular
pancreaticoduodenectomy
electro-encephalography
electroencephalographic
polytetrafluoroethylene
lysophosphatidylcholine
first-come-first-served
""", 'rot_13').upper()  # rot_13 -> key="N"

breaker = ViginereBreaker(text, statistics={"E": 11, "A": 9})
print(breaker.breaker())

# {1: [['N']], 2: [['N'], ['N']], 4: [['N'], ['N'], ['N'], ['N']]}
# ViginereBreaker try to find a key with multiple key lengths
# The ciphertext with the key 'N' or 'NN' or 'NNNN' is identical
```

## Example

Using CustomCrypto:
 - [test_viginere_breaker.py](https://github.com/mauricelambert/ViginereBreaker/blob/main/test_viginere_breaker.py)
     - [text.txt](https://github.com/mauricelambert/ViginereBreaker/blob/main/text.txt)
     - [cipher.txt](https://github.com/mauricelambert/ViginereBreaker/blob/main/cipher.txt)

## Links

 - [Github Page](https://github.com/mauricelambert/ViginereBreaker/)
 - [Documentation](https://mauricelambert.github.io/info/python/security/ViginereBreaker.html)
 - [Pypi package](https://pypi.org/project/ViginereBreaker/)

## Licence

Licensed under the [GPL, version 3](https://www.gnu.org/licenses/).


