A Python library for substitution cipher encryption, decryption, and cryptanalysis
Project description
homeworkshits
JAK TO FUNGUJE:
download_resources.py - stahuje data knih z wikisource. Data nejsou přiložena v gitu.
bigrams.py - práce s maticemi. Ukládají se nenormalizované, aby byly hezky v celých číslech. Funkce transition_matrix_raw() se používá pro TM_obs, u které umělé nafukování jedničkami zhoršuje výsledky.
cypher.py - samotná práce se šiframi, ukázka prolomení
decipher_all.py - hromadné dešifrování, nebude součástí knihovny, ale funkcionalitu budete potřebovat
TO DO:
- upatlat z toho knihovnu
- a celý ten jupyter notebook
implementované a zdokumentované funkce požadované v zadání
- get_bigrams(text)✅
- transition_matrix(bigrams)✅
- substitute_encrypt(plaintext, key)✅
- substitute_decrypt(ciphertext, key)✅
- prolom_substitute(text, TM_ref, iter, start_key)✅
- plausibility(text, TM_ref)✅
parametry
- alphabet- obsahuje abecedu písmen, např. list
- TM_ref – referenční relativní matice bigramů / přechodů sestavená z nějakého textu který není zašifrovaný (např. knihy)
- iter – počet iterací algoritmu
- start_key - dává uzivatel ale pokud ho nedá vygenerujte náhodně počáteční klíč pro prolomení šifry.
- text – zašifrovaný text se kterým pracujeme
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cipherlibunicorn-0.1.0.tar.gz.
File metadata
- Download URL: cipherlibunicorn-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a75eeedb389fbb7a82160dc8961edbeeb904bd57e60992e89ee9bf20c19bbfe
|
|
| MD5 |
e9322ffb8aa7e76186c2285a22416bbe
|
|
| BLAKE2b-256 |
7c2ccf8ca9ef7a5854ecfac8aaefa729466aa4ee53ca2b57b194f3b02792e798
|
File details
Details for the file cipherlibunicorn-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cipherlibunicorn-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53bfe7b532af9f04f47e4d83ddd7b89c64cb08de2f4d833513b6c20bc2e199c7
|
|
| MD5 |
d6c608055f41a3e7c5172a925efdba56
|
|
| BLAKE2b-256 |
2c2f8d2aaa1019ca487b19d16cdf6505889c68458d32f224e952a26e04b38a75
|