Skip to main content

Cryptographic primitives for biometric template protection and key management.

Project description

fait-prism-core

Cryptographic primitives for biometric template protection and key management.

Install

pip install fait-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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fait_prism_core-1.0.2-cp314-cp314-macosx_26_0_arm64.whl (522.8 kB view details)

Uploaded CPython 3.14macOS 26.0+ ARM64

fait_prism_core-1.0.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

fait_prism_core-1.0.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file fait_prism_core-1.0.2-cp314-cp314-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for fait_prism_core-1.0.2-cp314-cp314-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 a654a3e445f90a6ef6d71a7b3f84689fae19daae9966923f1cc0a8bbbecf7735
MD5 c933cae04292d2bbbb9e9dcaa658a207
BLAKE2b-256 497b3859d96c45e83b9b4a00e1a761253286bcb6aac8fad0ecc9d1d48dccb181

See more details on using hashes here.

File details

Details for the file fait_prism_core-1.0.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fait_prism_core-1.0.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d61ca7469f0cfa68f5a4c1684d5b11c5b0a9202961404a588c409cae1a9384ee
MD5 b9455033a773a2a6845bcd0251e33a8f
BLAKE2b-256 c062e1c56e73fe07a9bb7ee31b953fd133d90fdf02c98d6adc1c319c893b776d

See more details on using hashes here.

File details

Details for the file fait_prism_core-1.0.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fait_prism_core-1.0.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a0e1f94a054f1574ab7e057b28715da6c92399dbb91546be08456d094e1cd3a4
MD5 c2ef6a626683f99efac674575d6b8a3a
BLAKE2b-256 3210a4956a021f35304970e7de1dc764922df70a58add3092fc451645d5348e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page