crypt3_rs

Crates.iocrypt3_rs
lib.rscrypt3_rs
version0.1.1
created_at2025-08-12 08:44:13.541082+00
updated_at2025-08-13 04:42:49.550557+00
descriptionUnix crypt(3) reimplemented in pure rust.
homepage
repositoryhttps://github.com/imgurbot12/crypt3
max_upload_size
id1791698
size164,864
Andrew Scott (imgurbot12)

documentation

https://docs.rs/crypt3_rs/

README

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.

Commit count: 0

cargo fmt