Skip to main content

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


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.1-cp314-cp314-macosx_26_0_arm64.whl (522.8 kB view details)

Uploaded CPython 3.14macOS 26.0+ ARM64

fait_prism_core-1.0.1-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.1-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.1-cp314-cp314-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for fait_prism_core-1.0.1-cp314-cp314-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 e2f6b6449b1691a09103eef73562857e9cc63d11d3d402d97080f336825306d0
MD5 1472b7189819b5ebd83249177d008dd0
BLAKE2b-256 9b6f97ed04c784273938edc36942e838572cac68f9e54235fe6794a39b587f69

See more details on using hashes here.

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

File hashes

Hashes for fait_prism_core-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2cb959238a822edde0579b4dd0bd489b67efc2c486d3d1ef8c46e502172931c4
MD5 a8dab8f401e0ba626148c5c77554acd1
BLAKE2b-256 d90c102c2facc475b761a022bac373001863b2cdb210b1c33f3db1488585c7ec

See more details on using hashes here.

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

File hashes

Hashes for fait_prism_core-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 55ec79fe842b04b8c4606ea730388310f5fd13d12c0a19aae7ce79dcb559b85c
MD5 68040470ad67a10de333f0a765991d77
BLAKE2b-256 5adb1cf3396868991b0b0f1501392107aba1ba12be5b6165b050ea82bb479428

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