amcrypt
Bury your data in tombs no mortal can crack.
amcrypt is a cryptographically hardened serialization library for Python. It wraps your objects in layers of defense — Pickle, Zlib compression, and AES-256-GCM authenticated encryption — sealed inside a tamper-evident binary envelope.
No shortcuts. No backdoors. No mercy.
Features
- AES-256-GCM authenticated encryption — confidentiality + integrity in one pass
- Scrypt key derivation — memory-hard, GPU-resistant password hashing
- Soul Binding — lock payloads to a specific hardware identifier (HWID)
- Payload Decay — cryptographically bound TTL / expiration timestamps
- DPI Evasion — stealth mode to defeat protocol fingerprinting
- Blood Pact — ECDSA signatures for non-repudiation
- Polymorphic Curse — random padding to thwart traffic analysis
- Doppelganger — dual-key plausible deniability encryption
- Watcher's Blindness — anti-debugging protection
- Ouroboros Ratchet — forward-secret key evolution in streams
- Ashes to Ashes — kill switch that wipes keys after tampering
- Ephemeral Spirit — secure memory wiping after decryption
- X25519 Key Exchange — Diffie-Hellman shared secret without transmitting the key
- RCE-immune —
pickle.loadsis never called unless GCM authentication succeeds first
Installation
pip install amcrypt
Dark Arts Guide
1. Summon a Key
from amcrypt import summon_key
key, salt = summon_key("my-dark-secret", generate_salt=True)
2. Raise the necromancer
import os
from amcrypt import necromancer
key = os.urandom(32)
amcrypt = amcryptmancer(key)
3. Kill & Revive
corpse = amcrypt.kill({"spell": "obliterate", "damage": 9999})
restored = amcrypt.revive(corpse)
Enterprise Features
Doppelganger (Plausible Deniability)
Encrypt two payloads under two independent keys into a single blob. The decoy key reveals a cover story; the real key reveals the classified data. An adversary cannot prove a second payload exists.
from amcrypt import Doppelgangeramcryptmancer
doppel = Doppelgangeramcryptmancer()
corpse = doppel.kill(
real_obj={"top_secret": "launch_codes"},
decoy_obj={"status": "nothing_here"},
real_key=real_k,
decoy_key=decoy_k,
)
# Decoy key → cover story
doppel.revive(corpse, key=decoy_k) # {"status": "nothing_here"}
# Real key → classified data
doppel.revive(corpse, key=real_k) # {"top_secret": "launch_codes"}
Watcher's Blindness (Anti-Debugging)
Automatically detects debuggers (pdb, pydevd, debugpy, etc.) via
sys.gettrace(), frame inspection, and environment analysis.
Raises SoulTrappedError if a debugger is found.
from amcrypt import amcryptmancer, SoulTrappedError
amcrypt = amcryptmancer(key, anti_debug=True) # enabled by default
try:
amcrypt.revive(corpse)
except SoulTrappedError:
print("A watcher lurks in the shadows")
Ouroboros Ratchet (Forward Secrecy)
The Streamer class automatically ratchets the session key after
every chunk using HKDF. Compromise of the current key does not
expose past ciphertexts.
from amcrypt import Streamer
streamer = Streamer(key, ratchet=True)
for enc_chunk in streamer.seal(data_generator):
socket.sendall(enc_chunk)
Ashes to Ashes (Kill Switch)
After 3 consecutive tampering attempts (MAC failures), the amcryptmancer
securely wipes its key from memory and raises SelfDestructError.
from amcrypt import amcryptmancer, SelfDestructError
amcrypt = amcryptmancer(key, max_tamper=3)
for _ in range(3):
try:
amcrypt.revive(tampered_corpse)
except SelfDestructError:
print("All secrets have been purged")
break
Soul Binding (HWID Locking)
corpse = amcrypt.kill(data, hwid=b"my-server-01")
restored = amcrypt.revive(corpse, hwid=b"my-server-01")
Payload Decay (TTL)
import time
from amcrypt import RottenCorpseError
corpse = amcrypt.kill(data, ttl_seconds=1)
time.sleep(1.1)
try:
amcrypt.revive(corpse)
except RottenCorpseError:
print("The corpse has rotted")
DPI Evasion (Stealth)
corpse = amcrypt.kill(data, stealth=True)
print(corpse[:4]) # Random bytes, not "NCR1"
Blood Pact (ECDSA Signatures)
from amcrypt.crypto import ecdsa_generate_keypair
privkey, pubkey = ecdsa_generate_keypair()
corpse = amcrypt.kill(data, signing_key=privkey)
restored = amcrypt.revive(corpse, verify_key=pubkey)
Polymorphic Curse (Random Padding)
corpse = amcrypt.kill(data, pad=True) # 16–256 bytes of random junk
X25519 Key Exchange
from amcrypt import amcryptmancer, DarkRitual
alice, bob = DarkRitual(), DarkRitual()
shared = alice.shared_key(bob.public_key_bytes())
bob.shared_key(alice.public_key_bytes())
amcrypt = amcryptmancer(shared)
Binary Envelope Format (v4)
┌──────────────┬─────────┬──────────┬───────────┬──────────────┬──────────────────────────┐
│ Magic (4B) │ Ver (1) │ Flags(1) │ Nonce(2B) │ Nonce (12B) │ Ciphertext + Tag (...B) │
└──────────────┴─────────┴──────────┴───────────┴──────────────┴──────────────────────────┘
- Magic:
NCR1(4 bytes, XOR-masked in stealth mode) - Version:
0x04 - Flags:
0x01— TTL present0x02— Stealth mode active0x04— HWID soul-binding0x08— Blood Pact (ECDSA signed)0x10— Polymorphic Curse (random padding)
Security Model
| Layer | Purpose |
|---|---|
| Pickle (highest protocol) | Python object serialization |
| Zlib (level 9) | Payload compression |
| ECDSA (Blood Pact) | Non-repudiation / signature |
| Random padding (Polymorphic Curse) | Traffic-analysis resistance |
| TTL (Payload Decay) | Cryptographically bound expiration |
| AES-256-GCM | Authenticated encryption |
| HWID AAD (Soul Binding) | Hardware-bound identity |
| Watcher's Blindness | Anti-debugging |
| Kill Switch (Ashes to Ashes) | Tamper-response key wipe |
| Secure Wipe (Ephemeral Spirit) | RAM zeroing after use |
| HKDF Ratchet (Ouroboros) | Forward secrecy in streams |
| Scrypt | Password → key derivation |
| X25519 + HKDF | Ephemeral key exchange |
API Reference
amcryptmancer(key, *, anti_debug=True, max_tamper=3)
| Method | Description |
|---|---|
kill(obj, *, hwid, ttl_seconds, stealth, signing_key, pad) |
Serialize + encrypt |
revive(corpse, *, hwid, stealth, verify_key) |
Decrypt + deserialize |
Doppelgangeramcryptmancer
| Method | Description |
|---|---|
kill(real_obj, decoy_obj, *, real_key, decoy_key, ...) |
Dual-key encrypt |
revive(corpse, *, key, hwid, stealth) |
Decrypt with either key |
Streamer(key, *, chunk_size=4096, ratchet=True)
| Method | Description |
|---|---|
seal(chunks) |
Encrypt chunks with ratcheting |
open(chunks) |
Decrypt chunks with ratcheting |
destroy() |
Wipe the session key |
DebuggerDetector
| Method | Description |
|---|---|
is_debugging() |
Returns True if debugger detected |
Exceptions
| Exception | Meaning |
|---|---|
amcryptError |
Base class |
MutilatedCorpseError |
Authentication failed |
CorpseDeliveryError |
Invalid envelope structure |
WrongRealmError |
HWID mismatch |
RottenCorpseError |
TTL expired |
BrokenPactError |
ECDSA verification failed |
SoulTrappedError |
Debugger detected |
SelfDestructError |
Kill switch triggered |
License
MIT — use it, break it, raise the dead.
Metadata
Release files for amcrypt 0.0.1
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 | |
|---|---|---|---|---|
| amcrypt-0.0.1.tar.gz | 18.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| amcrypt-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.0 kB
Release files / amcrypt-0.0.1.tar.gz
| Download URL | amcrypt-0.0.1.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3da94167150a6acac01e4062d1b069932a6821189b6742348c74e3aa12a4037
|
|
BLAKE2b-256 checksum How to use checksums |
96be5a884ec32a4124973afcecbb4f9627f6b3adbe00603f60ee1acf1cba1ecf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / amcrypt-0.0.1-py3-none-any.whl
| Download URL | amcrypt-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e02263c8ed2cdc8af1254e4533029e5eb225a8cf1e4891053fb051c0bb9c616
|
|
BLAKE2b-256 checksum How to use checksums |
07b2a146f2dff6a140c0155521bf783c538430bd4c632f76a0e2ee5927f97a73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Security for amcrypt 0.0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.