All Projects → briansmith → Crypto Bench

briansmith / Crypto Bench

Benchmarks for crypto libraries (in Rust, or with Rust bindings)

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Crypto Bench

Maskbook
The portal to the new, open internet. ([I:b])
Stars: ✭ 691 (+931.34%)
Mutual labels:  cryptography, crypto
Simon Speck C
example C language implementation of SIMON and SPECK lightweight block ciphers.
Stars: ✭ 9 (-86.57%)
Mutual labels:  cryptography, crypto
Acra
Database security suite. Database proxy with field-level encryption, search through encrypted data, SQL injections prevention, intrusion detection, honeypots. Supports client-side and proxy-side ("transparent") encryption. SQL, NoSQL.
Stars: ✭ 726 (+983.58%)
Mutual labels:  cryptography, crypto
Cryptomator
Multi-platform transparent client-side encryption of your files in the cloud
Stars: ✭ 6,623 (+9785.07%)
Mutual labels:  cryptography, crypto
Simple Cryptography
Scripts that illustrate basic cryptography concepts based on Coursera Standford Cryptography I course and more.
Stars: ✭ 40 (-40.3%)
Mutual labels:  cryptography, crypto
Rando.js
The world's easiest, most powerful random function.
Stars: ✭ 659 (+883.58%)
Mutual labels:  cryptography, crypto
Aeternity
æternity: solving scalability problems by making sense of state-channels
Stars: ✭ 923 (+1277.61%)
Mutual labels:  cryptography, crypto
Libsodium Php
The PHP extension for libsodium.
Stars: ✭ 507 (+656.72%)
Mutual labels:  cryptography, crypto
Crypton
Library consisting of explanation and implementation of all the existing attacks on various Encryption Systems, Digital Signatures, Key Exchange, Authentication methods along with example challenges from CTFs
Stars: ✭ 995 (+1385.07%)
Mutual labels:  cryptography, crypto
Supergirloncrypt
CryptoTrojan in Python (For educational purpose ONLY)
Stars: ✭ 28 (-58.21%)
Mutual labels:  cryptography, crypto
Fhe Toolkit Linux
IBM Fully Homomorphic Encryption Toolkit For Linux. This toolkit is a Linux based Docker container that demonstrates computing on encrypted data without decrypting it! The toolkit ships with two demos including a fully encrypted Machine Learning inference with a Neural Network and a Privacy-Preserving key-value search.
Stars: ✭ 1,123 (+1576.12%)
Mutual labels:  cryptography, crypto
Write Ups
📚 VoidHack CTF write-ups
Stars: ✭ 45 (-32.84%)
Mutual labels:  cryptography, crypto
Diffie Hellman backdoor
How to backdoor Diffie-Hellman
Stars: ✭ 559 (+734.33%)
Mutual labels:  cryptography, crypto
Libsodium.js
libsodium compiled to Webassembly and pure JavaScript, with convenient wrappers.
Stars: ✭ 665 (+892.54%)
Mutual labels:  cryptography, crypto
Securefs
Filesystem in userspace (FUSE) with transparent authenticated encryption
Stars: ✭ 518 (+673.13%)
Mutual labels:  cryptography, crypto
Virgil Crypto Php
Virgil PHP Crypto Library is a high-level cryptographic library that allows you to perform all necessary operations for secure storing and transferring data and everything required to become HIPAA and GDPR compliant.
Stars: ✭ 22 (-67.16%)
Mutual labels:  cryptography, crypto
Securitydriven.inferno
✅ .NET crypto done right. Professionally audited.
Stars: ✭ 501 (+647.76%)
Mutual labels:  cryptography, crypto
Iotex Core
Official implementation of IoTeX blockchain protocol in Go.
Stars: ✭ 505 (+653.73%)
Mutual labels:  cryptography, crypto
Featherduster
An automated, modular cryptanalysis tool; i.e., a Weapon of Math Destruction
Stars: ✭ 876 (+1207.46%)
Mutual labels:  cryptography, crypto
Cryptojs.swift
Cross-platform cryptographic functions in swift
Stars: ✭ 42 (-37.31%)
Mutual labels:  cryptography, crypto

crypto-bench

Benchmarks for Rust crypto libraries

Which benchmarks have been written?

ring rust-crypto rust-nettle (Nettle) rust-openssl (OpenSSL) sodiumoxide (libsodium) Windows CNG Mac/iOS Common Crypto
SHA‑1 & SHA‑2 SHA-{256,512} only
HMAC (SHA‑1 & SHA‑2)
PBKDF2 (SHA‑1 & SHA‑2) SHA-2 only SHA-1 only
AES‑128‑GCM & AES‑256‑GCM
ChaCha20‑Poly1305
Salsa20‑Poly1305
ECDH (Suite B) key exchange
X25519 (Curve25519) key exchange
Random Byte Generation
ECDSA (Suite B) signature verification In Progress (@briansmith)
Ed25519 signature verification In Progress (@briansmith) In Progress (@briansmith)
RSA signature verification In Progress (@briansmith)
ECDSA signing (Suite B with SHA‑1 & SHA‑2)
Ed25519 (Curve25519) signing
RSA signing (SHA‑1 & SHA‑2)
  • fastpbkdf2 is also benchmarked, for PBKDF2 only.
  • "Suite B" refers the the P-256 and P-384 elliptic curves.
  • "SHA-2" refers to SHA-256, SHA-384, and SHA-512.

How to contribute

Add new benchmarks

Follow the style of the existing examples. When implementing the same benchmark across multiple implementations, make sure that you're comparing the same thing (as much as is practical). Also, follow the submodule structure and naming scheme used in the existing benchmarks. It is often useful to create macros to minimize the amount of boilerplate required.

Add tools for visualizing the results

For example, it would be great to be able to get a graph or a table, or JSON that can be imported into some charting library, that allows one to compare the performance of one implementation to another. Similarly, it would be awesome to have a tool that allows one to see how the performance of a particular crypto library changes between versions.

These tools do not need to be written in Rust. They can be in Python or shell scripts or whatever. I highly recommend just scraping the output of cargo bench instead of trying to make changes to rustc, Cargo, and the Rust standard library. Perfect is the enemy of the good.

How to run all the benchmarks for all implementations

These benchmarks currently only can be built/run using Nightly Rust because they use Rust's built-in benchmarking feature, and that feature is marked "unstable" (i.e. "Nightly-only").

git clone https://github.com/briansmith/crypto-bench && cd crypto-bench && cargo update && cargo +nightly bench

You must use Rust Nightly because cargo bench is used for these benchmarks, and only Right Nightly supports cargo bench.

You don't need to run cargo build, and in fact cargo build does not do anything useful for this crate.

./cargo +nightly test runs one iteration of every benchmark for every implementation. This is useful for quickly making sure that a change to the benchmarks does not break them. Do this before submitting a pull request.

cargo update in the workspace root will update all the libraries to the latest version.

How to run all the benchmarks for a specific crypto library

  • cargo +nightly bench -p crypto_bench_fastpbkdf2 runs all the tests for rust-fastpbkdf2.
  • cargo +nightly bench -p crypto_bench_openssl runs all the tests for rust-openssl.
  • cargo +nightly bench -p crypto_bench_ring runs all the tests for ring.
  • cargo +nightly bench -p crypto_bench_rust_crypto runs all the tests for rust-crypto.
  • cargo +nightly bench -p crypto_bench_sodiumoxide runs all the tests for sodiumoxide.

How to run other subsets of the benchmarks

cargo bench takes arbitrary substrings of the test names as parameters, so you can get as specific as you want. For example, cargo +nightly bench sha512::_2000 will run just the SHA-512 benchmark that takes a 2000 byte input, for every implementation.

Why does each implementation's benchmark live in a separate crate?

  • Not all implementations build and work on all platforms. And, some implementations requre manual configuration (e.g. building/installing some third-party C library) to work.

  • Some implementations may not be able to (correctly) coexist in the same program because they define extern C symbols with the same names, but which are not interoperable. (This used to be the case for ring and rust-openssl, however ring implemented a workaround that allows ring to be used alongside other OpenSSL forks.)

License

CC0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].