Skip to main content

Fuzzy Extractor

A Python implementation of fuzzy extractor.

Introduction

Fuzzy extractors are a cryptography primitive designed to reliably derive keys from noisy sources. This makes them suitable for areas like biometric authentication where two measurements of the same subject can yield slightly different values. This implementation uses hamming distance as its error metric, meaning that two binary strings will produce the same key with very high probability if their hamming distance is within some given threshold.

The storage and retrieval of keys is performed using a primitive known as a digital locker. More information is available in the references section of this documentation.

Note that this is a probabilistic primitive based on very recent research. Use this library in real security applications at your own risk, ideally after performing some empirical evaluation for your chosen thresholds.

Installing

This library can be install from pip:

$ pip install fuzzy-extractor

Development

This repository comes with a Makefile to help with getting a development environment configured:

$ make help

Usage

Getting Started

This section will cover the basics of using fuzzy extractors. First, we need to create an extractor:

from fuzzy_extractor import FuzzyExtractor

extractor = FuzzyExtractor(16, 8)

The extractor we just created will accept 16 byte (128-bit) input values and guarantees that inputs within 8 bits of each other will produce the same key with over 0.9999 probability (see the references for more details).

We’re now ready to generate a key for some input:

key, helper = extractor.generate('AABBCCDDEEFFGGHH')

Note that generate() returned two things: key and helper. The former is the secret that can now be used for further cryptography. The latter does not need to be protected (i.e., it is not a secret), but it does need to be stored somewhere if we want to be able to reproduce the same key later.

As long as we have the public helper, we can reproduce the key with any input close enough to the original:

r_key = extractor.reproduce('AABBCCDDEEFFGGHH', helper)  # r_key should equal key
r_key = extractor.reproduce('AABBCCDDEEFFGGHI', helper)  # r_key will probably still equal key!
r_key = extractor.reproduce('AAAAAAAAAAAAAAAA', helper)  # r_key is no longer likely to equal key

Documentation

See the doc directory for documentation.

References

  • Canetti, Ran, et al. “Reusable fuzzy extractors for low-entropy distributions.” Annual International Conference on the Theory and Applications of Cryptographic Techniques. Springer, Berlin, Heidelberg, 2016.

Carter Yagemann

Metadata

Release files for fuzzy-extractor 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fuzzy-extractor 0.3
File Size Uploaded Provenance Actions
fuzzy_extractor-0.3.tar.gz 17.6 kB Without provenance Details for fuzzy_extractor-0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fuzzy-extractor 0.3
File Interpreter ABI Platform Actions
fuzzy_extractor-0.3-py2.py3-none-any.whl Python 3, Python 2 none any Details for fuzzy_extractor-0.3-py2.py3-none-any.whl

Total release size: 37.5 kB

Release files / fuzzy_extractor-0.3.tar.gz

Download URL fuzzy_extractor-0.3.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f45c1f5e627d1f3e5e81e210a768f0fc82ef0e209d52de663d3d7ad822999c89
BLAKE2b-256 checksum
How to use checksums
0604be94c98cdd06a4edf08db891235e7655fcf4361c84622f659058d2cd5086
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / fuzzy_extractor-0.3-py2.py3-none-any.whl

Download URL fuzzy_extractor-0.3-py2.py3-none-any.whl
Size 19.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0b186d21f76333054c8e9b74187803fde1a57371cd31796ecafdd0e1372a5681
BLAKE2b-256 checksum
How to use checksums
4a565e2032668da1bfc72cf7fa268713c806bb5ff15dedec9b97d3e994529cc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for fuzzy-extractor 0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page