Skip to main content

Compliance testing for implementations of cryptographic primitives

Project description

crypto-condor

The logo of crypto-condor, depicting a condor holding a key.

crypto-condor is a tool for compliance testing of cryptographic primitives, in the form of a Python library and CLI. It is complemented by an extensive documentation, featuring guides on the primitives supported.

Q: What is a cryptographic primitive?

A: A low-level cryptographic algorithm, generally used to build a protocol. For example, AES is an encryption primitive that is used in the TLS protocol, which is the protocol your browser used to securely get this page.

Q: What is compliance testing?

A: Algorithms are described in specifications, such as FIPS publications or RFCs. When implementing these algorithms, we want to ensure that they comply with the specification, i.e. the implementation behaves as the algorithm described.

Q: How to test for compliance then?

A: We can use test vectors, which are sets of inputs and their corresponding outputs. For example, encrypting with AES is a deterministic operation: for a given key and message, AES will always return the same ciphertext. So we can choose some input values, run the algorithm, and record the value returned. All implementations of AES are then expected to return the same ciphertext for this given key and message. If it does not, then it is not compliant.

Q: And so, what does crypto-condor do?

A: crypto-condor provides both a nice Python API and a wrapper system to test implementations with sets of test vectors that come from sources such as the NIST CAVP.

The Python API exposes test functions that take an implementation as input, in the form of a Python function or class, passes the inputs defined by the test vectors to that implementation, and checks if the outputs are those defined by the vectors.

The wrappers are small programs that already define the function prototype. The user calls the implementation to test inside this function, and crypto-condor runs it with the test vectors as with the Python API.

And it comes with a documentation, wrapper examples, and guides on supported primitives.

Requirements

crypto-condor requires Python 3.10+. For information, it is developed using Python 3.12 on Fedora 39.

The implementations of AES, ML-KEM, ML-DSA, and TestU01 are written in C and are compiled directly on the user's machine. As such, they require a C compiler and GNU Make. These primitives are only compiled when required, and not when installing the package:

  • AES: when testing the output of an implementation using classic modes of operation (not CCM or GCM).
  • ML-KEM: when testing the output of an implementation or when using test vectors on the encapsulate function.
  • ML-DSA: when testing the output of an implementation.
  • TestU01: when used to test a file.

Installation

It is available on PyPI:

python -m pip install crypto-condor

An up-to-date list of the requirements can be found in the [tool.poetry.dependencies] section of the pyproject.toml file.

Usage

The documentation is available at https://quarkslab.github.io/crypto-condor/latest/index.html.

Once installed, the CLI is available as crypto-condor-cli. It is structured in commands, similar to Git. Run it without arguments or with --help to display the help message detailing the available subcommands. You can check the documentation for a quick rundown of all the commands.

As for the Python library, it is available as crypto_condor (note the underscore). Each primitive has its own module under primitives, e.g. crypto_condor.primitives.AES. It contains the functions used to test implementations.

Development

See CONTRIBUTING.

Changelog and versioning

A changelog is available. This projects adheres to CalVer. The format used is YYYY.MM.DD[.MICRO][-MODIFIER]:

  • YYYY: full year (2023).
  • 0M: zero-padded month (01, 02, ..., 12).
  • 0D: zero-padded day (01, 02, ..., 31).
  • MICRO: an increasing counter, used for patches published in the same day.
  • MODIFIER: usually rc<n> to indicate a release candidate.

Authors

  • Julio Loayza Meneses, Quarkslab.
  • Angèle Bossuat, Quarkslab.
  • Dahmun Goudarzi, Quarkslab.

Logo idea by Robin David, drawing by Irene Loayza.

License

Apache License Version 2.0, see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crypto_condor-2025.3.18.tar.gz (38.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crypto_condor-2025.3.18-py3-none-any.whl (38.5 MB view details)

Uploaded Python 3

File details

Details for the file crypto_condor-2025.3.18.tar.gz.

File metadata

  • Download URL: crypto_condor-2025.3.18.tar.gz
  • Upload date:
  • Size: 38.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for crypto_condor-2025.3.18.tar.gz
Algorithm Hash digest
SHA256 208220be685e9687be0e666461edfab0743a7b120cb985f834c5d64b3806df47
MD5 a9b78adb4b4025c6532f406ca1938ae4
BLAKE2b-256 f3c3e17c943b30e10b1ec08a9e0fe51c2a6a2b9b2fd60fe3f9bde6ec756655c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for crypto_condor-2025.3.18.tar.gz:

Publisher: main.yml on quarkslab/crypto-condor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file crypto_condor-2025.3.18-py3-none-any.whl.

File metadata

File hashes

Hashes for crypto_condor-2025.3.18-py3-none-any.whl
Algorithm Hash digest
SHA256 d253d291c739c5ba05619a956e1b714340580b51e880fc374142f6c26e066181
MD5 b668f41ea3d7b6ba03f56bf8e43dd624
BLAKE2b-256 fe40de8324f955b9d12dcfb6dc2be3dfed21d8f97cef186bebc3117b52b7d9b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for crypto_condor-2025.3.18-py3-none-any.whl:

Publisher: main.yml on quarkslab/crypto-condor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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