22 lines
704 B
Markdown
22 lines
704 B
Markdown
Pure Rust implementation of the md5crypt password hashing function.
|
|
|
|
## Security warning!
|
|
md5crypt is considered cryptographically broken and unsafe for use as a password scrambler.
|
|
This crate is provided for interoperability with legacy systems only.
|
|
|
|
See the following links for more information:
|
|
- <https://web.archive.org/web/20180317164935/http://phk.freebsd.dk/sagas/md5crypt_eol.html>
|
|
- <https://datatracker.ietf.org/doc/html/rfc6151>
|
|
- <https://dl.acm.org/doi/10.1109/CIS.2009.214>
|
|
- <https://www.kb.cert.org/vuls/id/836068>
|
|
|
|
# Usage
|
|
|
|
```
|
|
use md5crypt::md5crypt;
|
|
|
|
let password = b"hunter2";
|
|
let salt = b"1234abcd";
|
|
assert_eq!(md5crypt(password, salt), b"$1$1234abcd$k941IFPqhCBpKvhOnZqRd/");
|
|
```
|