Cryptographic primitives for biometric template protection and key management.
Project description
prism-core
Cryptographic primitives for biometric template protection and key management.
Install
pip install prism-core
Modules
| Module | Class | Description |
|---|---|---|
prism.fuzzy |
FuzzyExtractor |
Sample-then-Lock (STL) biometric template protection |
prism.keys |
KeyDerivationManager |
HKDF-SHA256 hierarchical key derivation |
prism.vault |
AESVault |
AES-256-GCM authenticated encryption for numpy arrays and bytes |
prism.limiter |
RateLimiter |
Sliding-window rate limiter with auto-suspension |
Quick Start
from prism import FuzzyExtractor, KeyDerivationManager, AESVault, RateLimiter
# --- Fuzzy Extractor ---
fe = FuzzyExtractor(n_lockers=1024, locker_size=8)
import numpy as np
feature = np.random.randn(1, 192).astype(np.float32)
secret = b"my-16-byte-key!!"
helper = fe.lock_secret(feature, secret)
recovered, stats = fe.unlock_secret(feature, helper)
assert recovered == secret
# --- Key Derivation ---
km = KeyDerivationManager(key_source=b"\x00" * 32) # or path to key file
wallet_key = km.derive("myapp:wallet")
user_fernet = km.get_user_fernet("user-123")
# --- AES Vault ---
vault = AESVault()
import os
key = os.urandom(32)
arr = np.random.randn(1, 100).astype(np.float32)
record = vault.encrypt(key, arr)
decrypted = vault.decrypt(key, record)
# --- Rate Limiter ---
rl = RateLimiter(soft_limit=5, hard_limit=10, window_seconds=60)
allowed, msg = rl.check_and_record("device-001")
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fait_prism_core-1.0.1-cp314-cp314-macosx_26_0_arm64.whl.
File metadata
- Download URL: fait_prism_core-1.0.1-cp314-cp314-macosx_26_0_arm64.whl
- Upload date:
- Size: 522.8 kB
- Tags: CPython 3.14, macOS 26.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2f6b6449b1691a09103eef73562857e9cc63d11d3d402d97080f336825306d0
|
|
| MD5 |
1472b7189819b5ebd83249177d008dd0
|
|
| BLAKE2b-256 |
9b6f97ed04c784273938edc36942e838572cac68f9e54235fe6794a39b587f69
|
File details
Details for the file fait_prism_core-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: fait_prism_core-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cb959238a822edde0579b4dd0bd489b67efc2c486d3d1ef8c46e502172931c4
|
|
| MD5 |
a8dab8f401e0ba626148c5c77554acd1
|
|
| BLAKE2b-256 |
d90c102c2facc475b761a022bac373001863b2cdb210b1c33f3db1488585c7ec
|
File details
Details for the file fait_prism_core-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: fait_prism_core-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55ec79fe842b04b8c4606ea730388310f5fd13d12c0a19aae7ce79dcb559b85c
|
|
| MD5 |
68040470ad67a10de333f0a765991d77
|
|
| BLAKE2b-256 |
5adb1cf3396868991b0b0f1501392107aba1ba12be5b6165b050ea82bb479428
|