A simple MD5 implementation with a focus on buffered reading

Overview

md5-rs

A simple MD5 implementation with a focus on buffered reading, and is completely no_std.

This shouldn't be used in any security-critical software, as MD5 is vulnerable.

Motivations

I was working on a web project and realized I have no way of getting a checksum of a big file without reading it all into memory (which in some cases crashes the page!). The Web Crypto API doesn't have a MD5 implementation, so I figured rather than re-implementing a SHA algorithm, I'd implement MD5.

As such, the API may be slightly odd since it is mainly focused on WebAssembly.

Usage

This isn't as straight forward as other MD5 libraries may be, given that it is no_std through and through.

(); println!("{hash}"); // "bc6e6f16b8a077ef5fbc8d59d0b931b9"">
use md5_rs::Context;

// get the hash
let mut ctx = Context::new();
ctx.read(b"Hello, world");
let digest = ctx.finish();

// get digest as string
let hash = digest.iter().map(|x| format!("{:02x}", x)).collect::<String>();
println!("{hash}"); // "bc6e6f16b8a077ef5fbc8d59d0b931b9"
You might also like...
Rust implementation of Zcash protocol

The Parity Zcash client. Gitter Blog: Parity teams up with Zcash Foundation for Parity Zcash client Installing from source Installing the snap Running

Polkadot Node Implementation

Polkadot Implementation of a https://polkadot.network node in Rust based on the Substrate framework. NOTE: In 2018, we split our implementation of "Po

Official implementation of the YeeCo Root Chain (Layer 1)
Official implementation of the YeeCo Root Chain (Layer 1)

yeeroot Official implementation of the YeeCo Root Chain (Layer 1) YeeCo is a permissionless, secure, high performance and scalable public blockchain p

A (mostly) pure-Rust implementation of various cryptographic algorithms.

Rust-Crypto A (mostly) pure-Rust implementation of various common cryptographic algorithms. Rust-Crypto seeks to create practical, auditable, pure-Rus

A pure-Rust implementation of group operations on Ristretto and Curve25519
A pure-Rust implementation of group operations on Ristretto and Curve25519

curve25519-dalek A pure-Rust implementation of group operations on Ristretto and Curve25519. curve25519-dalek is a library providing group operations

An implementation of Keccak derived functions specified in FIPS-202, SP800-185 and KangarooTwelve

tiny-keccak An implementation of Keccak derived functions specified in FIPS-202, SP800-185 and KangarooTwelve. Documentation The Keccak-f[1600] permut

[INACTIVE] TLS 1.2 implementation in Rust

suruga is Rust implementation of TLS 1.2. It currently implements some core parts of TLS 1.2, NIST P-256 ECDHE and chacha20-poly1305. Usage extern cra

An implementation of the OPAQUE password-authenticated key exchange protocol

The OPAQUE key exchange protocol OPAQUE is an asymmetric password-authenticated key exchange protocol. It allows a client to authenticate to a server

A prototype implementation of the Host Identity Protocol v2 for bare-metal systems, written in pure-rust.
A prototype implementation of the Host Identity Protocol v2 for bare-metal systems, written in pure-rust.

Host Identity Protocol for bare-metal systems, using Rust I've been evaluating TLS replacements in constrained environments for a while now. Embedded

Releases(0.1.5)
Owner
Magnetar
Hey, I'm Magnetar! I'm a full-stack developer and designer. I work on projects for @ZenithDevs, Vinesauce, and myself.
Magnetar
MD5/SHA256 HASH ATTACK IN RUST

hashraccoon Installation Install cargo curl https://sh.rustup.rs -sSf | sh Install the hashraccoon crate cargo install hashraccoon Download the rockyo

null 3 Nov 5, 2022
CLI for reading IETF RFCs

██▄██ ▄▄█▄ ▄█ ▄▄ ██ ▄█ ▄▄██ ██ ▄█ █▄▄▄█▄▄▄██▄██▄██ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ietf 0.2.1 CLI for reading IETF RFCs. USAGE: ietf [OPTIONS] [SUBCOMMAND] FL

null 16 Feb 13, 2022
Aya is an eBPF library for the Rust programming language, built with a focus on developer experience and operability.

Aya API docs | Chat | Aya-Related Projects Overview eBPF is a technology that allows running user-supplied programs inside the Linux kernel. For more

null 1.5k Jan 6, 2023
Rustycan - UI framework for Rust with focus on developer ergonomics for retained or immediate-like mode

Rustycan is a powerful UI framework for Rust, designed to make it easier than ever to create UIs and update existing UIs for games or apps.

Nokola 3 Jan 3, 2023
A github rust workflows template, just want to focus on coding

rust-template A github rust workflows template, just want to focus on coding. Demo template GitHub Actions Workflow file Table of contents Features Us

null 3 Jul 23, 2023
Simple EVM implementation from scratch using Rust.

smol-evm-rs • smol-evm-rs is a Rust port of the smol-evm project, originally implemented in Python by karmacoma. This project aims to implement the Et

Pranesh A S 29 Dec 27, 2023
Minimal implementation of the Mimblewimble protocol.

Grin Grin is an in-progress implementation of the Mimblewimble protocol. Many characteristics are still undefined but the following constitutes a firs

null 5k Dec 28, 2022
IBC modules and relayer - Formal specifications and Rust implementation

ibc-rs Rust implementation of the Inter-Blockchain Communication (IBC) protocol. This project comprises primarily four crates: The ibc crate defines t

Informal Systems 296 Dec 31, 2022
A Rust implementation of BIP-0039

bip39-rs A Rust implementation of BIP0039 Changes See the changelog file, or the Github releases for specific tags. Documentation Add bip39 to your Ca

Infincia LLC 49 Dec 9, 2022
Official Rust implementation of the Nimiq protocol

Nimiq Core implementation in Rust (core-rs) Rust implementation of the Nimiq Blockchain Core Nimiq is a frictionless payment protocol for the web. Thi

Nimiq 72 Sep 23, 2022