2 releases

Uses new Rust 2024

0.1.1 Aug 13, 2025
0.1.0 Aug 12, 2025

#1577 in Cryptography

Download history 35/week @ 2025-11-18 70/week @ 2025-11-25 59/week @ 2025-12-02 43/week @ 2025-12-09 27/week @ 2025-12-16 12/week @ 2025-12-23 26/week @ 2025-12-30 91/week @ 2026-01-06 138/week @ 2026-01-13 41/week @ 2026-01-20 67/week @ 2026-01-27 111/week @ 2026-02-03 124/week @ 2026-02-10 83/week @ 2026-02-17 105/week @ 2026-02-24 147/week @ 2026-03-03

472 downloads per month

MIT license

140KB
3.5K SLoC

crypt3_rs

Unix crypt(3) reimplemented in pure rust.

See the documentation for API reference.

Examples

use crypt3_rs::crypt::bcrypt;

// Hash a password with default parameters.
let h_new = bcrypt::hash("password").unwrap();

// Verify a password against an existing hash.
let h = "$2y$05$bvIG6Nmid91Mu9RcmmWZfO5HJIMCT8riNW0hEp8f6/FuA2/mHZFpe";
assert!(bcrypt::verify("password", h));

Summary

The following algorithms are currently implemented (in alphabetical order):

  • apr1_crypt
  • bcrypt
  • bsdi_crypt
  • md5_crypt
  • sha1_crypt
  • sha256_crypt
  • sha512_crypt
  • unix_crypt

Each algorithm resides in its eponymous module, and provides the following interface:

  • verify(): verify a password against a hash.
  • hash(): hash a password with default algorithm-spacific parameters.
  • hash_with(): hash a password with customized parameters.

There is also a convenience module unix which provides the functions unix::crypt, a crypt(3) work-alike, and unix::verify.

Dependencies

~1.5MB
~27K SLoC