Seed-based neural network byte transformer. Generates deterministic, bidirectional neural networks that perform reversible byte-to-byte transformations.
Given a seed, Anagramy trains neural networks to learn byte permutations. The resulting model:
- Encodes and decodes with the same model file
- Position-aware: same byte at different positions → different output
- Cascaded stages: higher difficulty = more transformation layers
- Nonce support: same message encrypted twice produces different ciphertext
The goal is to make seed derivation difficult. Neural network weights may help obscure the relationship between the seed and the learned transformation.
# From source
git clone https://github.com/user/anagramy
cd anagramy
cargo build --release# Generate with seed 12345, difficulty 2 (2 cascade stages)
anagramy generate --seed 12345 --difficulty 2 --output model.binTraining output shows each network:
[S0/P0/encode] Epoch 60: accuracy = 100.00%, loss = 5.41
[S0/P1/decode] Epoch 70: accuracy = 100.00%, loss = 5.38
...
anagramy transform --model model.bin --text "Hello World"
# Output: a1b2c3d4e5f6g7h8:9f8e7d6c5b4a3210...
# ^nonce ^ciphertext (hex)anagramy transform --model model.bin --decode --hex "a1b2c3d4e5f6g7h8:9f8e7d6c5b4a3210..."
# Output: Hello Worldanagramy info --model model.binModel Information
=================
Version: 2
Type: Bidirectional (encode + decode)
Cascade stages: 2
Position classes: 4
Networks: 16 total (8 encode + 8 decode)
Parameters: 4206592 total
This is NOT encryption. It is obfuscation using neural network opacity.
See SECURITY.md for:
- Threat model
- What it protects against (and doesn't)
- Recommended usage patterns
TL;DR: For actual security, layer Anagramy on top of real crypto (AES-GCM), not instead of it.
- Seed deterministically generates byte permutations
- Neural networks are trained to memorize these permutations
- Networks are bundled into a single model file
- Transformation uses position-rotating network selection + CBC-style chaining
The security comes from the inscrutability of trained weights, not from cryptographic hardness.
MIT License - see LICENSE