#key-derivation #pure #modern #embedded-devices #crypto #authenticated-encryption

cryptoxide

pure implementation of various common modern cryptographic algorithms, WASM compatible

18 releases

0.4.4 Feb 17, 2023
0.4.2 Jan 31, 2022
0.3.6 Nov 3, 2021
0.3.3 May 18, 2021
0.1.0 Sep 18, 2018

#44 in Cryptography

Download history 5117/week @ 2024-07-29 6117/week @ 2024-08-05 6004/week @ 2024-08-12 5704/week @ 2024-08-19 5414/week @ 2024-08-26 4739/week @ 2024-09-02 4235/week @ 2024-09-09 3151/week @ 2024-09-16 3962/week @ 2024-09-23 3949/week @ 2024-09-30 3296/week @ 2024-10-07 3765/week @ 2024-10-14 3259/week @ 2024-10-21 3462/week @ 2024-10-28 3342/week @ 2024-11-04 3622/week @ 2024-11-11

13,975 downloads per month
Used in 137 crates (44 directly)

MIT/Apache

755KB
15K SLoC

Cryptoxide

Crates.io MIT licensed APACHE-2 licensed Build Status

API Docs

A pure Rust implementation of various modern cryptographic algorithms, which has no dependencies and no foreign code (specially C or assembly code). This is compatible with WASM and embedded devices.

This crates package aims to support as many architectures as possible with as little dependencies as possible.

Disclaimer: There are no warranties in use as everything is cryptographically-related

Overview

Cryptoxide is a cryptographic crates aiming at providing good quality and efficient pure-rust implementation of popular cryptographic algorithms.

It provides various common algorithms in the following categories :

  • Cryptographic digests: SHA1, SHA2, SHA3, Kekkak, Blake2, Ripemd160
  • Message Authentication Code (MAC): HMAC, Poly1305
  • Symmetric ciphers: Salsa, Chacha
  • Authenticated Encryption (AE): ChachaPoly1305
  • Key Derivation Function (KDF): Pbkdf2, HKDF, Scrypt

Our main goals is to provide a library that is usable in a wide array of contextes, by supporting many platforms, but only by providing a bare bone and close to rust core APIs.

cryptoxide has zero dependencies, and will remain dependency free. As much as possible we rely on rust primitives, core only apis and in few places rely on alloc to get dymamic memory functionalities until we can remove them (when const-generic is stable).

Fork information

This is a fork of Rust-Crypto by DaGenix, to which we owe a debt of gratitude for starting some good quality pure Rust implementations of various cryptographic algorithms.

Notable differences with the original sources:

  • Maintained.
  • Extended ED25519 support for extended secret key (64 bytes) support.
  • Proper implementation of ChaChaPoly1305 (according to spec).
  • Many cryptographic algorithms removed: AES, Blowfish, Fortuna, RC4, RIPEMD160, Whirlpool, MD5.

Running benches

normally:

cargo +nightly bench --features with-bench

or with all the cpu capability enabled:

RUSTFLAGS="-C target_cpu=native" cargo +nightly bench --features with-bench

supported compiler versions

Rust test
stable
beta
nightly

We will always aim to support the current stable version at a minimum. However, it is likely that older versions of the Rust compiler are also supported.

License

This project is licensed under either of the following licenses:

No runtime deps

Features