MD5 Implementation

July 20th, 2006

This is not really a post… let see it more like a “memo” since every­time I have to imple­ment MD5 in some appli­ca­tion I always forget how to do…

First of all, we need the md5.c and md5.h files (note that the source in the link is an “appended” ver­sion of md5.h + md5.c, but if you look for them sin­go­larly on google you can find them already splitted).

Then we have to include the md5.h file in our source with an #include "md5.h".

Here there’s a code snip­pet of how to use it:

unsigned char *password = "hello, I'm a password!";
MD5_CTX ctx;
unsigned char password_hash[16];

MD5Init(&ctx);
MD5Update(&ctx, password, strlen((char *)password));
MD5Final(password_hash, &ctx);

We have to init the MD5 Con­text with MD5Init(), then update the MD5 with MD5Update() and saying to MD5 to store the result in password_hash by using MD5Final().

That’s all…

0 Comments, tagged with Coding

I’m about to become a FONero!

July 6th, 2006

Today I bought the FON social router for just 17.40€ (the router costs 5€ + 2.40€ of VAT and 10€ of ship­ping fees). I should get a Linksys WRT54GL/GS (or Buf­falo WHRG54S, but is much more prob­a­ble that I’ll get the Linksys) in a rel­a­tive short time.
Here it is:
The FON router
I’m going to become a FONero!

0 Comments, tagged with Geekness

Microblogging

  • Funny thing: yesterday night I had an idea about a good blog post I could make. But now I completely forgot what that idea was about. 12 hours ago #
  • I think pownce has a little issue with caching since if I delete a message and I write a new one, it doesn't appear in my homepage. Nov 16, 6:34pm #
  • I didn't know that something like [(x,y) for x in range(10) for y in range(x)] was possible in Python. Nov 16, 3:45pm #
  • I'm about to go to the local LUG dinner: pizza for everyone. Nov 14, 9:15pm #
  • Lately I've been very interested in fast data structures with minimum memory usage. Just surprised to find out that list comprehension in Python are sometimes slower for large quantities of data than classic for loops. Still trying to understand why (if someone has a clue, please let me know). Nov 12, 12:44pm #
  • So wordpress was silently modifying HTTP request headers and I was getting a 400 when fetching Pownce RSS. Now everything works as expected on my blog, shame on WP. Nov 9, 3:58pm #
  • Experimenting with document language identification. Nov 6, 10:23pm #
  • So looks like I finally found an interesting topic apart from web development: information retrieval. Nov 3, 5:13pm #
  • Planning a trip to Bologna in December Nov 1, 5:24pm #
  • After today, I want to go as far as I can from Italy. Oct 29, 11:49am #

Search


« Authored by Giuliani Vito Ivan »