https://github.com/nikstur/libxcrypt-rs
Rust bindings for libxcrypt
https://github.com/nikstur/libxcrypt-rs
libxcrypt linux rust security users
Last synced: about 1 year ago
JSON representation
Rust bindings for libxcrypt
- Host: GitHub
- URL: https://github.com/nikstur/libxcrypt-rs
- Owner: nikstur
- License: mit
- Created: 2024-10-04T13:49:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-21T01:28:16.000Z (over 1 year ago)
- Last Synced: 2025-03-24T04:42:37.963Z (over 1 year ago)
- Topics: libxcrypt, linux, rust, security, users
- Language: Rust
- Homepage: https://docs.rs/xcrypt
- Size: 42 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# libxcrypt-rs
Rust bindings for [libxcrypt](https://github.com/besser82/libxcrypt)
## Usage
Add `xcrypt` to your `Cargo.toml`:
```sh
cargo add xcrypt
```
Hash a phrase with the best available hashing method and default parameters:
```rust
use xcrypt::{crypt, crypt_gensalt};
fn main() {
let setting = crypt_gensalt(None, 0, None).unwrap();
let hashed_phrase = crypt("hello", &setting).unwrap();
println!("{hashed_phrase}");
}
```