enigma-encryption
Custom password hashing and file encryption — a C++ monorepo that builds:
- 🐍
enigma-encryptionPython library → published to PyPI - 💻
enigmaCLI tool → published to GitHub Releases
All hash and cipher logic lives exactly once in core/, shared by both outputs.
Architecture
enigma/
├── core/ # ✅ Single source of truth
│ ├── include/enigma/
│ │ ├── hash.h # hash_password() API
│ │ ├── cipher.h # encrypt/decrypt API
│ │ └── primitives.h # Shared internal byte primitives
│ └── src/
│ ├── hash.cpp # Custom iterative hash algorithm
│ ├── salt.cpp # CSPRNG + salt generation
│ ├── primitives.cpp # Shared bitwise rotation/manipulation
│ ├── cipher.cpp # Symmetric encrypt/decrypt of byte buffers
│ └── file_io.cpp # Chunked file encryption/decryption
├── cli/ # C++ CLI → GitHub Releases
├── python/ # pybind11 bindings → PyPI
├── tests/
│ ├── cpp/ # C++ test suite (hash + cipher tests)
│ └── python/ # pytest suite (50+ tests)
├── CMakeLists.txt
├── pyproject.toml # scikit-build-core configuration
└── .github/workflows/
├── ci.yml # Test on push (Linux, macOS, Windows)
├── release-cli.yml # CLI → GitHub Releases (on tag)
└── publish-pypi.yml # Python wheel → PyPI (on tag)
CLI
# Build
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
# Hash a password
./build/cli/enigma hash mypassword
./build/cli/enigma hash mypassword 12 myFixedSalt1234
# Encrypt / decrypt files
./build/cli/enigma encrypt secrets.txt mypassword
./build/cli/enigma decrypt secrets.txt.enc mypassword
Cost factor controls iterations (2^cost). Default is 10 (1024 rounds).
Recommended range: 8–14.
File format: Custom binary enigma001 — no system dependencies.
Python Library
Install
pip install enigma-encryption
Usage
import enigma
# Hash a password (random salt generated automatically)
h = enigma.hash_password("mysecret", cost=10)
print(h) # $aBcD1234567890$/$XYZ…
# Verify later — extract salt and re-hash
salt = enigma.extract_salt(h)
assert enigma.hash_password("mysecret", cost=10, salt=salt) == h
# Encrypt / decrypt bytes
data = b"my secret data"
enc = enigma.encrypt_bytes(data, "password", cost=10)
dec = enigma.decrypt_bytes(enc, "password")
assert dec == data
# Encrypt / decrypt files
enigma.encrypt_file("secret.txt", "secret.enc", "password", cost=10)
enigma.decrypt_file("secret.enc", "secret.txt", "password")
Algorithm
Hashing (hash_password):
- Multi-stage iterative algorithm: hash1 → hash2 → hash3 → hash4
- Nth-element byte cycling (custom permutation)
- Latin-1 → UTF-8 encoding conversion within the hash
- Memory-hard: each iteration reads from a 16×N memoization table
- Output:
$<salt>$/$<hash>— salt is always embedded
Cipher (encrypt_bytes / encrypt_file):
- Password →
hash_password(password, cost, random_salt)→ key - Key →
hash_password(key, cost, salt)→ verification hash - Data: iterated
rotate_left + XORin 1 KB sub-chunks - File format:
enigma001magic + salt + cost + verification hash + ciphertext
Testing
# C++ tests
cmake -B build && cmake --build build --parallel
cd build && ctest --output-on-failure
# Python tests
pip install . -v
python -m pytest tests/python/ -v
Release
Tag a version to trigger both pipelines:
git tag v1.0.0
git push --tags
- GitHub Actions builds CLI binaries for Linux, macOS, Windows → GitHub Release
- GitHub Actions builds Python wheels for all platforms → PyPI
PyPI Setup (one-time)
- Register at pypi.org
- Go to Account → Publishing → Add a new pending publisher
- Fill in: GitHub owner, repo
enigma, workflowpublish-pypi.yml, envpypi - Push a tag — no secrets needed (Trusted Publishing via OIDC)
License
MIT
Metadata
Release files for enigma-encryption 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| enigma_encryption-1.0.0.tar.gz | 55.3 kB | With provenance | Details for enigma_encryption-1.0.0.tar.gz |
Built distributions (wheels)
Total release size: 1.4 MB
Release files / enigma_encryption-1.0.0.tar.gz
| Download URL | enigma_encryption-1.0.0.tar.gz |
|---|---|
| Size | 55.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dabc9e7974f909b9837208e5d0af9d82937c9cf480501a64d51e2a99a903f756
|
|
BLAKE2b-256 checksum How to use checksums |
5d8405f6cb0f7af1ff03d73592ff1a16231ba0c262b3432e8c739265cfd1cdfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logRelease files / enigma_encryption-1.0.0-cp312-cp312-win_amd64.whl
| Download URL | enigma_encryption-1.0.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 236.8 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3f43dae1daee915bb8b3a0fc8c989c6f7cac9d8edbc8df03789ce9f264ae8d59
|
|
BLAKE2b-256 checksum How to use checksums |
c39c96d6d757229f8f7860d769142130a82ebea64a4abfac9e090f57f380bc80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logRelease files / enigma_encryption-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | enigma_encryption-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 128.8 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
82979c4d66921607578982b84f7ec9e03b577e7ed9174e3c42616f68a64343fb
|
|
BLAKE2b-256 checksum How to use checksums |
845c39d671ce49685ef024655c53563351e71a99b97cd07422927627f81a18d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logRelease files / enigma_encryption-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | enigma_encryption-1.0.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 100.0 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5945a4d0cf6c6b9afe8a77fab96258b3e7da1d3c76246057ffa50a78154d0598
|
|
BLAKE2b-256 checksum How to use checksums |
7f403ac548b15fa23807ef1b5c7f1b8039332fe64985af7bc28946c840f74fb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logRelease files / enigma_encryption-1.0.0-cp311-cp311-win_amd64.whl
| Download URL | enigma_encryption-1.0.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 236.0 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f2f9a0e4d52ebd2901e4dee898f37eae65ed50b0a0facc2f364586ce96d2c40b
|
|
BLAKE2b-256 checksum How to use checksums |
4d0770d1815baf37f4c0ad7aeb59b543361dc1518f7d2609800a0bb8ed888291
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logRelease files / enigma_encryption-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | enigma_encryption-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 129.2 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
2beef7613119249f0a8fc920b7956eda0bb3f2458492d7df4350ce66701aab9b
|
|
BLAKE2b-256 checksum How to use checksums |
0e5800a97308de0d504184374643e92e29240693f70795d8cf08755f13feaadb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logRelease files / enigma_encryption-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | enigma_encryption-1.0.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 100.6 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
43c3ee93ac9391be1f5a629a94cd55a792f5fc7f459630821aa0577100e312d7
|
|
BLAKE2b-256 checksum How to use checksums |
717a4790cfeaa00fd714588dc8f3f70febfda42951120ce1f0c79ff30ae1f689
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logRelease files / enigma_encryption-1.0.0-cp310-cp310-win_amd64.whl
| Download URL | enigma_encryption-1.0.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 234.8 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5e830c2230974b3276d3f3227d9f280744f41f821ee9d63afb1dd00008b2bd3d
|
|
BLAKE2b-256 checksum How to use checksums |
5b8f9badf8245d6f75ba2a3390963cf71b0d2beaeade2c640f92a8e5e42c40e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logRelease files / enigma_encryption-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | enigma_encryption-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 127.4 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
5ca4357f90b751f699563c6eb1c142790feafc5f7980d36b12f67ed2ae6d0966
|
|
BLAKE2b-256 checksum How to use checksums |
fdfc3d5a093832a8c281b0ecf00c44cd8e528dad6b33ce9bc27a9282bddd7e46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logRelease files / enigma_encryption-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | enigma_encryption-1.0.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 99.4 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a0a74fc8ec7baa982095ca8d13a43d216873c642f0a9152bf62d4ab454772973
|
|
BLAKE2b-256 checksum How to use checksums |
b1b337ad10bd76a79a09f61197b3b08e582b0ac6d97f3f2d6089a4c7e90dae41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logSecurity for enigma-encryption 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 10 files in this release have been uploaded with provenance metadata.
Attestation for enigma_encryption-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.