Metadata-Version: 2.4
Name: smart-dynamic-path
Version: 1.0.1
Summary: Dynamic, deterministic, time-dependent path generation. No storage. No database. No dependencies. One secret phrase → one deterministic path per time period. Same phrase + same day = same path. No storage. No database. Just pure math.
Author-email: Alexander Suvorov <smartlegionlab@gmail.com>
License: BSD-3-Clause
Project-URL: Homepage, https://github.com/smartlegionlab/smart-dynamic-path
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Security
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Smart Dynamic Path <sup>v1.0.1</sup>

**Dynamic, deterministic, time-dependent path generation. No storage. No database. No dependencies.**

Generate cryptographically secure paths that change automatically based on time (day, month, hour) from a secret phrase. 
Perfect for hiding admin panels, creating temporary access links, or building time-based API keys.

---

[![GitHub release (latest by date)](https://img.shields.io/github/v/release/smartlegionlab/smart-dynamic-path)](https://github.com/smartlegionlab/smart-dynamic-path/)
![GitHub top language](https://img.shields.io/github/languages/top/smartlegionlab/smart-dynamic-path)
[![GitHub](https://img.shields.io/github/license/smartlegionlab/smart-dynamic-path)](https://github.com/smartlegionlab/smart-dynamic-path/blob/master/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/smartlegionlab/smart-dynamic-path?style=social)](https://github.com/smartlegionlab/smart-dynamic-path/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/smartlegionlab/smart-dynamic-path?style=social)](https://github.com/smartlegionlab/smart-dynamic-path/network/members)

[![PyPI - Downloads](https://img.shields.io/pypi/dm/smart-dynamic-path?label=pypi%20downloads)](https://pypi.org/project/smart-dynamic-path/)
[![PyPI](https://img.shields.io/pypi/v/smart-dynamic-path)](https://pypi.org/project/smart-dynamic-path)
[![PyPI - Format](https://img.shields.io/pypi/format/smart-dynamic-path)](https://pypi.org/project/smart-dynamic-path)
[![PyPI Downloads](https://static.pepy.tech/badge/smart-dynamic-path)](https://pepy.tech/projects/smart-dynamic-path)
[![PyPI Downloads](https://static.pepy.tech/badge/smart-dynamic-path/month)](https://pepy.tech/projects/smart-dynamic-path)
[![PyPI Downloads](https://static.pepy.tech/badge/smart-dynamic-path/week)](https://pepy.tech/projects/smart-dynamic-path)

---

## Core idea

One secret phrase → one deterministic path per time period. Same phrase + same day = same path. No storage. No database. Just pure math.

---

## Disclaimer

**By using this software, you agree to the full disclaimer terms.**

**Summary:** Software provided "AS IS" without warranty. You assume all risks.

**Full legal disclaimer:** See [DISCLAIMER.md](https://github.com/smartlegionlab/smart-dynamic-path/blob/master/DISCLAIMER.md)

---

## Use cases

- Hide Django admin: `/admin/a1b2c3d4e5f6g7h8/`
- Temporary download links that expire after a day
- Time-rotating API endpoints
- "Secret room" pattern for any web framework

and others...

## Local usage without installation

```bash
git clone https://github.com/smartlegionlab/smart-dynamic-path
cd smart-dynamic-path

python -m smart_dynamic_path.cli --secret "my secret phrase"
python -m smart_dynamic_path.cli --secret "my secret phrase" --period month --full
python -m smart_dynamic_path.cli --secret "my secret phrase" --key-only
```

## Installation

```bash
pip install smart-dynamic-path
```

## Quick start

```python
from smart_dynamic_path import generate_path, secret_to_path

# Generate path from secret key
path = generate_path(secret_key='your_64_hex_secret_key', period='day')
# Output: "4e30939634dfc6617f10a2f8fe259f44"

# With prefix
path = generate_path(secret_key='...', period='day', prefix='admin')
# Output: "admin/4ab3b83e39bbb1d7e31e0978ea8cea05"

# From secret phrase (local use only)
key, path = secret_to_path('my secret phrase', period='day')
```

## CLI commands

| Command                                                      | Output                       |
|--------------------------------------------------------------|------------------------------|
| `smart-dynamic-path --secret "secret"`                       | Full info (key + path + URL) |
| `smart-dynamic-path --secret "secret" --key-only`            | Only SECRET_KEY (64 hex)     |
| `smart-dynamic-path --secret "secret" --path-only`           | Only path (32 hex)           |
| `smart-dynamic-path --secret "secret" --full`                | Only full URL `/xxxx/`       |
| `smart-dynamic-path --secret "secret" --period month --full` | Monthly rotation             |
| `smart-dynamic-path --secret "secret" --prefix admin --full` | With prefix                  |

## Python API

```python
from smart_dynamic_path import generate_secret_key, generate_path, secret_to_path

# From secret phrase
key = generate_secret_key("my secret phrase")
path = generate_path(key, period='day')
key, path = secret_to_path("my secret phrase", period='day')
```

## How it works

```
SECRET_KEY = SHA256(secret_phrase)                 # 64 hex chars (256 bits)
PATH = SHA256(SECRET_KEY + date)[:16].hex()        # 32 hex chars (128 bits)
```

- Secret phrase → SECRET_KEY (256 bits)
- SECRET_KEY + current date/time → path (128 bits)
- Path changes automatically based on period (day/month/hour/static)

## Implemented paradigms

### 1. Pointer‑Based Security
The path is not stored anywhere. It is regenerated on demand from a secret phrase and current time. There is no stored "pointer" — only the ability to compute it.

**DOI:** [10.5281/zenodo.17204738](https://doi.org/10.5281/zenodo.17204738)

### 2. Local Data Regeneration
The exact path is computed locally on the developer's machine using only the secret phrase and date, without accessing any server.

**DOI:** [10.5281/zenodo.17264327](https://doi.org/10.5281/zenodo.17264327)

### 3. Position‑Candidate‑Hypothesis (PCH)
Among all possible paths (2¹²⁸ candidates), only one specific path generated by the secret phrase is valid at any given time.

**DOI:** [10.5281/zenodo.17614888](https://doi.org/10.5281/zenodo.17614888)

## Security

- No storage — paths are regenerated, not stored
- Deterministic — same input always produces same output
- 32 hex chars = 2¹²⁸ possible paths (no brute force)
- Time-based rotation limits exposure window

## License

BSD-3-Clause

## Author

Alexander Suvorov [@smartlegionlab](https://github.com/smartlegionlab)
