libciphers 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .eggs/
7
+ *.egg
8
+ .env
9
+ .venv
10
+ venv/
11
+ env/
12
+ *.pyc
13
+ *.pyo
14
+ .pytest_cache/
15
+ .ruff_cache/
16
+ .mypy_cache/
17
+ htmlcov/
18
+ .coverage
19
+ .coverage.*
20
+ *.log
21
+ .DS_Store
22
+ .idea/
23
+ .vscode/
24
+ *.swp
25
+ *.swo
26
+ .hypothesis/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dario Clavijo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.4
2
+ Name: libciphers
3
+ Version: 0.1.0
4
+ Summary: A Python library providing implementations of classical cipher algorithms
5
+ Project-URL: Homepage, https://github.com/daedalus/libciphers
6
+ Project-URL: Repository, https://github.com/daedalus/libciphers
7
+ Project-URL: Issues, https://github.com/daedalus/libciphers/issues
8
+ Author-email: Dario Clavijo <clavijodario@gmail.com>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Requires-Python: >=3.11
12
+ Provides-Extra: all
13
+ Requires-Dist: hatch; extra == 'all'
14
+ Requires-Dist: hypothesis; extra == 'all'
15
+ Requires-Dist: mypy; extra == 'all'
16
+ Requires-Dist: pip-api; extra == 'all'
17
+ Requires-Dist: pytest; extra == 'all'
18
+ Requires-Dist: pytest-asyncio; extra == 'all'
19
+ Requires-Dist: pytest-cov; extra == 'all'
20
+ Requires-Dist: pytest-mock; extra == 'all'
21
+ Requires-Dist: ruff; extra == 'all'
22
+ Provides-Extra: dev
23
+ Requires-Dist: hatch; extra == 'dev'
24
+ Requires-Dist: mypy; extra == 'dev'
25
+ Requires-Dist: pip-api; extra == 'dev'
26
+ Requires-Dist: ruff; extra == 'dev'
27
+ Provides-Extra: lint
28
+ Requires-Dist: mypy; extra == 'lint'
29
+ Requires-Dist: ruff; extra == 'lint'
30
+ Provides-Extra: test
31
+ Requires-Dist: hypothesis; extra == 'test'
32
+ Requires-Dist: pytest; extra == 'test'
33
+ Requires-Dist: pytest-asyncio; extra == 'test'
34
+ Requires-Dist: pytest-cov; extra == 'test'
35
+ Requires-Dist: pytest-mock; extra == 'test'
36
+ Description-Content-Type: text/markdown
37
+
38
+ # libciphers
39
+
40
+ A Python library providing implementations of classical cipher algorithms for cryptographic puzzles, CTF challenges, and educational purposes.
41
+
42
+ [![PyPI](https://img.shields.io/pypi/v/libciphers.svg)](https://pypi.org/project/libciphers/)
43
+ [![Python](https://img.shields.io/pypi/pyversions/libciphers.svg)](https://pypi.org/project/libciphers/)
44
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
45
+
46
+ ## Install
47
+
48
+ ```bash
49
+ pip install libciphers
50
+ ```
51
+
52
+ ## Usage
53
+
54
+ ```python
55
+ from libciphers import caesar_encrypt, caesar_decrypt, vigenere_encrypt, vigenere_decrypt
56
+
57
+ # Caesar cipher
58
+ plaintext = "HELLO"
59
+ encrypted = caesar_encrypt(plaintext, 5)
60
+ decrypted = caesar_decrypt(encrypted, 5)
61
+ print(f"Caesar: {encrypted} -> {decrypted}") # MJQQT -> HELLO
62
+
63
+ # Vigenère cipher
64
+ encrypted = vigenere_encrypt("HELLO", "KEY")
65
+ decrypted = vigenere_decrypt(encrypted, "KEY")
66
+ print(f"Vigenère: {encrypted} -> {decrypted}") # RIJVQ -> HELLO
67
+ ```
68
+
69
+ ## Supported Ciphers
70
+
71
+ ### Shift Ciphers
72
+ - Caesar (with brute force)
73
+ - ROT13, ROT-N
74
+ - Atbash
75
+ - Affine
76
+
77
+ ### Polyalphabetic Ciphers
78
+ - Vigenère
79
+ - Beaufort
80
+ - Variant Beaufort
81
+ - Autokey
82
+ - Running Key
83
+ - Porta
84
+ - Gronsfeld
85
+ - Quagmire variants
86
+
87
+ ### Transposition Ciphers
88
+ - Columnar
89
+ - Rail Fence
90
+ - Scytale
91
+ - Route
92
+ - Zigzag
93
+
94
+ ### Digraph Ciphers
95
+ - Playfair
96
+ - Four-Square
97
+ - Three-Square
98
+
99
+ ### Fractionated Ciphers
100
+ - Bifid
101
+ - Trifid
102
+
103
+ ### Other Ciphers
104
+ - Hill (2x2)
105
+ - Polybius Square
106
+ - Bazeries
107
+ - XOR
108
+ - Enigma (3-rotor)
109
+
110
+ ### Statistical Analysis
111
+ - Index of Coincidence
112
+ - Chi-squared
113
+ - N-gram scoring
114
+ - Kasiski examination
115
+
116
+ ## Development
117
+
118
+ ```bash
119
+ git clone https://github.com/daedalus/libciphers.git
120
+ cd libciphers
121
+ pip install -e ".[test]"
122
+
123
+ # run tests
124
+ pytest
125
+
126
+ # format
127
+ ruff format src/ tests/
128
+
129
+ # lint
130
+ ruff check src/ tests/
131
+
132
+ # type check
133
+ mypy src/
134
+ ```
@@ -0,0 +1,97 @@
1
+ # libciphers
2
+
3
+ A Python library providing implementations of classical cipher algorithms for cryptographic puzzles, CTF challenges, and educational purposes.
4
+
5
+ [![PyPI](https://img.shields.io/pypi/v/libciphers.svg)](https://pypi.org/project/libciphers/)
6
+ [![Python](https://img.shields.io/pypi/pyversions/libciphers.svg)](https://pypi.org/project/libciphers/)
7
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pip install libciphers
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```python
18
+ from libciphers import caesar_encrypt, caesar_decrypt, vigenere_encrypt, vigenere_decrypt
19
+
20
+ # Caesar cipher
21
+ plaintext = "HELLO"
22
+ encrypted = caesar_encrypt(plaintext, 5)
23
+ decrypted = caesar_decrypt(encrypted, 5)
24
+ print(f"Caesar: {encrypted} -> {decrypted}") # MJQQT -> HELLO
25
+
26
+ # Vigenère cipher
27
+ encrypted = vigenere_encrypt("HELLO", "KEY")
28
+ decrypted = vigenere_decrypt(encrypted, "KEY")
29
+ print(f"Vigenère: {encrypted} -> {decrypted}") # RIJVQ -> HELLO
30
+ ```
31
+
32
+ ## Supported Ciphers
33
+
34
+ ### Shift Ciphers
35
+ - Caesar (with brute force)
36
+ - ROT13, ROT-N
37
+ - Atbash
38
+ - Affine
39
+
40
+ ### Polyalphabetic Ciphers
41
+ - Vigenère
42
+ - Beaufort
43
+ - Variant Beaufort
44
+ - Autokey
45
+ - Running Key
46
+ - Porta
47
+ - Gronsfeld
48
+ - Quagmire variants
49
+
50
+ ### Transposition Ciphers
51
+ - Columnar
52
+ - Rail Fence
53
+ - Scytale
54
+ - Route
55
+ - Zigzag
56
+
57
+ ### Digraph Ciphers
58
+ - Playfair
59
+ - Four-Square
60
+ - Three-Square
61
+
62
+ ### Fractionated Ciphers
63
+ - Bifid
64
+ - Trifid
65
+
66
+ ### Other Ciphers
67
+ - Hill (2x2)
68
+ - Polybius Square
69
+ - Bazeries
70
+ - XOR
71
+ - Enigma (3-rotor)
72
+
73
+ ### Statistical Analysis
74
+ - Index of Coincidence
75
+ - Chi-squared
76
+ - N-gram scoring
77
+ - Kasiski examination
78
+
79
+ ## Development
80
+
81
+ ```bash
82
+ git clone https://github.com/daedalus/libciphers.git
83
+ cd libciphers
84
+ pip install -e ".[test]"
85
+
86
+ # run tests
87
+ pytest
88
+
89
+ # format
90
+ ruff format src/ tests/
91
+
92
+ # lint
93
+ ruff check src/ tests/
94
+
95
+ # type check
96
+ mypy src/
97
+ ```
@@ -0,0 +1,86 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "libciphers"
7
+ version = "0.1.0"
8
+ description = "A Python library providing implementations of classical cipher algorithms"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ {name = "Dario Clavijo", email = "clavijodario@gmail.com"}
14
+ ]
15
+ dependencies = []
16
+
17
+ [project.optional-dependencies]
18
+ dev = [
19
+ "ruff",
20
+ "mypy",
21
+ "hatch",
22
+ "pip-api",
23
+ ]
24
+ test = [
25
+ "pytest",
26
+ "pytest-cov",
27
+ "pytest-mock",
28
+ "pytest-asyncio",
29
+ "hypothesis",
30
+ ]
31
+ lint = [
32
+ "ruff",
33
+ "mypy",
34
+ ]
35
+ all = ["libciphers[dev,test,lint]"]
36
+
37
+ [project.urls]
38
+ Homepage = "https://github.com/daedalus/libciphers"
39
+ Repository = "https://github.com/daedalus/libciphers"
40
+ Issues = "https://github.com/daedalus/libciphers/issues"
41
+
42
+ [tool.hatch.build.targets.wheel]
43
+ packages = ["src/libciphers"]
44
+
45
+ [tool.hatch.build.targets.sdist]
46
+ include = ["src/libciphers"]
47
+
48
+ [tool.ruff]
49
+ line-length = 88
50
+ target-version = "py311"
51
+
52
+ [tool.ruff.lint]
53
+ select = ["E", "F", "W", "I", "UP", "ANN", "TCH", "N", "C4", "ARG"]
54
+ ignore = ["E501"]
55
+
56
+ [tool.ruff.lint.per-file-ignores]
57
+ "__init__.py" = ["F401"]
58
+
59
+ [tool.ruff.lint.pydocstyle]
60
+ convention = "google"
61
+
62
+ [tool.mypy]
63
+ python_version = "3.11"
64
+ strict = true
65
+ warn_return_any = true
66
+ warn_unused_ignores = true
67
+
68
+ [tool.pytest.ini_options]
69
+ testpaths = ["tests"]
70
+ addopts = "-v --tb=short --cov=src --cov-fail-under=10"
71
+ filterwarnings = ["ignore::DeprecationWarning"]
72
+
73
+ [tool.coverage.run]
74
+ source = ["src"]
75
+ branch = true
76
+
77
+ [tool.coverage.report]
78
+ exclude = ["tests/*", "*/__init__.py"]
79
+ exclude_lines = [
80
+ "pragma: no cover",
81
+ "def __repr__",
82
+ "raise AssertionError",
83
+ "raise NotImplementedError",
84
+ "if __name__ == .__main__.:",
85
+ "if TYPE_CHECKING:",
86
+ ]