└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Awesome Cryptography Rust 2 | *Collect libraries and packages about cryptography in Rust.* 3 | 4 | - [Collection Library](#collection-library) 5 | - [Symmetric](#symmetric-cryptography) 6 | - [Public-key / Asymmetric](#asymmetric-cryptography) 7 | - [One-way Hash Function](#hash-function) 8 | - [Message Authentication Code (MAC)](#message-authentication-code) 9 | - [Digital Signature](#digital-signature) 10 | - [Rseudo Random Number Generator (PRNG)](#rseudo-random-number-generator) 11 | - [Zero-Knowledge Proofs (ZKP)](#zero-Knowledge-proofs) 12 | - [Homomorphic Encryption (HE)](#Homomorphic-encryption) 13 | - [Secure Multi-party Computation (MPC)](#secure-multi-party-computation) 14 | - [Theorem](#theorem) 15 | - [Math](#math) 16 | - [Elliptic Curve](#elliptic-curve) 17 | - [Attack Defense](#attack-defense) 18 | - [Others Wait to List](#others) 19 | 20 | 21 | ## Cryptography 22 | ### Collection library 23 | - [libsm](https://github.com/citahub/libsm) A Rust Library of China's Standards of Encryption Algorithms (SM2/3/4). 24 | - [mesalink](https://github.com/mesalock-linux/mesalink) MesaLink is a memory safe and OpenSSL-compatible TLS library. 25 | - [orion](https://github.com/brycx/orion) Usable, easy and safe pure-Rust crypto. 26 | - [rage](https://github.com/str4d/rage) age implementation. A simple, secure and modern encryption tool with small explicit keys, no config options, and UNIX-style composability. 27 | - [ring](https://github.com/briansmith/ring) Safe, fast, small crypto using Rust. (curve25519, aes-gcm, sha-256, sha-384, sha-512, hmac, hkdf, pbkdf2, p-256, p-384, x25519, chacha20-poly1305, ed25519). 28 | - [rust-crypto](https://github.com/DaGenix/rust-crypto) A (mostly) pure-Rust implementation of various cryptographic algorithms. 29 | - [rustls](https://github.com/ctz/rustls) A modern TLS library in Rust. 30 | - [sodiumoxide](https://github.com/sodiumoxide/sodiumoxide) Sodium Oxide: Fast cryptographic library for Rust (bindings to libsodium). 31 | 32 | 33 | ### Symmetric cryptography 34 | - [aeads](https://github.com/RustCrypto/AEADs): Collection of Authenticated Encryption with Associated Data algorithms written in pure Rust. 35 | - [block-ciphers](https://github.com/RustCrypto/block-ciphers) Collection of block cipher algorithms written in pure Rust. (AES, Blowfish, DES + 3DES, Kuznyechik, Magma, RC2, Twofish). 36 | - [stream-ciphers](https://github.com/RustCrypto/stream-ciphers) Collection of stream cipher algorithms. 37 | 38 | 39 | ### Asymmetric Cryptography 40 | ###### RSA 41 | - [RSA](https://github.com/RustCrypto/RSA) RSA implementation in pure Rust. (PKCS1v1.5: Encryption & Decryption, Sign & Verify). 42 | 43 | ###### DH 44 | - [x25519-dalek](https://github.com/dalek-cryptography/x25519-dalek) Fast and efficient ed25519 signing and verification in Rust. 45 | 46 | 47 | ### Hash Function 48 | - [BLAKE3](https://github.com/BLAKE3-team/BLAKE3) Official implementations of the BLAKE3 cryptographic hash function. 49 | - [hashes](https://github.com/RustCrypto/hashes) Collection of cryptographic hash functions written in pure Rust. (sha1, sha2, sha3, md4, md5, BLAKE2, RIPEMD-160, RIPEMD-320, GOST94, Grøstl, Streebog, Whirlpool). 50 | - [tiny-keccak](https://github.com/debris/tiny-keccak) A tiny implementation of SHA-3, SHAKE, Keccak, and sha3sum in rust. 51 | - [poseidon252](https://github.com/dusk-network/poseidon252) Starkad and Poseidon: New Hash Functions for Zero Knowledge Proof Systems. 52 | 53 | 54 | ### Message Authentication Code 55 | - [MACs](https://github.com/RustCrypto/MACs) Message authentication code algorithms written in pure Rust. (CMAC, DAA, HMAC, PMAC). 56 | 57 | 58 | ### Digital Signature 59 | ###### Digital Signature Scheme 60 | - [bls](https://github.com/w3f/bls) Aggregatable BLS sigantures. (w3f). 61 | - [bls-signatures](https://github.com/filecoin-project/bls-signatures) BLS Signatures in Rust. 62 | - [ed25519-dalek](https://github.com/dalek-cryptography/ed25519-dalek) Fast and efficient ed25519 signing and verification in Rust. (dalek) 63 | - [milagro_bls](https://github.com/sigp/milagro_bls) BLS12-381 cryptography using Apache Milagro. 64 | - [nisty](https://github.com/nickray/nisty) NIST P-256 signatures for Cortex-M4 microcontrollers. 65 | - [signatures](https://github.com/RustCrypto/signatures) Cryptographic signature algorithms (e.g. ECDSA, Ed25519). 66 | 67 | ###### Threshold Signature & Multi Party Signatures 68 | - [multi-party-ecdsa](https://github.com/KZen-networks/multi-party-ecdsa) Rust implementation of {t,n}-threshold ECDSA (elliptic curve digital signature algorithm). 69 | - [multi-party-schnorr](https://github.com/KZen-networks/multi-party-schnorr) Rust implementation of multi-party Schnorr signatures over elliptic curves. 70 | - [multiproof-rs](https://github.com/gballet/multiproof-rs) A rust implementation of Alexey Akhunov's multiproof algorithm. 71 | - [threshold_crypto](https://github.com/poanetwork/threshold_crypto) A pairing-based threshold cryptosystem for collaborative decryption and signatures. 72 | 73 | 74 | ### Rseudo Random Number Generator 75 | - [rand](https://github.com/rust-random/rand) A Rust library for random number generation. 76 | 77 | 78 | ### Zero Knowledge Proofs 79 | - [bellman](https://github.com/zkcrypto/bellman) zk-SNARK library. (zcash - librustzcash). 80 | - [bellman (matter-labs)](https://github.com/matter-labs/bellman) Bellman zkSNARK library for community with Ethereum's BN256 support. 81 | - [bellman (filecoin-project)](https://github.com/filecoin-project/bellman) GPU parallel acceleration to the FFT and Multiexponentation algorithms in the groth16 prover. 82 | - [bulletproofs (Dalek)](https://github.com/dalek-cryptography/bulletproofs) A pure-Rust implementation of Bulletproofs using Ristretto. 83 | - [bulletproofs (KZen-networks)](https://github.com/KZen-networks/bulletproofs) Bulletproof Rust implementation for Aggregated Range Proofs over multiple elliptic curves. 84 | - [Dusk-Zerocaf](https://github.com/dusk-network/dusk-zerocaf) Fast, efficient and bulletproof-friendly cryptographic operations. 85 | - [halo (prototype)](https://github.com/ebfull/halo) a zkp system. 86 | - [marlin](https://github.com/scipr-lab/marlin) A Rust library for the Marlin preprocessing zkSNARK. 87 | - [merlin](https://github.com/dalek-cryptography/merlin) Composable proof transcripts for public-coin arguments of knowledge. 88 | - [OpenZKP](https://github.com/0xProject/OpenZKP) pure Rust implementations of Zero-Knowledge Proof systems. 89 | - [rust-secp256k1-zkp](https://github.com/mimblewimble/rust-secp256k1-zkp) ZKP fork for rust-secp256k1, adds wrappers for range proofs, pedersen commitments, etc. 90 | - [sonic](https://github.com/ebfull/sonic) a protocol for quickly verifiable, compact zero-knowledge proofs of arbitrary computations. 91 | - [Spartan](https://github.com/microsoft/Spartan) High-speed zkSNARKs without trusted setup. 92 | - [zexe](https://github.com/scipr-lab/zexe) Rust library for decentralized private computation. 93 | - [ZoKrates](https://github.com/Zokrates/ZoKrates) A toolbox for zkSNARKs on Ethereum. 94 | 95 | 96 | ### Homomorphic Encryption 97 | - [Concrete](https://github.com/zama-ai/concrete) Zama's implementation of fully homomorphic encryption - Enables computations over encrypted data. 98 | - [TFHE-rs](https://github.com/zama-ai/tfhe-rs) Pure Rust implementation of the TFHE scheme for boolean and integers FHE arithmetics. 99 | 100 | 101 | ### Secure Multi-party Computation 102 | [white-city](https://github.com/KZen-networks/white-city) Network layer for MPC protocols.(include use Tendermint/TokioServer/RocketServer). 103 | 104 | 105 | ### Theorem 106 | #### Math 107 | - [fiat-crypto](https://github.com/mit-plv/fiat-crypto) Formally verified arithmetic implementations for several elliptic curves and word sizes, extracted to Rust from specifications written using in the Coq theorem prover. 108 | - [nalgebra](https://github.com/rustsim/nalgebra) Linear algebra library for Rust. 109 | - [num](https://github.com/rust-num/num) A collection of numeric types and traits for Rust. (Bigint). 110 | - [rust-decimal](https://github.com/paupino/rust-decimal) A Decimal Implementation written in pure Rust suitable for financial calculations. 111 | 112 | #### Elliptic Curve 113 | - [BLS12-381](https://github.com/zkcrypto/bls12_381) Implementation of the BLS12-381 pairing-friendly elliptic curve group. 114 | - [bn](https://github.com/paritytech/bn) Fork from [zcash](https://github.com/zcash-hackworks/bn) Pairing cryptography library in Rust. Barreto-Naehrig (BN). 115 | - [curve25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek) Group operations on Ristretto and Curve25519.. 116 | - [Jubjub](https://github.com/zkcrypto/jubjub) Implementation of the Jubjub elliptic curve group. 117 | - [k256](https://github.com/RustCrypto/elliptic-curves/tree/master/k256) Pure Rust implementation of secp256k1 using complete Weierstrass formulas 118 | - [libsecp256k1-rs](https://github.com/sorpaas/libsecp256k1-rs) Pure Rust Implementation of secp256k1. (Wei Tang). 119 | - [p256](https://github.com/RustCrypto/elliptic-curves/tree/master/p256) Pure Rust NIST P-256 implementation using complete Weierstrass formulas 120 | - [rust-secp256k1](https://github.com/rust-bitcoin/rust-secp256k1) Rust language bindings for Bitcoin secp256k1 library. (rust-bitcoin). 121 | 122 | 123 | ### Attack Defense 124 | #### Constant time 125 | - [subtle](https://github.com/dalek-cryptography/subtle) Pure-Rust traits and utilities for constant-time cryptographic implementations. 126 | - [subtle-encoding](https://github.com/iqlusioninc/crates/tree/main/subtle-encoding) Hex, Bech32, and Base64 in constant-time(ish). 127 | #### Zeroing memory 128 | - [Zeroize](https://github.com/RustCrypto/utils/tree/master/zeroize) Securely zero memory while avoiding compiler optimizations. 129 | 130 | 131 | ### Others 132 | - [Double Ratchet](https://github.com/sebastianv89/double-ratchet) Pure Rust implementation of the Double Ratchet algorithm. (communicate securely). 133 | - [kms-secp256k1](https://github.com/KZen-networks/kms-secp256k1) Multi Party Key Management System (KMS) for Secp256k1 Elliptic curve based digital signatures. 134 | - [KDFs](https://github.com/RustCrypto/KDFs) Collection of Key Derivation Functions written in pure Rust. 135 | - [librustzcash](https://github.com/zcash/librustzcash) Rust-language assets for Zcash. (bellman-zk-SNARK, pairing-elliptic curves). 136 | - [molasses](https://github.com/trailofbits/molasses) A Rust implementation of the Message Layer Security group messaging protocol. 137 | - [MLSAG](https://github.com/crypto-rs-go/MLSAG) Multilayered Linkable Spontaneous Anonymous Group, This particular version leverages Ristretto255. 138 | - [password-hashing](https://github.com/RustCrypto/password-hashing) Password-based key derivation functions. (PBKDF2, scrypt). 139 | - [opaque-ke](https://github.com/novifinancial/opaque-ke) A pure Rust implementation of the recent [OPAQUE](https://datatracker.ietf.org/doc/draft-krawczyk-cfrg-opaque/) PAKE. 140 | - [PAKEs](https://github.com/RustCrypto/PAKEs) Password-Authenticated Key Agreement protocols. (SRP, spake2). 141 | - [rcmixed](https://github.com/rust-cc/rcmixed) Mixed cryptosystem. inspired by PGP. 142 | - [RustySecrets](https://github.com/SpinResearch/RustySecrets) A Rust implementation of threshold Shamir's secret sharing. 143 | - [schnorrkel](https://github.com/w3f/schnorrkel) Schnorr VRFs and signatures on the Ristretto group. 144 | - [vdf](https://github.com/poanetwork/vdf) An implementation of Verifiable Delay Functions in Rust. 145 | - [Ronkathon](https://github.com/pluto/ronkathon) A number of mathematically transparent well documented implementations of many cryptographic primitives including elliptic curve pairings, KZG proofs, hashes, symmetric, and asymmetric primitive 146 | 147 | 148 | ## Contribute 149 | Contributions are most welcome. 150 | Not so many constraints, only lowercase > uppercase, symbols > letters. 151 | 152 | 153 | ## License 154 | [![Creative Commons License](http://i.creativecommons.org/l/by/4.0/88x31.png)](http://creativecommons.org/licenses/by/4.0/) 155 | 156 | This work is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/). 157 | --------------------------------------------------------------------------------