Skip to main content

An awesome extractor library

Project description

cryptomite

Build Status PyPI version Downloads Downloads arXiv

image

cryptomite is a modular, extensible high-level Python library of randomness extractors, created by Quantinuum's Quantum Cryptography team. At a high level, the library offers state-of-the-art randomness extractors that are easy to use, optimized for performance and numerically precise providing a trade-off of features that suit numerous practical use cases. Find more information in our accompanying paper. For additional examples of usage and guidance on getting started with Cryptomite, see our related blog post and repository documentation.

The library is available for non-commercial use only; see the license for details.

The performance-critical parts of the library (e.g. the number theoretic transform) are implemented in C++, while the rest of the library (e.g. parameter estimation) is implemented in Python for accessibility and ease of installation.

The package is available for Python 3.8 and higher on Mac, Windows and Linux. To install, type:

pip install cryptomite

Example Usage

from cryptomite.trevisan import Trevisan
from random import randint

n, m, max_eps = 1000, 200, 0.01

ext = Trevisan(n, m, max_eps)

input_bits = [randint(0, 1) for _ in range(n)]
seed_bits = [randint(0, 1) for _ in range(ext.ext.get_seed_length())]

output_bits = ext.extract(input_bits, seed_bits)

Documentation

To build the docs, run

cd docs
pip install -r requirements.txt
make clean
make html

Testing

Install pytest, then run pytest test.

To run the C++ tests, run

cmake .
make
test/runTest

How to Cite

If you use cryptomite in your research, please cite the accompanying paper:

@misc{foreman2024cryptomite,
      title={Cryptomite: A versatile and user-friendly library of randomness extractors}, 
      author={Cameron Foreman and Richie Yeung and Alec Edgington and Florian J. Curchod},
      year={2024},
      eprint={2402.09481},
      archivePrefix={arXiv},
      primaryClass={cs.CR}
}

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

cryptomite-0.2.0-cp312-cp312-win_amd64.whl (102.5 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

cryptomite-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (123.5 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

cryptomite-0.2.0-cp312-cp312-macosx_14_0_arm64.whl (97.2 kB view hashes)

Uploaded CPython 3.12 macOS 14.0+ ARM64

cryptomite-0.2.0-cp312-cp312-macosx_13_0_x86_64.whl (101.4 kB view hashes)

Uploaded CPython 3.12 macOS 13.0+ x86-64

cryptomite-0.2.0-cp311-cp311-win_amd64.whl (101.6 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

cryptomite-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (124.2 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

cryptomite-0.2.0-cp311-cp311-macosx_14_0_arm64.whl (96.5 kB view hashes)

Uploaded CPython 3.11 macOS 14.0+ ARM64

cryptomite-0.2.0-cp311-cp311-macosx_13_0_x86_64.whl (100.6 kB view hashes)

Uploaded CPython 3.11 macOS 13.0+ x86-64

cryptomite-0.2.0-cp310-cp310-win_amd64.whl (101.7 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

cryptomite-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (124.2 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

cryptomite-0.2.0-cp310-cp310-macosx_14_0_arm64.whl (96.6 kB view hashes)

Uploaded CPython 3.10 macOS 14.0+ ARM64

cryptomite-0.2.0-cp310-cp310-macosx_13_0_x86_64.whl (100.6 kB view hashes)

Uploaded CPython 3.10 macOS 13.0+ x86-64

cryptomite-0.2.0-cp39-cp39-win_amd64.whl (100.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

cryptomite-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (124.7 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

cryptomite-0.2.0-cp39-cp39-macosx_13_0_x86_64.whl (100.7 kB view hashes)

Uploaded CPython 3.9 macOS 13.0+ x86-64

cryptomite-0.2.0-cp38-cp38-win_amd64.whl (101.5 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

cryptomite-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (124.6 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

cryptomite-0.2.0-cp38-cp38-macosx_13_0_x86_64.whl (100.5 kB view hashes)

Uploaded CPython 3.8 macOS 13.0+ x86-64

Supported by

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