Skip to main content

ANCH — Adaptive Neural Chaotic Hash Framework: experimental hashing combining feature extraction, neural parameter generation, and chaos theory.

Project description

ANCH — Adaptive Neural Chaotic Hash Framework

version python license status deps

ANCH is an experimental adaptive hashing framework that combines Feature Extraction, Neural Parameter Generation, Chaos Theory, Dynamic Permutation, and a Compression Engine to produce unique 256-bit digests.


⚠️ Disclaimer

ANCH is an experimental research framework. It is not intended as a drop-in replacement for SHA-256 or other production cryptographic hash functions. Use it for research, benchmarking, education, and data fingerprinting experiments.


✨ Features

Feature Description
🧠 Neural Parameter Generation Feature-derived parameters control every hash operation
🌀 Chaos Theory Engine Logistic map produces chaotic byte streams for mixing
🔀 Dynamic Permutation Bit and word-level shuffling for avalanche diffusion
🗜️ Compression Engine Multi-round Feistel-style compression
📊 Built-in Benchmarks Avalanche, entropy, collision, and runtime analysis
🖥️ CLI Interface Full command-line access to all features
0️⃣ Zero Dependencies Pure Python 3.12, no external packages required

🚀 Installation

pip install anch-hash

Or install from source:

git clone https://github.com/anch-framework/anch
cd anch
pip install -e ".[dev]"

🔧 Quick Start

import anch

# Hash a string
digest = anch.hash("hello world")
print(digest)  # → 64-character hex string

# Verify a digest
anch.verify("hello world", digest)  # → True

# Hash a file
digest = anch.hash_file("report.pdf")

# Verify a file
anch.verify_file("report.pdf", digest)  # → True

# Avalanche effect analysis
pct = anch.avalanche("hello", "HELLO")
print(f"{pct:.2f}% bits differ")

# Entropy of digest
score = anch.entropy(digest)
print(f"{score:.4f} bits/byte")

# Collision testing
report = anch.collision_test(["user_1", "user_2", "user_3"])
print(report["collisions"])  # → 0

🖥️ CLI Usage

# Hash a string
anch hash "hello world"

# Hash a file
anch hash-file report.pdf

# Verify
anch verify "hello world" <digest>
anch verify-file report.pdf <digest>

# Analysis
anch avalanche "hello" "HELLO"
anch entropy <digest>

# Benchmarks
anch benchmark --samples 200

🏗️ Architecture

Input Data
    ↓
Feature Extractor        → bit count, entropy, byte frequency, bigrams
    ↓
Neural Parameter Gen     → seed, r-value, rotations, compression key
    ↓
Chaotic Engine           → logistic map → chaos byte stream
    ↓
Dynamic Permutation      → bit shuffle + word rotation
    ↓
Compression Engine       → multi-round Feistel mixing + folding
    ↓
ANCH Digest (256-bit)

📦 Package Structure

ANCH/
├── src/anch/
│   ├── __init__.py        # Public API
│   ├── __main__.py        # CLI entry point
│   ├── core.py            # Pipeline orchestrator
│   ├── feature.py         # Feature extraction
│   ├── neural.py          # Neural parameter generation
│   ├── chaos.py           # Chaotic engine
│   ├── permutation.py     # Dynamic permutation
│   ├── compression.py     # Compression engine
│   └── benchmark.py       # Benchmark suite
├── tests/
│   ├── test_core.py       # Public API tests
│   └── test_modules.py    # Internal module tests
├── examples/
│   └── demo.py            # Quick demo
├── docs/                  # MkDocs documentation
├── website/               # Next.js website
├── pyproject.toml
└── README.md

📊 Benchmark Suite

from anch.benchmark import BenchmarkSuite

suite = BenchmarkSuite(samples=200)
report = suite.run_all()
suite.print_report(report)

Benchmarks include:

  • Avalanche Effect — target ≈ 50% bit change per single-bit input flip
  • Digest Entropy — target ≈ 8.0 bits/byte
  • Collision Resistance — zero collisions expected across random dataset
  • Runtime Performance — throughput across 16B–64KB inputs
  • SHA-256 Comparison — relative speed comparison

🗺️ Roadmap

Version Features
v0.1 Core Hash Engine, Python SDK, CLI, Tests
v0.2 Benchmark Suite UI, Online Playground, REST API
v0.3 Multi-Chaotic Engine (Tent, Hénon), TF Integration, Dynamic S-Box
v1.0 Full Public Release, Developer SDK, Community

📄 License

MIT © ANCH Framework Team


🌐 Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anch_hash-0.1.0.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anch_hash-0.1.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file anch_hash-0.1.0.tar.gz.

File metadata

  • Download URL: anch_hash-0.1.0.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for anch_hash-0.1.0.tar.gz
Algorithm Hash digest
SHA256 35baa6da1d75573572989a4ee24ff57775b7262d90ea3ea75d2c3f4466ed3736
MD5 008d7257083458d021ba27f86563a153
BLAKE2b-256 d9a312fe27818954fd951978525a8bcf518bc51775171c73f20c80a103dfc30e

See more details on using hashes here.

File details

Details for the file anch_hash-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: anch_hash-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for anch_hash-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 778b1a4d56d0d08aa985eda1b6708ba2f6443ca68acfe7f718c860d218611244
MD5 257054f35376ecb826cbe43ac5f494ff
BLAKE2b-256 34277e2bdbbf13f8f7edcbb4e6b406c8537f5a937eaf79574de699baee4ba6cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page