The Hardware Side of Cryptography

26 September 2008

The Implementation of MD4 Hash Function on PIC18F4550

Filed under: Hash — Tags: , , , , , , — edipermadi @ 11:11 am

MD4 is a message digest algorithm designed by Professor Ronald Rivest from MIT. This function creates small chunk of data as a hash value of any string that being computed. The size of hash is 128-bit. The internal of MD4 is consisted of 3 rounds of functions. Each function has 16 iterations. In total, MD4 has 48 steps to process data input into hash value.

MD4 is the predecessor of MD5, the hash function that still widely use for now on. MD4 has many weakness in terms of security. That was the reason why Professor Ronald Rivest proposed the next hash function which is MD5.

This post is merely to show how MD4 hash function was done on PIC18F4550. The way of implementation is basically easy and approximately near to MD5 implementation. I developed this code using MPLAB v8.0. The code has been tested against several test vector and works. The code is available under GNU Public License v3.0 with no charge and no warranty.

See those pictures below. I took them during simulation.

Hash Buffer

Hash Result

If you have question, don’t hesitate to leave some comments or contact me by email. I’ll try to answer your question regarding to this post.


Source Code | v1.0
PIC18F4550 Datasheet
MPLAB v8.0

Ronald Rivest


  1. Pretty part of content. I just stumbled upon your website
    and in accession capital to assert that I get actually enjoyed account your weblog posts.
    Anyway I’ll be subscribing for your augment and even I achievement you access consistently rapidly.

    Comment by low calorie meals — 23 May 2014 @ 4:49 am

  2. Normally I do not learn post on blogs, however I wish to say that this write-up very pressured me to try and do it!
    Your writing style has been surprised me. Thanks, quite nice article.

    Comment by diet with hcg — 30 July 2014 @ 8:18 am

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: