Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cryptomite

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cryptomite

An awesome extractor library

  • 0.2.1
  • PyPI
  • Socket score

Maintainers
2

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}
}

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc