codext 1.16.5__tar.gz → 2.0.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.
- codext-2.0.0/.github/dependabot.yml +15 -0
- codext-2.0.0/.github/workflows/python-package.yml +141 -0
- codext-2.0.0/.github/workflows/security.yml +31 -0
- codext-1.16.5/.readthedocs.yml → codext-2.0.0/.readthedocs.yaml +2 -2
- {codext-1.16.5 → codext-2.0.0}/PKG-INFO +45 -18
- {codext-1.16.5 → codext-2.0.0}/README.md +43 -16
- codext-2.0.0/SECURITY.md +17 -0
- {codext-1.16.5 → codext-2.0.0}/docs/mkdocs.yml +24 -8
- codext-2.0.0/docs/pages/contributing.md +32 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/enc/base.md +63 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/enc/binary.md +67 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/enc/common.md +2 -2
- {codext-1.16.5 → codext-2.0.0}/docs/pages/enc/compressions.md +33 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/enc/crypto.md +204 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/enc/hashing.md +1 -1
- codext-2.0.0/docs/pages/enc/others.md +135 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/enc/stegano.md +50 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/guessing.md +3 -3
- {codext-1.16.5 → codext-2.0.0}/docs/pages/howto.md +4 -4
- {codext-1.16.5 → codext-2.0.0}/docs/pages/index.md +2 -2
- {codext-1.16.5 → codext-2.0.0}/docs/pages/manipulations.md +2 -2
- codext-2.0.0/docs/requirements.txt +6 -0
- {codext-1.16.5 → codext-2.0.0}/pyproject.toml +38 -2
- codext-2.0.0/src/codext/VERSION.txt +1 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/__common__.py +181 -86
- codext-2.0.0/src/codext/__init__.py +30 -0
- codext-1.16.5/src/codext/__init__.py → codext-2.0.0/src/codext/__main__.py +8 -29
- {codext-1.16.5 → codext-2.0.0}/src/codext/base/__init__.py +5 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/base/_base.py +8 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/base/_base2n.py +4 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/base/base100.py +7 -1
- codext-2.0.0/src/codext/base/base1024.py +177 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/base/base122.py +8 -0
- codext-2.0.0/src/codext/base/base38.py +62 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/base/base45.py +7 -0
- codext-2.0.0/src/codext/base/base65536.py +158 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/base/base85.py +13 -1
- {codext-1.16.5 → codext-2.0.0}/src/codext/base/base91.py +7 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/base/baseN.py +15 -0
- codext-2.0.0/src/codext/base/bech32.py +119 -0
- codext-2.0.0/src/codext/base/leb128.py +73 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/binary/__init__.py +3 -0
- codext-2.0.0/src/codext/binary/_universal.py +57 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/binary/baudot.py +12 -1
- {codext-1.16.5 → codext-2.0.0}/src/codext/binary/bcd.py +7 -0
- codext-2.0.0/src/codext/binary/chucknorris.py +59 -0
- codext-2.0.0/src/codext/binary/elias.py +78 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/binary/excess3.py +7 -0
- codext-2.0.0/src/codext/binary/fibonacci.py +65 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/binary/gray.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/binary/manchester.py +8 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/binary/rotate.py +11 -7
- codext-2.0.0/src/codext/checksums/adler.py +21 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/checksums/crc.py +9 -1
- {codext-1.16.5 → codext-2.0.0}/src/codext/checksums/luhn.py +8 -1
- {codext-1.16.5 → codext-2.0.0}/src/codext/common/a1z26.py +7 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/common/cases.py +6 -1
- {codext-1.16.5 → codext-2.0.0}/src/codext/common/dummy.py +6 -1
- {codext-1.16.5 → codext-2.0.0}/src/codext/common/octal.py +3 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/common/ordinal.py +3 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/compressions/__init__.py +1 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/compressions/gzipp.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/compressions/lz77.py +7 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/compressions/lz78.py +7 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/compressions/pkzip.py +6 -0
- codext-2.0.0/src/codext/compressions/rle.py +116 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/__init__.py +8 -0
- codext-2.0.0/src/codext/crypto/adfgx.py +124 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/affine.py +5 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/atbash.py +5 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/bacon.py +5 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/barbie.py +4 -2
- codext-2.0.0/src/codext/crypto/bazeries.py +132 -0
- codext-2.0.0/src/codext/crypto/bifid.py +87 -0
- codext-2.0.0/src/codext/crypto/chaocipher.py +77 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/citrix.py +4 -2
- codext-2.0.0/src/codext/crypto/columnar.py +80 -0
- codext-2.0.0/src/codext/crypto/hill.py +110 -0
- codext-2.0.0/src/codext/crypto/nihilist.py +86 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/playfair.py +30 -16
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/polybius.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/railfence.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/rot.py +8 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/scytale.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/shift.py +3 -0
- codext-2.0.0/src/codext/crypto/skip.py +59 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/vic.py +9 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/vigenere.py +54 -3
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/xor.py +3 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/hashing/blake.py +7 -1
- {codext-1.16.5 → codext-2.0.0}/src/codext/hashing/crypt.py +7 -1
- {codext-1.16.5 → codext-2.0.0}/src/codext/hashing/md.py +8 -1
- {codext-1.16.5 → codext-2.0.0}/src/codext/hashing/mmh3.py +6 -1
- {codext-1.16.5 → codext-2.0.0}/src/codext/hashing/sha.py +7 -1
- {codext-1.16.5 → codext-2.0.0}/src/codext/hashing/shake.py +5 -1
- {codext-1.16.5 → codext-2.0.0}/src/codext/languages/braille.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/languages/galactic.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/languages/ipsum.py +8 -1
- {codext-1.16.5 → codext-2.0.0}/src/codext/languages/leetspeak.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/languages/morse.py +7 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/languages/navajo.py +7 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/languages/radio.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/languages/southpark.py +7 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/languages/tap.py +7 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/languages/tomtom.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/others/__init__.py +3 -0
- codext-2.0.0/src/codext/others/binhex.py +125 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/others/dna.py +4 -2
- {codext-1.16.5 → codext-2.0.0}/src/codext/others/kbshift.py +5 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/others/letters.py +5 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/others/markdown.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/others/uuencode.py +8 -0
- codext-2.0.0/src/codext/others/xxencode.py +83 -0
- codext-2.0.0/src/codext/others/yenc.py +121 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/stegano/__init__.py +2 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/stegano/hexagram.py +7 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/stegano/klopf.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/stegano/resistor.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/stegano/rick.py +4 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/stegano/sms.py +6 -0
- codext-2.0.0/src/codext/stegano/tags.py +62 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/stegano/whitespace.py +8 -0
- codext-2.0.0/src/codext/stegano/zerowidth.py +112 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/web/html.py +8 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/web/url.py +6 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext.egg-info/PKG-INFO +45 -18
- {codext-1.16.5 → codext-2.0.0}/src/codext.egg-info/SOURCES.txt +29 -3
- {codext-1.16.5 → codext-2.0.0}/src/codext.egg-info/entry_points.txt +6 -1
- {codext-1.16.5 → codext-2.0.0}/tests/test_base.py +10 -0
- {codext-1.16.5 → codext-2.0.0}/tests/test_generated.py +3 -8
- {codext-1.16.5 → codext-2.0.0}/tests/test_manual.py +42 -0
- codext-1.16.5/.coveragerc +0 -24
- codext-1.16.5/.github/workflows/python-package.yml +0 -128
- codext-1.16.5/docs/pages/enc/others.md +0 -79
- codext-1.16.5/docs/requirements.txt +0 -5
- codext-1.16.5/pytest.ini +0 -2
- codext-1.16.5/src/codext/VERSION.txt +0 -1
- codext-1.16.5/src/codext/checksums/adler.py +0 -17
- {codext-1.16.5 → codext-2.0.0}/.github/ISSUE_TEMPLATE/add-encoding.yml +0 -0
- {codext-1.16.5 → codext-2.0.0}/.github/copilot-instructions.md +0 -0
- {codext-1.16.5 → codext-2.0.0}/.github/prompts/add_codec.prompt.md +0 -0
- {codext-1.16.5 → codext-2.0.0}/.github/pull_request_template.md +0 -0
- {codext-1.16.5 → codext-2.0.0}/.gitignore +0 -0
- {codext-1.16.5 → codext-2.0.0}/LICENSE +0 -0
- {codext-1.16.5 → codext-2.0.0}/docs/coverage.svg +0 -0
- {codext-1.16.5 → codext-2.0.0}/docs/hakin9-codext.pdf +0 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/cli.md +0 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/css/extra.css +0 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/demos/using-bases.gif +0 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/demos/using-codext.gif +0 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/demos/using-debase.gif +0 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/enc/languages.md +0 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/enc/web.md +0 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/features.md +0 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/img/banner.png +0 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/img/icon.png +0 -0
- {codext-1.16.5 → codext-2.0.0}/docs/pages/img/logo.png +0 -0
- {codext-1.16.5 → codext-2.0.0}/requirements.txt +0 -0
- {codext-1.16.5 → codext-2.0.0}/setup.cfg +0 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/__info__.py +0 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/checksums/__init__.py +0 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/common/__init__.py +0 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/crypto/phillips.py +0 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/hashing/__init__.py +0 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/languages/__init__.py +0 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/macros.json +0 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext/web/__init__.py +0 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext.egg-info/dependency_links.txt +0 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext.egg-info/requires.txt +0 -0
- {codext-1.16.5 → codext-2.0.0}/src/codext.egg-info/top_level.txt +0 -0
- {codext-1.16.5 → codext-2.0.0}/tests/__init__.py +0 -0
- {codext-1.16.5 → codext-2.0.0}/tests/test_common.py +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: github-actions
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: monthly
|
|
7
|
+
groups:
|
|
8
|
+
actions:
|
|
9
|
+
patterns: ["*"]
|
|
10
|
+
- package-ecosystem: pip
|
|
11
|
+
directory: /
|
|
12
|
+
schedule:
|
|
13
|
+
interval: monthly
|
|
14
|
+
# dependencies are minimum versions (>=) ; only open security updates, not routine upgrades
|
|
15
|
+
open-pull-requests-limit: 0
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
|
3
|
+
|
|
4
|
+
name: build
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [ "main" ]
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [ "main" ]
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
prepare:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
outputs:
|
|
19
|
+
package: ${{ steps.pkg.outputs.package }}
|
|
20
|
+
pypi_url: ${{ steps.pkg.outputs.pypi_url }}
|
|
21
|
+
steps:
|
|
22
|
+
- name: Compute package name from the repository's
|
|
23
|
+
id: pkg
|
|
24
|
+
run: |
|
|
25
|
+
name="${GITHUB_REPOSITORY##*/}"
|
|
26
|
+
echo "package=${name#python-}" >> $GITHUB_OUTPUT
|
|
27
|
+
echo "pypi_url=https://pypi.org/p/${name#python-}" >> $GITHUB_OUTPUT
|
|
28
|
+
build:
|
|
29
|
+
needs: prepare
|
|
30
|
+
runs-on: ${{ matrix.os }}
|
|
31
|
+
strategy:
|
|
32
|
+
fail-fast: false
|
|
33
|
+
matrix:
|
|
34
|
+
os: [ubuntu-latest]
|
|
35
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
36
|
+
env:
|
|
37
|
+
package: ${{ needs.prepare.outputs.package }}
|
|
38
|
+
cov_python_version: "3.13"
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v7
|
|
41
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
42
|
+
uses: actions/setup-python@v7
|
|
43
|
+
with:
|
|
44
|
+
python-version: ${{ matrix.python-version }}
|
|
45
|
+
- name: Install ${{ env.package }}
|
|
46
|
+
run: |
|
|
47
|
+
python -m pip install --upgrade pip
|
|
48
|
+
python -m pip install pytest pytest-cov
|
|
49
|
+
pip install -r requirements.txt
|
|
50
|
+
pip install "tinyscript>=1.31"
|
|
51
|
+
pip install .
|
|
52
|
+
- name: Test ${{ env.package }} with pytest
|
|
53
|
+
run: |
|
|
54
|
+
pytest --cov=$package --cov-report=xml
|
|
55
|
+
- name: Upload coverage report
|
|
56
|
+
if: matrix.python-version == env.cov_python_version
|
|
57
|
+
uses: actions/upload-artifact@v7
|
|
58
|
+
with:
|
|
59
|
+
name: coverage-report
|
|
60
|
+
path: coverage.xml
|
|
61
|
+
coverage:
|
|
62
|
+
# only publish the badge for commits on main (not for pull requests)
|
|
63
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
64
|
+
needs: build
|
|
65
|
+
permissions:
|
|
66
|
+
contents: write
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
env:
|
|
69
|
+
cov_badge_path: docs/coverage.svg
|
|
70
|
+
steps:
|
|
71
|
+
- uses: actions/checkout@v7
|
|
72
|
+
- name: Set up Python
|
|
73
|
+
uses: actions/setup-python@v7
|
|
74
|
+
with:
|
|
75
|
+
python-version: "3.13"
|
|
76
|
+
- name: Download coverage report
|
|
77
|
+
uses: actions/download-artifact@v8
|
|
78
|
+
with:
|
|
79
|
+
name: coverage-report
|
|
80
|
+
- name: Make coverage badge
|
|
81
|
+
run: |
|
|
82
|
+
pip install genbadge[coverage]
|
|
83
|
+
genbadge coverage -i coverage.xml -o $cov_badge_path
|
|
84
|
+
- name: Push coverage badge
|
|
85
|
+
run: |
|
|
86
|
+
# keep the badge alone on an orphan branch so that main is never modified by the workflow
|
|
87
|
+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
88
|
+
git config --local user.name "github-actions[bot]"
|
|
89
|
+
if git fetch --depth=1 origin coverage-badge 2>/dev/null && \
|
|
90
|
+
git show FETCH_HEAD:$cov_badge_path | cmp -s - $cov_badge_path; then
|
|
91
|
+
echo "Coverage badge unchanged"
|
|
92
|
+
exit 0
|
|
93
|
+
fi
|
|
94
|
+
git checkout --orphan coverage-badge
|
|
95
|
+
git rm -rqf --cached .
|
|
96
|
+
git add $cov_badge_path
|
|
97
|
+
git commit -m "Update coverage badge"
|
|
98
|
+
git push origin coverage-badge --force
|
|
99
|
+
deploy:
|
|
100
|
+
# only release from main, never from pull requests
|
|
101
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
102
|
+
environment:
|
|
103
|
+
name: pypi
|
|
104
|
+
url: ${{ needs.prepare.outputs.pypi_url }}
|
|
105
|
+
permissions:
|
|
106
|
+
contents: read
|
|
107
|
+
id-token: write # for PyPI trusted publishing (OIDC)
|
|
108
|
+
runs-on: ubuntu-latest
|
|
109
|
+
needs: [prepare, build]
|
|
110
|
+
env:
|
|
111
|
+
package: ${{ needs.prepare.outputs.package }}
|
|
112
|
+
steps:
|
|
113
|
+
- uses: actions/checkout@v7
|
|
114
|
+
- name: Check whether the version is already on PyPI
|
|
115
|
+
# comparing with PyPI (not with the previous commit) also releases a version whose push did not trigger a deploy
|
|
116
|
+
id: version
|
|
117
|
+
run: |
|
|
118
|
+
version=$(tr -d '[:space:]' < src/$package/VERSION.txt)
|
|
119
|
+
status=$(curl -s -o /dev/null -w '%{http_code}' --retry 3 "https://pypi.org/pypi/$package/$version/json")
|
|
120
|
+
case "$status" in
|
|
121
|
+
200) echo "Version $version is already on PyPI" ; echo "new=false" >> "$GITHUB_OUTPUT" ;;
|
|
122
|
+
404) echo "Version $version is not on PyPI yet" ; echo "new=true" >> "$GITHUB_OUTPUT" ;;
|
|
123
|
+
*) echo "::error::Unexpected HTTP status $status from PyPI" ; exit 1 ;;
|
|
124
|
+
esac
|
|
125
|
+
- if: steps.version.outputs.new == 'true'
|
|
126
|
+
name: Set up Python
|
|
127
|
+
uses: actions/setup-python@v7
|
|
128
|
+
with:
|
|
129
|
+
python-version: "3.13"
|
|
130
|
+
- if: steps.version.outputs.new == 'true'
|
|
131
|
+
name: Cleanup README
|
|
132
|
+
run: |
|
|
133
|
+
sed -ri 's/^(##*)\s*:.*:\s*/\1 /g' README.md
|
|
134
|
+
awk '{if (match($0,"## Supporters")) exit; print}' README.md > README
|
|
135
|
+
mv -f README README.md
|
|
136
|
+
- if: steps.version.outputs.new == 'true'
|
|
137
|
+
name: Build ${{ needs.prepare.outputs.package }} package
|
|
138
|
+
run: python -m pip install --upgrade build && python -m build
|
|
139
|
+
- if: steps.version.outputs.new == 'true'
|
|
140
|
+
name: Publish to PyPI
|
|
141
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This workflow audits the project's dependencies for known vulnerabilities
|
|
2
|
+
# It is separate from python-package.yml so that a new advisory never blocks a release
|
|
3
|
+
|
|
4
|
+
name: security
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [ "main" ]
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [ "main" ]
|
|
11
|
+
schedule:
|
|
12
|
+
- cron: "0 6 * * 1" # weekly, catches new advisories between pushes
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
pip-audit:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v7
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v7
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.13"
|
|
27
|
+
- name: Install pip-audit
|
|
28
|
+
run: python -m pip install --upgrade pip pip-audit
|
|
29
|
+
- name: Audit dependencies
|
|
30
|
+
# audit the project path (not the environment) so that the runner's own packages are not reported
|
|
31
|
+
run: pip-audit .
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codext
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: Native codecs extension
|
|
5
5
|
Author-email: Alexandre D'Hondt <alexandre.dhondt@gmail.com>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -689,7 +689,7 @@ Classifier: Intended Audience :: Developers
|
|
|
689
689
|
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
690
690
|
Classifier: Programming Language :: Python :: 3
|
|
691
691
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
692
|
-
Requires-Python: <4,>=3.
|
|
692
|
+
Requires-Python: <4,>=3.10
|
|
693
693
|
Description-Content-Type: text/markdown
|
|
694
694
|
License-File: LICENSE
|
|
695
695
|
Requires-Dist: legacycrypt; python_version >= "3.13"
|
|
@@ -701,15 +701,15 @@ Dynamic: license-file
|
|
|
701
701
|
<h3 align="center">Encode/decode anything.</h3>
|
|
702
702
|
|
|
703
703
|
[](https://pypi.python.org/pypi/codext/)
|
|
704
|
+
[](https://pypi.python.org/pypi/codext/)
|
|
704
705
|
[](https://python-codext.readthedocs.io/en/latest/?badge=latest)
|
|
705
706
|
[](https://github.com/dhondta/python-codext/actions/workflows/python-package.yml)
|
|
707
|
+
[](https://github.com/dhondta/python-codext/actions/workflows/security.yml)
|
|
706
708
|
[](#)
|
|
707
|
-
[](https://pypi.python.org/pypi/codext/)
|
|
708
|
-
[](https://snyk.io/test/github/dhondta/python-codext?targetFile=requirements.txt)
|
|
709
709
|
[](https://zenodo.org/badge/latestdoi/236679865)
|
|
710
710
|
[](https://pypi.python.org/pypi/codext/)
|
|
711
711
|
|
|
712
|
-
[**CodExt**](https://github.com/dhondta/python-codext) is a (
|
|
712
|
+
[**CodExt**](https://github.com/dhondta/python-codext) is a library (Python 3.10 or later) that extends the native [`codecs`](https://docs.python.org/3/library/codecs) library (namely for adding new custom encodings and character mappings) and provides **120+ new codecs**, hence its name combining *CODecs EXTension*. It also features a **guess mode** for decoding multiple layers of encoding and **CLI tools** for convenience.
|
|
713
713
|
|
|
714
714
|
```sh
|
|
715
715
|
$ pip install codext
|
|
@@ -717,7 +717,7 @@ $ pip install codext
|
|
|
717
717
|
|
|
718
718
|
Want to contribute a new codec ? | Want to contribute a new macro ?
|
|
719
719
|
:----------------------------------:|:------------------------------------:
|
|
720
|
-
Check the [documentation](https://python-codext.readthedocs.io/en/latest/howto) first<br>Then [PR](https://github.com/dhondta/python-codext/pulls) your new codec | [PR](https://github.com/dhondta/python-codext/pulls) your updated version of [`macros.json`](https://github.com/dhondta/python-codext/blob/main/codext/macros.json)
|
|
720
|
+
Check the [documentation](https://python-codext.readthedocs.io/en/latest/howto.html) first<br>Then [PR](https://github.com/dhondta/python-codext/pulls) your new codec | [PR](https://github.com/dhondta/python-codext/pulls) your updated version of [`macros.json`](https://github.com/dhondta/python-codext/blob/main/src/codext/macros.json)
|
|
721
721
|
|
|
722
722
|
## Demonstrations
|
|
723
723
|
|
|
@@ -957,7 +957,7 @@ CACTCGGTCGGCCATATGTTCGGCCATATGTTCGTCTGTTCACTCGCCCATACACT
|
|
|
957
957
|
|
|
958
958
|
## List of codecs
|
|
959
959
|
|
|
960
|
-
#### [BaseXX](https://python-codext.readthedocs.io/en/latest/enc/base)
|
|
960
|
+
#### [BaseXX](https://python-codext.readthedocs.io/en/latest/enc/base.html)
|
|
961
961
|
|
|
962
962
|
- [X] `base1`: useless, but for the sake of completeness
|
|
963
963
|
- [X] `base2`: simple conversion to binary (with a variant with a reversed alphabet)
|
|
@@ -970,6 +970,7 @@ CACTCGGTCGGCCATATGTTCGGCCATATGTTCGTCTGTTCACTCGCCCATACACT
|
|
|
970
970
|
- [X] `base26`: conversion to alphabet letters
|
|
971
971
|
- [X] `base32`: classical conversion according to the RFC4648 with all its variants ([zbase32](https://philzimmermann.com/docs/human-oriented-base-32-encoding.txt), extended hexadecimal, [geohash](https://en.wikipedia.org/wiki/Geohash), [Crockford](https://www.crockford.com/base32))
|
|
972
972
|
- [X] `base36`: [Base36](https://en.wikipedia.org/wiki/Base36) conversion to letters and digits (with a variant inverting both groups)
|
|
973
|
+
- [X] `base38`: [Base38](https://github.com/project-chip/connectedhomeip/blob/master/src/setup_payload/Base38Encode.cpp) encoding of the Matter setup QR codes (chunks of 3 bytes)
|
|
973
974
|
- [X] `base45`: [Base45](https://datatracker.ietf.org/doc/html/draft-faltstrom-base45-04.txt) DRAFT algorithm (with a variant inverting letters and digits)
|
|
974
975
|
- [X] `base58`: multiple versions of [Base58](https://en.bitcoinwiki.org/wiki/Base58) (bitcoin, flickr, ripple)
|
|
975
976
|
- [X] `base62`: [Base62](https://en.wikipedia.org/wiki/Base62) conversion to lower- and uppercase letters and digits (with a variant with letters and digits inverted)
|
|
@@ -980,11 +981,17 @@ CACTCGGTCGGCCATATGTTCGGCCATATGTTCGTCTGTTCACTCGCCCATACACT
|
|
|
980
981
|
- [X] `base91`: [Base91](http://base91.sourceforge.net) custom conversion
|
|
981
982
|
- [X] `base100` (or *emoji*): [Base100](https://github.com/AdamNiederer/base100) custom conversion
|
|
982
983
|
- [X] `base122`: [Base100](http://blog.kevinalbs.com/base122) custom conversion
|
|
983
|
-
- [X] `
|
|
984
|
+
- [X] `base1024` (or *ecoji*): [Ecoji](https://github.com/keith-turner/ecoji) custom conversion (10 bits per emoji, versions 1 and 2)
|
|
985
|
+
- [X] `base2048`: [Base2048](https://github.com/qntm/base2048) custom conversion (11 bits per character, optimised for Twitter)
|
|
986
|
+
- [X] `base32768`: [Base32768](https://github.com/qntm/base32768) custom conversion (15 bits per character, optimised for UTF-16)
|
|
987
|
+
- [X] `base65536`: [Base65536](https://github.com/qntm/base65536) custom conversion (16 bits per character, optimised for UTF-32)
|
|
988
|
+
- [X] `bech32`: [Bech32](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) encoding with a human-readable part ; `bech32m` for its [Bech32m](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki) variant
|
|
989
|
+
- [X] `leb128` (or *varint*): [LEB128](https://en.wikipedia.org/wiki/LEB128) encoding of lists of integers ; `sleb128` for its signed variant
|
|
990
|
+
- [X] `base-genericN`: see [base encodings](https://python-codext.readthedocs.io/en/latest/enc/base.html) ; supports any possible base
|
|
984
991
|
|
|
985
992
|
This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `base85` codec.
|
|
986
993
|
|
|
987
|
-
#### [Binary](https://python-codext.readthedocs.io/en/latest/enc/binary)
|
|
994
|
+
#### [Binary](https://python-codext.readthedocs.io/en/latest/enc/binary.html)
|
|
988
995
|
|
|
989
996
|
- [X] `baudot`: supports CCITT-1, CCITT-2, EU/FR, ITA1, ITA2, MTK-2 (Python3 only), UK, ...
|
|
990
997
|
- [X] `baudot-spaced`: variant of `baudot` ; groups of 5 bits are whitespace-separated
|
|
@@ -992,19 +999,22 @@ This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `ba
|
|
|
992
999
|
- [X] `bcd`: _Binary Coded Decimal_, encodes characters from their (zero-left-padded) ordinals
|
|
993
1000
|
- [X] `bcd-extended0`: variant of `bcd` ; encodes characters from their (zero-left-padded) ordinals using prefix bits `0000`
|
|
994
1001
|
- [X] `bcd-extended1`: variant of `bcd` ; encodes characters from their (zero-left-padded) ordinals using prefix bits `1111`
|
|
1002
|
+
- [X] `chuck-norris`: Chuck Norris unary code (runs of the 7-bit ASCII bits written with blocks of zeros)
|
|
1003
|
+
- [X] `elias-gamma`, `elias-delta`: Elias universal codes, encoding characters from their ordinals (or lists of integers with `-integers`)
|
|
995
1004
|
- [X] `excess3`: uses Excess-3 (aka Stibitz code) binary encoding to convert characters from their ordinals
|
|
1005
|
+
- [X] `fibonacci`: Fibonacci universal code, encoding characters from their ordinals (or lists of integers with `-integers`)
|
|
996
1006
|
- [X] `gray`: aka reflected binary code
|
|
997
1007
|
- [X] `manchester`: XORes each bit of the input with `01`
|
|
998
1008
|
- [X] `manchester-inverted`: variant of `manchester` ; XORes each bit of the input with `10`
|
|
999
1009
|
- [X] `rotateN`: rotates characters by the specified number of bits (*N* belongs to [1, 7] ; Python 3 only)
|
|
1000
1010
|
|
|
1001
|
-
#### [Checksums](https://python-codext.readthedocs.io/en/latest/enc/checksums)
|
|
1011
|
+
#### [Checksums](https://python-codext.readthedocs.io/en/latest/enc/hashing.html#checksums)
|
|
1002
1012
|
|
|
1003
1013
|
- [X] `adler`: Adler32 algorithm (relies on `zlib`)
|
|
1004
1014
|
- [X] `crc`: CRC of lengths 8, 10-17, 21, 24, 30-32, 40, 64, 82 with a variety of polynoms
|
|
1005
1015
|
- [X] `luhn`: Luhn mod N algorithm
|
|
1006
1016
|
|
|
1007
|
-
#### [Common](https://python-codext.readthedocs.io/en/latest/enc/common)
|
|
1017
|
+
#### [Common](https://python-codext.readthedocs.io/en/latest/enc/common.html)
|
|
1008
1018
|
|
|
1009
1019
|
- [X] `a1z26`: keeps words whitespace-separated and uses a custom character separator
|
|
1010
1020
|
- [X] `cases`: set of case-related encodings (including camel-, kebab-, lower-, pascal-, upper-, snake- and swap-case, slugify, capitalize, title)
|
|
@@ -1014,7 +1024,7 @@ This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `ba
|
|
|
1014
1024
|
- [X] `ordinal`: dummy character ordinals conversion (converts to 3-digits groups)
|
|
1015
1025
|
- [X] `ordinal-spaced`: variant of `ordinal` ; dummy character ordinals conversion, handling whitespace separators
|
|
1016
1026
|
|
|
1017
|
-
#### [Compression](https://python-codext.readthedocs.io/en/latest/enc/compressions)
|
|
1027
|
+
#### [Compression](https://python-codext.readthedocs.io/en/latest/enc/compressions.html)
|
|
1018
1028
|
|
|
1019
1029
|
- [X] `gzip`: standard Gzip compression/decompression
|
|
1020
1030
|
- [X] `lz77`: compresses the given data with the algorithm of Lempel and Ziv of 1977
|
|
@@ -1022,25 +1032,36 @@ This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `ba
|
|
|
1022
1032
|
- [X] `pkzip_deflate`: standard Zip-deflate compression/decompression
|
|
1023
1033
|
- [X] `pkzip_bzip2`: standard BZip2 compression/decompression
|
|
1024
1034
|
- [X] `pkzip_lzma`: standard LZMA compression/decompression
|
|
1035
|
+
- [X] `rle`: compresses runs of identical characters with Run-Length Encoding (count before or after each character, compact, bytes or repeated-byte escape variants)
|
|
1025
1036
|
|
|
1026
1037
|
> :warning: Compression functions are of course definitely **NOT** encoding functions ; they are implemented for leveraging the `.encode(...)` API from `codecs`.
|
|
1027
1038
|
|
|
1028
|
-
#### [Cryptography](https://python-codext.readthedocs.io/en/latest/enc/crypto)
|
|
1039
|
+
#### [Cryptography](https://python-codext.readthedocs.io/en/latest/enc/crypto.html)
|
|
1029
1040
|
|
|
1041
|
+
- [X] `adfgx`: aka ADFGX Cipher (Polybius square and columnar transposition) ; `adfgvx` for its 6x6 variant
|
|
1030
1042
|
- [X] `affine`: aka Affine Cipher
|
|
1031
1043
|
- [X] `atbash`: aka Atbash Cipher
|
|
1032
1044
|
- [X] `autoclave`: aka Autoclave/Autokey Cipher (variant of Vigenere Cipher)
|
|
1033
1045
|
- [X] `bacon`: aka Baconian Cipher
|
|
1034
1046
|
- [X] `barbie-N`: aka Barbie Typewriter (*N* belongs to [1, 4])
|
|
1047
|
+
- [X] `bazeries`: aka Bazeries Cipher (two Polybius grids and a transposition keyed by a number)
|
|
1035
1048
|
- [X] `beaufort`: aka Beaufort Cipher (variant of Vigenere Cipher)
|
|
1049
|
+
- [X] `bifid`: aka Bifid Cipher (Delastelle's fractionation with a 5x5 Polybius square) ; `trifid` for its 3x3x3 cube variant
|
|
1050
|
+
- [X] `chaocipher`: aka Chaocipher (two alphabets permuted after each letter)
|
|
1036
1051
|
- [X] `citrix`: aka Citrix CTX1 password encoding
|
|
1052
|
+
- [X] `columnar`: aka Columnar Transposition Cipher (keyword-ordered columns ; a second keyword gives the double transposition)
|
|
1053
|
+
- [X] `gronsfeld`: aka Gronsfeld Cipher (variant of Vigenere Cipher with a numeric key)
|
|
1054
|
+
- [X] `hill`: aka Hill Cipher (blocks of letters multiplied by a key matrix modulo 26)
|
|
1055
|
+
- [X] `nihilist`: aka Nihilist Cipher (sums of the Polybius coordinates of the text and of a repeated key)
|
|
1037
1056
|
- [X] `playfair`: aka Playfair Cipher
|
|
1038
1057
|
- [X] `phillips`: aka Phillips Cipher (polyalphabetic block cipher with 8 key squares)
|
|
1039
1058
|
- [X] `polybius`: aka Polybius Square Cipher
|
|
1059
|
+
- [X] `porta`: aka Porta Cipher (reciprocal variant of Vigenere Cipher with 13 alphabets)
|
|
1040
1060
|
- [X] `railfence`: aka Rail Fence Cipher
|
|
1041
1061
|
- [X] `rotN`: aka Caesar cipher (*N* belongs to [1,25])
|
|
1042
1062
|
- [X] `scytaleN`: encrypts using the number of letters on the rod (*N* belongs to [1,[)
|
|
1043
1063
|
- [X] `shiftN`: shift ordinals (*N* belongs to [1,255])
|
|
1064
|
+
- [X] `skip`: aka Skip Cipher (transposition reading every N-th character, looping on the text)
|
|
1044
1065
|
- [X] `trithemius`: aka Trithemius Cipher (variant of Vigenere Cipher)
|
|
1045
1066
|
- [X] `vic`: aka VIC Cipher
|
|
1046
1067
|
- [X] `vigenere`: aka Vigenere Cipher
|
|
@@ -1048,7 +1069,7 @@ This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `ba
|
|
|
1048
1069
|
|
|
1049
1070
|
> :warning: Crypto functions are of course definitely **NOT** encoding functions ; they are implemented for leveraging the `.encode(...)` API from `codecs`.
|
|
1050
1071
|
|
|
1051
|
-
#### [Hashing](https://python-codext.readthedocs.io/en/latest/enc/hashing)
|
|
1072
|
+
#### [Hashing](https://python-codext.readthedocs.io/en/latest/enc/hashing.html)
|
|
1052
1073
|
|
|
1053
1074
|
- [X] `blake`: includes BLAKE2b and BLAKE2s (Python 3 only ; relies on `hashlib`)
|
|
1054
1075
|
- [X] `crypt`: Unix's crypt hash for passwords (Python 3 and Unix only ; relies on `crypt`)
|
|
@@ -1058,7 +1079,7 @@ This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `ba
|
|
|
1058
1079
|
|
|
1059
1080
|
> :warning: Hash functions are of course definitely **NOT** encoding functions ; they are implemented for convenience with the `.encode(...)` API from `codecs` and useful for chaning codecs.
|
|
1060
1081
|
|
|
1061
|
-
#### [Languages](https://python-codext.readthedocs.io/en/latest/enc/languages)
|
|
1082
|
+
#### [Languages](https://python-codext.readthedocs.io/en/latest/enc/languages.html)
|
|
1062
1083
|
|
|
1063
1084
|
- [X] `braille`: well-known braille language (Python 3 only)
|
|
1064
1085
|
- [X] `ipsum`: aka lorem ipsum
|
|
@@ -1072,25 +1093,31 @@ This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `ba
|
|
|
1072
1093
|
- [X] `tap`: converts text to tap/knock code, commonly used by prisoners
|
|
1073
1094
|
- [X] `tomtom`: similar to `morse`, using slashes and backslashes
|
|
1074
1095
|
|
|
1075
|
-
#### [Others](https://python-codext.readthedocs.io/en/latest/enc/others)
|
|
1096
|
+
#### [Others](https://python-codext.readthedocs.io/en/latest/enc/others.html)
|
|
1076
1097
|
|
|
1098
|
+
- [X] `binhex`: BinHex 4.0 (`.hqx`), the binary-to-text encoding of the classic Mac OS
|
|
1077
1099
|
- [X] `dna`: implements the 8 rules of DNA sequences (N belongs to [1,8])
|
|
1078
1100
|
- [X] `letter-indices`: encodes consonants and/or vowels with their corresponding indices
|
|
1079
1101
|
- [X] `markdown`: unidirectional encoding from Markdown to HTML
|
|
1102
|
+
- [X] `xx`: XXencode, a UUencode variant with an alphanumeric alphabet (`+`, `-`, digits and letters)
|
|
1103
|
+
- [X] `yenc`: Usenet binary-to-text encoding (raw, wrapped or framed with header, trailer and CRC32)
|
|
1080
1104
|
|
|
1081
|
-
#### [Steganography](https://python-codext.readthedocs.io/en/latest/enc/stegano)
|
|
1105
|
+
#### [Steganography](https://python-codext.readthedocs.io/en/latest/enc/stegano.html)
|
|
1082
1106
|
|
|
1083
1107
|
- [X] `hexagram`: uses Base64 and encodes the result to a charset of [I Ching hexagrams](https://en.wikipedia.org/wiki/Hexagram_%28I_Ching%29) (as implemented [here](https://github.com/qntm/hexagram-encode))
|
|
1084
1108
|
- [X] `klopf`: aka Klopf code ; Polybius square with trivial alphabetical distribution
|
|
1085
1109
|
- [X] `resistor`: aka resistor color codes
|
|
1086
1110
|
- [X] `rick`: aka Rick cipher (in reference to Rick Astley's song "*Never gonna give you up*")
|
|
1087
1111
|
- [X] `sms`: also called _T9 code_ ; uses "`-`" as a separator for encoding, "`-`" or "`_`" or whitespace for decoding
|
|
1112
|
+
- [X] `unicode-tags`: aka ASCII smuggling ; hides ASCII text in invisible Unicode tag characters
|
|
1088
1113
|
- [X] `whitespace`: replaces bits with whitespaces and tabs
|
|
1089
1114
|
- [X] `whitespace_after_before`: variant of `whitespace` ; encodes characters as new characters with whitespaces before and after according to an equation described in the codec name (e.g. "`whitespace+2*after-3*before`")
|
|
1115
|
+
- [X] `zero-width`: hides text in invisible zero-width characters (binary, ternary and quinary variants, compatible with zwsp-steg)
|
|
1090
1116
|
|
|
1091
|
-
#### [Web](https://python-codext.readthedocs.io/en/latest/enc/web)
|
|
1117
|
+
#### [Web](https://python-codext.readthedocs.io/en/latest/enc/web.html)
|
|
1092
1118
|
|
|
1093
1119
|
- [X] `html`: implements entities according to [this reference](https://dev.w3.org/html5/html-author/charref)
|
|
1094
1120
|
- [X] `url`: aka URL encoding
|
|
1095
1121
|
|
|
1096
1122
|
|
|
1123
|
+
<p align="center"><a href="#top"><img src="https://img.shields.io/badge/Back%20to%20top--lightgrey?style=social" alt="Back to top" height="20"/></a></p>
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
<h3 align="center">Encode/decode anything.</h3>
|
|
4
4
|
|
|
5
5
|
[](https://pypi.python.org/pypi/codext/)
|
|
6
|
+
[](https://pypi.python.org/pypi/codext/)
|
|
6
7
|
[](https://python-codext.readthedocs.io/en/latest/?badge=latest)
|
|
7
8
|
[](https://github.com/dhondta/python-codext/actions/workflows/python-package.yml)
|
|
9
|
+
[](https://github.com/dhondta/python-codext/actions/workflows/security.yml)
|
|
8
10
|
[](#)
|
|
9
|
-
[](https://pypi.python.org/pypi/codext/)
|
|
10
|
-
[](https://snyk.io/test/github/dhondta/python-codext?targetFile=requirements.txt)
|
|
11
11
|
[](https://zenodo.org/badge/latestdoi/236679865)
|
|
12
12
|
[](https://pypi.python.org/pypi/codext/)
|
|
13
13
|
|
|
14
|
-
[**CodExt**](https://github.com/dhondta/python-codext) is a (
|
|
14
|
+
[**CodExt**](https://github.com/dhondta/python-codext) is a library (Python 3.10 or later) that extends the native [`codecs`](https://docs.python.org/3/library/codecs) library (namely for adding new custom encodings and character mappings) and provides **120+ new codecs**, hence its name combining *CODecs EXTension*. It also features a **guess mode** for decoding multiple layers of encoding and **CLI tools** for convenience.
|
|
15
15
|
|
|
16
16
|
```sh
|
|
17
17
|
$ pip install codext
|
|
@@ -19,7 +19,7 @@ $ pip install codext
|
|
|
19
19
|
|
|
20
20
|
Want to contribute a new codec ? | Want to contribute a new macro ?
|
|
21
21
|
:----------------------------------:|:------------------------------------:
|
|
22
|
-
Check the [documentation](https://python-codext.readthedocs.io/en/latest/howto) first<br>Then [PR](https://github.com/dhondta/python-codext/pulls) your new codec | [PR](https://github.com/dhondta/python-codext/pulls) your updated version of [`macros.json`](https://github.com/dhondta/python-codext/blob/main/codext/macros.json)
|
|
22
|
+
Check the [documentation](https://python-codext.readthedocs.io/en/latest/howto.html) first<br>Then [PR](https://github.com/dhondta/python-codext/pulls) your new codec | [PR](https://github.com/dhondta/python-codext/pulls) your updated version of [`macros.json`](https://github.com/dhondta/python-codext/blob/main/src/codext/macros.json)
|
|
23
23
|
|
|
24
24
|
## Demonstrations
|
|
25
25
|
|
|
@@ -259,7 +259,7 @@ CACTCGGTCGGCCATATGTTCGGCCATATGTTCGTCTGTTCACTCGCCCATACACT
|
|
|
259
259
|
|
|
260
260
|
## List of codecs
|
|
261
261
|
|
|
262
|
-
#### [BaseXX](https://python-codext.readthedocs.io/en/latest/enc/base)
|
|
262
|
+
#### [BaseXX](https://python-codext.readthedocs.io/en/latest/enc/base.html)
|
|
263
263
|
|
|
264
264
|
- [X] `base1`: useless, but for the sake of completeness
|
|
265
265
|
- [X] `base2`: simple conversion to binary (with a variant with a reversed alphabet)
|
|
@@ -272,6 +272,7 @@ CACTCGGTCGGCCATATGTTCGGCCATATGTTCGTCTGTTCACTCGCCCATACACT
|
|
|
272
272
|
- [X] `base26`: conversion to alphabet letters
|
|
273
273
|
- [X] `base32`: classical conversion according to the RFC4648 with all its variants ([zbase32](https://philzimmermann.com/docs/human-oriented-base-32-encoding.txt), extended hexadecimal, [geohash](https://en.wikipedia.org/wiki/Geohash), [Crockford](https://www.crockford.com/base32))
|
|
274
274
|
- [X] `base36`: [Base36](https://en.wikipedia.org/wiki/Base36) conversion to letters and digits (with a variant inverting both groups)
|
|
275
|
+
- [X] `base38`: [Base38](https://github.com/project-chip/connectedhomeip/blob/master/src/setup_payload/Base38Encode.cpp) encoding of the Matter setup QR codes (chunks of 3 bytes)
|
|
275
276
|
- [X] `base45`: [Base45](https://datatracker.ietf.org/doc/html/draft-faltstrom-base45-04.txt) DRAFT algorithm (with a variant inverting letters and digits)
|
|
276
277
|
- [X] `base58`: multiple versions of [Base58](https://en.bitcoinwiki.org/wiki/Base58) (bitcoin, flickr, ripple)
|
|
277
278
|
- [X] `base62`: [Base62](https://en.wikipedia.org/wiki/Base62) conversion to lower- and uppercase letters and digits (with a variant with letters and digits inverted)
|
|
@@ -282,11 +283,17 @@ CACTCGGTCGGCCATATGTTCGGCCATATGTTCGTCTGTTCACTCGCCCATACACT
|
|
|
282
283
|
- [X] `base91`: [Base91](http://base91.sourceforge.net) custom conversion
|
|
283
284
|
- [X] `base100` (or *emoji*): [Base100](https://github.com/AdamNiederer/base100) custom conversion
|
|
284
285
|
- [X] `base122`: [Base100](http://blog.kevinalbs.com/base122) custom conversion
|
|
285
|
-
- [X] `
|
|
286
|
+
- [X] `base1024` (or *ecoji*): [Ecoji](https://github.com/keith-turner/ecoji) custom conversion (10 bits per emoji, versions 1 and 2)
|
|
287
|
+
- [X] `base2048`: [Base2048](https://github.com/qntm/base2048) custom conversion (11 bits per character, optimised for Twitter)
|
|
288
|
+
- [X] `base32768`: [Base32768](https://github.com/qntm/base32768) custom conversion (15 bits per character, optimised for UTF-16)
|
|
289
|
+
- [X] `base65536`: [Base65536](https://github.com/qntm/base65536) custom conversion (16 bits per character, optimised for UTF-32)
|
|
290
|
+
- [X] `bech32`: [Bech32](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) encoding with a human-readable part ; `bech32m` for its [Bech32m](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki) variant
|
|
291
|
+
- [X] `leb128` (or *varint*): [LEB128](https://en.wikipedia.org/wiki/LEB128) encoding of lists of integers ; `sleb128` for its signed variant
|
|
292
|
+
- [X] `base-genericN`: see [base encodings](https://python-codext.readthedocs.io/en/latest/enc/base.html) ; supports any possible base
|
|
286
293
|
|
|
287
294
|
This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `base85` codec.
|
|
288
295
|
|
|
289
|
-
#### [Binary](https://python-codext.readthedocs.io/en/latest/enc/binary)
|
|
296
|
+
#### [Binary](https://python-codext.readthedocs.io/en/latest/enc/binary.html)
|
|
290
297
|
|
|
291
298
|
- [X] `baudot`: supports CCITT-1, CCITT-2, EU/FR, ITA1, ITA2, MTK-2 (Python3 only), UK, ...
|
|
292
299
|
- [X] `baudot-spaced`: variant of `baudot` ; groups of 5 bits are whitespace-separated
|
|
@@ -294,19 +301,22 @@ This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `ba
|
|
|
294
301
|
- [X] `bcd`: _Binary Coded Decimal_, encodes characters from their (zero-left-padded) ordinals
|
|
295
302
|
- [X] `bcd-extended0`: variant of `bcd` ; encodes characters from their (zero-left-padded) ordinals using prefix bits `0000`
|
|
296
303
|
- [X] `bcd-extended1`: variant of `bcd` ; encodes characters from their (zero-left-padded) ordinals using prefix bits `1111`
|
|
304
|
+
- [X] `chuck-norris`: Chuck Norris unary code (runs of the 7-bit ASCII bits written with blocks of zeros)
|
|
305
|
+
- [X] `elias-gamma`, `elias-delta`: Elias universal codes, encoding characters from their ordinals (or lists of integers with `-integers`)
|
|
297
306
|
- [X] `excess3`: uses Excess-3 (aka Stibitz code) binary encoding to convert characters from their ordinals
|
|
307
|
+
- [X] `fibonacci`: Fibonacci universal code, encoding characters from their ordinals (or lists of integers with `-integers`)
|
|
298
308
|
- [X] `gray`: aka reflected binary code
|
|
299
309
|
- [X] `manchester`: XORes each bit of the input with `01`
|
|
300
310
|
- [X] `manchester-inverted`: variant of `manchester` ; XORes each bit of the input with `10`
|
|
301
311
|
- [X] `rotateN`: rotates characters by the specified number of bits (*N* belongs to [1, 7] ; Python 3 only)
|
|
302
312
|
|
|
303
|
-
#### [Checksums](https://python-codext.readthedocs.io/en/latest/enc/checksums)
|
|
313
|
+
#### [Checksums](https://python-codext.readthedocs.io/en/latest/enc/hashing.html#checksums)
|
|
304
314
|
|
|
305
315
|
- [X] `adler`: Adler32 algorithm (relies on `zlib`)
|
|
306
316
|
- [X] `crc`: CRC of lengths 8, 10-17, 21, 24, 30-32, 40, 64, 82 with a variety of polynoms
|
|
307
317
|
- [X] `luhn`: Luhn mod N algorithm
|
|
308
318
|
|
|
309
|
-
#### [Common](https://python-codext.readthedocs.io/en/latest/enc/common)
|
|
319
|
+
#### [Common](https://python-codext.readthedocs.io/en/latest/enc/common.html)
|
|
310
320
|
|
|
311
321
|
- [X] `a1z26`: keeps words whitespace-separated and uses a custom character separator
|
|
312
322
|
- [X] `cases`: set of case-related encodings (including camel-, kebab-, lower-, pascal-, upper-, snake- and swap-case, slugify, capitalize, title)
|
|
@@ -316,7 +326,7 @@ This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `ba
|
|
|
316
326
|
- [X] `ordinal`: dummy character ordinals conversion (converts to 3-digits groups)
|
|
317
327
|
- [X] `ordinal-spaced`: variant of `ordinal` ; dummy character ordinals conversion, handling whitespace separators
|
|
318
328
|
|
|
319
|
-
#### [Compression](https://python-codext.readthedocs.io/en/latest/enc/compressions)
|
|
329
|
+
#### [Compression](https://python-codext.readthedocs.io/en/latest/enc/compressions.html)
|
|
320
330
|
|
|
321
331
|
- [X] `gzip`: standard Gzip compression/decompression
|
|
322
332
|
- [X] `lz77`: compresses the given data with the algorithm of Lempel and Ziv of 1977
|
|
@@ -324,25 +334,36 @@ This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `ba
|
|
|
324
334
|
- [X] `pkzip_deflate`: standard Zip-deflate compression/decompression
|
|
325
335
|
- [X] `pkzip_bzip2`: standard BZip2 compression/decompression
|
|
326
336
|
- [X] `pkzip_lzma`: standard LZMA compression/decompression
|
|
337
|
+
- [X] `rle`: compresses runs of identical characters with Run-Length Encoding (count before or after each character, compact, bytes or repeated-byte escape variants)
|
|
327
338
|
|
|
328
339
|
> :warning: Compression functions are of course definitely **NOT** encoding functions ; they are implemented for leveraging the `.encode(...)` API from `codecs`.
|
|
329
340
|
|
|
330
|
-
#### [Cryptography](https://python-codext.readthedocs.io/en/latest/enc/crypto)
|
|
341
|
+
#### [Cryptography](https://python-codext.readthedocs.io/en/latest/enc/crypto.html)
|
|
331
342
|
|
|
343
|
+
- [X] `adfgx`: aka ADFGX Cipher (Polybius square and columnar transposition) ; `adfgvx` for its 6x6 variant
|
|
332
344
|
- [X] `affine`: aka Affine Cipher
|
|
333
345
|
- [X] `atbash`: aka Atbash Cipher
|
|
334
346
|
- [X] `autoclave`: aka Autoclave/Autokey Cipher (variant of Vigenere Cipher)
|
|
335
347
|
- [X] `bacon`: aka Baconian Cipher
|
|
336
348
|
- [X] `barbie-N`: aka Barbie Typewriter (*N* belongs to [1, 4])
|
|
349
|
+
- [X] `bazeries`: aka Bazeries Cipher (two Polybius grids and a transposition keyed by a number)
|
|
337
350
|
- [X] `beaufort`: aka Beaufort Cipher (variant of Vigenere Cipher)
|
|
351
|
+
- [X] `bifid`: aka Bifid Cipher (Delastelle's fractionation with a 5x5 Polybius square) ; `trifid` for its 3x3x3 cube variant
|
|
352
|
+
- [X] `chaocipher`: aka Chaocipher (two alphabets permuted after each letter)
|
|
338
353
|
- [X] `citrix`: aka Citrix CTX1 password encoding
|
|
354
|
+
- [X] `columnar`: aka Columnar Transposition Cipher (keyword-ordered columns ; a second keyword gives the double transposition)
|
|
355
|
+
- [X] `gronsfeld`: aka Gronsfeld Cipher (variant of Vigenere Cipher with a numeric key)
|
|
356
|
+
- [X] `hill`: aka Hill Cipher (blocks of letters multiplied by a key matrix modulo 26)
|
|
357
|
+
- [X] `nihilist`: aka Nihilist Cipher (sums of the Polybius coordinates of the text and of a repeated key)
|
|
339
358
|
- [X] `playfair`: aka Playfair Cipher
|
|
340
359
|
- [X] `phillips`: aka Phillips Cipher (polyalphabetic block cipher with 8 key squares)
|
|
341
360
|
- [X] `polybius`: aka Polybius Square Cipher
|
|
361
|
+
- [X] `porta`: aka Porta Cipher (reciprocal variant of Vigenere Cipher with 13 alphabets)
|
|
342
362
|
- [X] `railfence`: aka Rail Fence Cipher
|
|
343
363
|
- [X] `rotN`: aka Caesar cipher (*N* belongs to [1,25])
|
|
344
364
|
- [X] `scytaleN`: encrypts using the number of letters on the rod (*N* belongs to [1,[)
|
|
345
365
|
- [X] `shiftN`: shift ordinals (*N* belongs to [1,255])
|
|
366
|
+
- [X] `skip`: aka Skip Cipher (transposition reading every N-th character, looping on the text)
|
|
346
367
|
- [X] `trithemius`: aka Trithemius Cipher (variant of Vigenere Cipher)
|
|
347
368
|
- [X] `vic`: aka VIC Cipher
|
|
348
369
|
- [X] `vigenere`: aka Vigenere Cipher
|
|
@@ -350,7 +371,7 @@ This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `ba
|
|
|
350
371
|
|
|
351
372
|
> :warning: Crypto functions are of course definitely **NOT** encoding functions ; they are implemented for leveraging the `.encode(...)` API from `codecs`.
|
|
352
373
|
|
|
353
|
-
#### [Hashing](https://python-codext.readthedocs.io/en/latest/enc/hashing)
|
|
374
|
+
#### [Hashing](https://python-codext.readthedocs.io/en/latest/enc/hashing.html)
|
|
354
375
|
|
|
355
376
|
- [X] `blake`: includes BLAKE2b and BLAKE2s (Python 3 only ; relies on `hashlib`)
|
|
356
377
|
- [X] `crypt`: Unix's crypt hash for passwords (Python 3 and Unix only ; relies on `crypt`)
|
|
@@ -360,7 +381,7 @@ This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `ba
|
|
|
360
381
|
|
|
361
382
|
> :warning: Hash functions are of course definitely **NOT** encoding functions ; they are implemented for convenience with the `.encode(...)` API from `codecs` and useful for chaning codecs.
|
|
362
383
|
|
|
363
|
-
#### [Languages](https://python-codext.readthedocs.io/en/latest/enc/languages)
|
|
384
|
+
#### [Languages](https://python-codext.readthedocs.io/en/latest/enc/languages.html)
|
|
364
385
|
|
|
365
386
|
- [X] `braille`: well-known braille language (Python 3 only)
|
|
366
387
|
- [X] `ipsum`: aka lorem ipsum
|
|
@@ -374,25 +395,31 @@ This category also contains `ascii85`, `adobe`, `[x]btoa`, `zeromq` with the `ba
|
|
|
374
395
|
- [X] `tap`: converts text to tap/knock code, commonly used by prisoners
|
|
375
396
|
- [X] `tomtom`: similar to `morse`, using slashes and backslashes
|
|
376
397
|
|
|
377
|
-
#### [Others](https://python-codext.readthedocs.io/en/latest/enc/others)
|
|
398
|
+
#### [Others](https://python-codext.readthedocs.io/en/latest/enc/others.html)
|
|
378
399
|
|
|
400
|
+
- [X] `binhex`: BinHex 4.0 (`.hqx`), the binary-to-text encoding of the classic Mac OS
|
|
379
401
|
- [X] `dna`: implements the 8 rules of DNA sequences (N belongs to [1,8])
|
|
380
402
|
- [X] `letter-indices`: encodes consonants and/or vowels with their corresponding indices
|
|
381
403
|
- [X] `markdown`: unidirectional encoding from Markdown to HTML
|
|
404
|
+
- [X] `xx`: XXencode, a UUencode variant with an alphanumeric alphabet (`+`, `-`, digits and letters)
|
|
405
|
+
- [X] `yenc`: Usenet binary-to-text encoding (raw, wrapped or framed with header, trailer and CRC32)
|
|
382
406
|
|
|
383
|
-
#### [Steganography](https://python-codext.readthedocs.io/en/latest/enc/stegano)
|
|
407
|
+
#### [Steganography](https://python-codext.readthedocs.io/en/latest/enc/stegano.html)
|
|
384
408
|
|
|
385
409
|
- [X] `hexagram`: uses Base64 and encodes the result to a charset of [I Ching hexagrams](https://en.wikipedia.org/wiki/Hexagram_%28I_Ching%29) (as implemented [here](https://github.com/qntm/hexagram-encode))
|
|
386
410
|
- [X] `klopf`: aka Klopf code ; Polybius square with trivial alphabetical distribution
|
|
387
411
|
- [X] `resistor`: aka resistor color codes
|
|
388
412
|
- [X] `rick`: aka Rick cipher (in reference to Rick Astley's song "*Never gonna give you up*")
|
|
389
413
|
- [X] `sms`: also called _T9 code_ ; uses "`-`" as a separator for encoding, "`-`" or "`_`" or whitespace for decoding
|
|
414
|
+
- [X] `unicode-tags`: aka ASCII smuggling ; hides ASCII text in invisible Unicode tag characters
|
|
390
415
|
- [X] `whitespace`: replaces bits with whitespaces and tabs
|
|
391
416
|
- [X] `whitespace_after_before`: variant of `whitespace` ; encodes characters as new characters with whitespaces before and after according to an equation described in the codec name (e.g. "`whitespace+2*after-3*before`")
|
|
417
|
+
- [X] `zero-width`: hides text in invisible zero-width characters (binary, ternary and quinary variants, compatible with zwsp-steg)
|
|
392
418
|
|
|
393
|
-
#### [Web](https://python-codext.readthedocs.io/en/latest/enc/web)
|
|
419
|
+
#### [Web](https://python-codext.readthedocs.io/en/latest/enc/web.html)
|
|
394
420
|
|
|
395
421
|
- [X] `html`: implements entities according to [this reference](https://dev.w3.org/html5/html-author/charref)
|
|
396
422
|
- [X] `url`: aka URL encoding
|
|
397
423
|
|
|
398
424
|
|
|
425
|
+
<p align="center"><a href="#top"><img src="https://img.shields.io/badge/Back%20to%20top--lightgrey?style=social" alt="Back to top" height="20"/></a></p>
|
codext-2.0.0/SECURITY.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Only the latest release of CodExt (`codext` on [PyPI](https://pypi.org/project/codext/)) receives security fixes.
|
|
6
|
+
|
|
7
|
+
## Reporting a Vulnerability
|
|
8
|
+
|
|
9
|
+
Please do **not** report security vulnerabilities through public GitHub issues.
|
|
10
|
+
|
|
11
|
+
Instead, report them privately through [GitHub's private vulnerability reporting](https://github.com/dhondta/python-codext/security/advisories/new) (the repository's *Security* tab, then *Report a vulnerability*). Please include:
|
|
12
|
+
|
|
13
|
+
- the CodExt and Python versions;
|
|
14
|
+
- the steps to reproduce the issue (codec name, input and the command or code used);
|
|
15
|
+
- the impact you expect.
|
|
16
|
+
|
|
17
|
+
You will get an answer as soon as possible. Once the issue is confirmed, a fix is released and the advisory is published.
|