π Scintia-96
Scintia-96 is a lightweight, keyed 96-bit permutation built for situations where you need guaranteed uniqueness for a 96-bit input. β‘
π Quick Start
Getting started is easy! Add it to your project:
Basic Usage
use Scintia96;
// 128-bit key (4 x u32)
const KEY: = ;
const PERMUTATION: Scintia96 = new;
π― Why Scintia-96?
The Use Case
Ever needed to derive a USB serial number from a 96-bit unique chip ID (like those on STM32 microcontrollers)? That's exactly why Scintia-96 exists! π οΈ
While you could use a hash function, a permutation is often more suitable for cases like this. Since it's a one-to-one mapping, the output inherits the guaranteed uniqueness of the input, meaning there can never be a collision.
Why a Keyed Permutation?
By using a key, you ensure that your derived result is unique to your use case. Even if other apps use Scintia-96 for the same purpose, their results will differ from yours. π§
π οΈ The Algorithm
Scintia-96 is based on the Speck block cipher (specifically Speck-64/128) with a few tweaks:
- 3-word GFN: It operates on three 32-bit words using a Generalized Feistel Network.
- 32 Rounds: Since we have 3 lanes and leave one out each round, diffusion is slightly slower. We bumped the round count to 32 to compensate and ensure robust mixing. πͺοΈ
π Security & Promises
I'm a developer, not a cryptographer, so I can't vouch for its resistance to cryptanalysis. But hereβs what Scintia-96 brings to the table:
- β No Collisions: It's a true permutation: 96-bit input, 96-bit output, with a one-to-one mapping.
- β Statistically Sound: Passes avalanche and random distribution tests.
- β Hard to Reverse: Prevents recovery of the input without the key.
- β Not Side-Channel Resistant: If an attacker can perform side-channel analysis on your hardware, they can probably just as well extract the key from flash memory. π€·ββοΈ
β οΈ A Note on Safety
Please don't use this to encrypt sensitive data. For AEAD, KDF, or MAC use cases, stick to well-established primitives like Xoodyak. Again, Scintia-96 is a keyed permutation, not a block cipher!
π Key Generation
We provide a handy script to generate keys for your project:
Quick One-Liners
Random Generation (via /dev/urandom):
Deterministic Derivation (via SHA-512):
key_material="my-unique-variant"
π License
This project is licensed under the BSD 2-Clause License. See LICENSE.md for the full text. π