22 releases

0.11.0-pre.3 Feb 1, 2024
0.10.6 Sep 22, 2023
0.10.5 Sep 22, 2022
0.10.1 Feb 17, 2022
0.5.2 Jun 13, 2017

#1832 in Cryptography

Download history 619714/week @ 2023-11-27 648545/week @ 2023-12-04 610598/week @ 2023-12-11 547149/week @ 2023-12-18 301619/week @ 2023-12-25 486911/week @ 2024-01-01 613763/week @ 2024-01-08 637153/week @ 2024-01-15 675466/week @ 2024-01-22 728985/week @ 2024-01-29 696862/week @ 2024-02-05 715290/week @ 2024-02-12 663240/week @ 2024-02-19 735790/week @ 2024-02-26 743828/week @ 2024-03-04 297980/week @ 2024-03-11

2,479,109 downloads per month
Used in 2,510 crates (324 directly)

MIT/Apache

22KB
408 lines

RustCrypto: MD5

crate Docs Apache2/MIT licensed Rust Version Project Chat Build Status

Pure Rust implementation of the MD5 cryptographic hash algorithm.

⚠️ Security Warning

This crate is provided for the purposes of legacy interoperability with protocols and systems which mandate the use of MD5.

However, MD5 is cryptographically broken and unsuitable for further use.

Collision attacks against MD5 are both practical and trivial, and theoretical attacks against MD5's preimage resistance have been found.

RFC 6151 advises no new IETF protocols can be designed MD5-based constructions, including HMAC-MD5.

Examples

use md5::{Md5, Digest};
use hex_literal::hex;

let mut hasher = Md5::new();
hasher.update(b"hello world");
let hash = hasher.finalize();

assert_eq!(hash, hex!("5eb63bbbe01eeed093cb22bb8f5acdc3"));

Also, see the examples section in the RustCrypto/hashes readme.

Minimum Supported Rust Version

Rust 1.72 or higher.

Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump.

SemVer Policy

  • All on-by-default features of this library are covered by SemVer
  • MSRV is considered exempt from SemVer as noted above

License

The crate is licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~290–490KB
~11K SLoC