Is there a standard/trusted cryptography crate written in pure rust?

8 days ago by remustan37 to c/rust

Cryptography is considered to be one of the best application of rust. So I was wondering what cryptography crates people usually use. I see many crates that are abandoned, and other discussions I found on this topic are 2+ years old.

cosmicrose 22 points 8 days ago

blessed.rs is my usual place to get started with these sorts of questions, and they have a section on cryptography crates.

path: 0 26284406, hotness: undefined, score: 22, children: 0
ISO 17 points 8 days ago

Cryptography is considered to be one of the best application of rust.

Cryptography itself requires using assembly to avoid timing attacks. Using Rust on top of that is indeed a good match, and a widely used one (e.g. aws-lc-rs)

path: 0 26284698, hotness: undefined, score: 17, children: 0
Gobbel2000 8 points 8 days ago

The RustCrypto organization has a bunch of crates for common crypto schemes. From when I looked into some of it, it looked pretty solid. It seems well maintained compared to other options, although most crates still have not reached version 1.0 and might be relatively new in the grand scheme of things, which is something to consider when security is critical.

path: 0 26285532, hotness: undefined, score: 8, children: 0
FizzyOrange 4 points 8 days ago

aws-lc-rs is probably the most popular but also quite annoying because it uses C, so cross-compiling is a bit of a pain. I only managed to do it thanks to cargo zigbuild which is amazing. (And kind of embarrassing that Rust has to use Zig to get a nice cross-compiling UX, but hey it works.)

The other one is ring, which I'm not really sure the status of but I recall they had some super weird versioning policies that weren't very popular.

path: 0 26285900, hotness: undefined, score: 4, children: 2
Ephera 3 points 7 days ago

I only managed to do it thanks to cargo zigbuild which is amazing. (And kind of embarrassing that Rust has to use Zig to get a nice cross-compiling UX, but hey it works.)

As in cross didn't work for this?

path: 0 26285900 26291415, hotness: undefined, score: 3, children: 1
FizzyOrange 5 points 6 days ago

cross requires Docker which is a really awkward dependency, especially on Windows and Mac, or if you're already in Docker, e.g. in CI or a dev container.

Plus it's quite slow. Cargo zigbuild was a much nicer solution when I finally resorted to it. Zig is easy to install, even on Debian - just download and untar.

path: 0 26285900 26291415 26308411, hotness: undefined, score: 5, children: 0
rust
rust

@programming.dev

login for more options
8334
1423
314

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits
  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

go to feed...