Skip to main content

decochators is a library to facilitate the study (visualization and analysis) of chaotic systems focused on application in CBE (Chaos-Based-Encryption) algorithms.

Structure

Class chaoticMap
│
├── Inherited class mth (Analysis)
│ 	│
│   ├── func Lyapunov
│   ├── func Kolmogorov-Sinai
│   ├── func Test 0-1
│   └── func Binarized Test 0-1
│
└── Inherited class vwr (Visualization)
	│
    ├── func Draw
    ├── func Bifurcation
    └── func Test 0-1

Supported Python Versions

  • Python 3.11+

Supported Chaos Systems

  • One-dimensional
  • Three-dimensional
    • Continuous dynamic systems
    • Discrete over time

Installing

Install or upgrade the Python bindings with pip <https://pip.pypa.io/>.

Latest official release:

pip install -U decochators

Specific version (not recommended for versions lower than 1.1.0):

pip install -U decochators==N.N.NxN

Latest official release from TestPypi:

pip install -i https://test.pypi.org/simple/ decochators

Specific version from TestPypi:

pip install -i https://test.pypi.org/simple/ decochators==N.N.NxN

Where $N \in \mathbb{Z}$ and $x \in {a, b, c, \dots, z}$, example: 1.0.4a0.

Note: you should consider using a virtual environment to create an isolated Python environment for installation.

Testing Binary Chaos Test 0-1

Important for versions lower than decochators1.1.0, mth.test01 is a binarized modified test, be careful comparing or testing complex systems.

from decochators import attach_chaos_tests
import numpy as np

@attach_chaos_tests("1d")
def logistic_step(x: float, r: float = 4.0) -> float:
    return r * x * (1 - x)

serie = logistic_step(0.1, r=3.9, N=1000, burn_in=100, seed=42)
k01 = logistic_step.mth.test01(logistic_step.__wrapped__,x0=0.1, r=3.9)

print("Results with burn-in & seed:")
print(f"Test 0-1 with the serie binarized: {k01}")

k01_vwr=logistic_step.vwr.test01(
    logistic_step.__wrapped__,
    x0=0.1,
    N=1000,
    burn_in=100,
    r=3.9
),

print(f"Complete Test 0-1: {k01_vwr}")

Calling other 1 Dimensions functions

With the same chaotic system than before:

def logistic_step(x: float, r: float = 4.0) -> float:
    return r * x * (1 - x)

Generating series

logistic_step(0.1, r=3.9, N=1000, burn_in=100, seed=42)

Lyapunov Exponent Analysis

logistic_step.mth.lyapunov(0.1, r=3.9)

Kolmorogov-Sinai Analysis

logistic_step.mth.ks(0.1, r=3.9)

Binary Test Analysis

logistic_step.mth.test01(logistic_step.__wrapped__, x0=0.1, r=3.9)

Binarized Test 0-1 Analysis

logistic_step.mth.btest01(0.1, r=3.9

Chaotic Draw Visualization

logistic_step.vwr.draw(logistic_step.__wrapped__, x0=0.3, N=250000, burn_in=100, r=4.0)

Bifurcation System Visualization

import numpy as np

param_range = np.linspace(2.5, 4.0, 300)
logistic_step.vwr.bifurcation(logistic_step.__wrapped__, x0=0.1, param_name="r", param_range=param_range, N=5000, burn_in=200, last_points=50)

Binary Test Visualization

logistic_step.vwr.test01(logistic_step.__wrapped__, x0=0.1, N=5000, burn_in=100, r=3.9)

Calling 3 Dimensions functions

Chaotic System sample:

def rossler_step(xyz: np.ndarray, a: float = 0.2, b: float = 0.2, c: float = 5.7) -> np.ndarray:
    x, y, z = xyz
    dt = 0.01
    dx = -y - z
    dy = x + a*y
    dz = b + z*(x - c)
    return np.array([x + dx*dt, y + dy*dt, z + dz*dt])

Lyapunov Exponent Analysis

rossler_step.mth.lyapunov([0.1,0,0])

Kolmorogov-Sinai Analysis

rossler_step.mth.ks([0.1,0,0])

Binary Test Analysis

As in 1 Dimension, 3D mth.test01 is in base of a binarized test in lower than decochatorsv1.1.0, be careful.

rossler_step.mth.test01(rossler_step.__wrapped__, xyz0=[0.1,0,0], N=5000, burn_in=100)

Binarized Test 0-1 Analysis

rossler_step.mth.btest01(xyz0=[0.1,0,0], N=5000, burn_in=100)

Chaotic Draw Visualization

rossler_step.vwr.draw(rossler_step.__wrapped__, [0.1, 0.0, 0.0], N=10000, burn_in=500, a=0.2, b=0.2, c=5.7)

Bifurcation System Visualization

import numpy as np

rossler_step.vwr.bifurcation(
    step_func=rossler_step,
    xyz0=[0.1,0.0,0.0],
    param_name='c',
    param_range=np.linspace(4, 6, 200),
    coord=2,      # Project on Cord Z | 0=X;1=Y;2=Z
    N=2000,
    burn_in=500
)

Binary Tests Visualization

rossler_step.vwr.test01(rossler_step.__wrapped__, xyz0=[0.1,0,0], N=5000, burn_in=100)

For further explication: https://yoshlsec.github.io/cbe-blogs/

For source code: https://github.com/yoshlsec/decochators

I hope its useful, first public python module for you all ;)

Metadata

Release files for decochators 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for decochators 1.1.0
File Size Uploaded Provenance Actions
decochators-1.1.0.tar.gz 9.5 kB Without provenance Details for decochators-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for decochators 1.1.0
File Interpreter ABI Platform Actions
decochators-1.1.0-py3-none-any.whl Python 3 none any Details for decochators-1.1.0-py3-none-any.whl

Total release size: 19.8 kB

Release files / decochators-1.1.0.tar.gz

Download URL decochators-1.1.0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9c924df1ef8a248392e6ae9a42600ed171198eadb339c50d63979fd369f79988
BLAKE2b-256 checksum
How to use checksums
b87e6c28b563c437f87bbee770aa77c787ac4f048686da6ae8db992506cfc08b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / decochators-1.1.0-py3-none-any.whl

Download URL decochators-1.1.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bff529afc4cc900146052735b322fdef44af279c40adbaa69c2165a3427be1c9
BLAKE2b-256 checksum
How to use checksums
56bd163ee49cb91127b9f81d385e352384a6e5be81375a119ba82474425da56c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Security for decochators 1.1.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.

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page