Crate scicrypt[][src]

Expand description

WARNING: WHILE THIS LIBRARY MAKES SOME EFFORT FOR SECURE IMPLEMENTATIONS, IT SHOULD NOT BE USED FOR ANY PRACTICAL APPLICATIONS. THE CODE IS NOT AUDITED. WE MAKE NO GUARANTEES ABOUT THE CODE’S CORRECTNESS NOR SECURITY.

Lightweight cryptographic building blocks for proof of concept implementations in applied cryptography.

While many libraries implementing cryptographic building blocks exist, many fall in one of two categories:

  • Fast but rigid, like many written in C++
  • Slow but flexible, like many written in python

This library attempts to find a balance between speed and flexibility, to ease the process of implementing proof of concepts of cryptographic protocols, such as those in the field of multi- party computation (MPC).

Current features

Currently, the library implements the following homomorphic cryptosystems and the associated homomorphic operations:

  • ElGamal over Curve25519 (Ristretto-encoded) and two threshold versions
  • ElGamal over safe prime groups and two threshold versions
  • Paillier and threshold Paillier
  • RSA

In addition, the library implements safe prime generation, which is faster than the same functionality implemented in other crates. The code is benchmarked between every version to ensure we do not increase run time and to compare against other implementations.

Check the table below for a run time comparison (in milliseconds) for safe prime generation:

Crate | Number of bits128192256320384
glass_pumpkin 52.160157.70319.03772.411328.3
scicrypt12.60953.627150.05321.11468.07

Updated: 10 Aug 2021 by GitHub Actions

Upcoming features

These are the upcoming minor versions and the functionality they will add.

Ease of use update (~Week 36)

FunctionalityDone
Encoding signed ints
Discrete log lookup tables
Debugging tools

Oblivious transfer update (~Week 34)

FunctionalityDone
OT & extensions
OPRF
OPPRF

Modules

Partially homomorphic cryptosystems with one key.

Functions for generating random prime numbers.

Random number generation that is consistent with the dependencies’ requirements.

Partially homomorphic threshold cryptosystems that require multiple parties to decrypt.

Structs

General error that arises when decryption fails, for example because there were not enough distinct decryption shares to decrypt a threshold ciphertext.

Rich representation of a ciphertext that associates it with the corresponding public key. This allows for performing homomorphic operations using operator overloading, among others.

Enums

The number of bits of security as compared to the AES cryptosystem. Check https://www.keylength.com/en/4/ for recommendations.

Traits

Functionality to easily turn a ciphertext into a rich ciphertext