Friday, April 11, 2008

File Hash Generator Explorer Shell Extension - MD5 a file via right-click in Windows Explorer...

CodeProject - File Hash Generator Shell Extension

 

"FileHash

...

There are two coding concepts covered in this article. The first is cryptographic hash and the second is windows shell extensions. The cryptographic hash, of which there are many different algorithms, produces the digital fingerprint of a file. The .NET Framework provides 6 System.Security.Cryptography.HashAlgorithm implementations that can be used for generating the digital fingerprint: MD5, SHA-1,SHA-256,SHA-384,SHA-512 and RIPEMD-160. The two most commonly used when downloading a file are MD5 and SHA-1. Windows shell extensions take us beyond the comfortable realm of managed code and force us to implement COM to integrate into the unmanaged world of Win32. For this element of the utility,code is pulled directly from Dino Esposito's article Manage with the Windows Shell: Write Shell Extensions with C#. Dino's explanation of the COM interfaces and sample code were invaluable to this project. To really understand the implemention of a shell extension, I highly recommend his article.

Using the Utility

With the integration into the Windows Explorer context menu, generating the hash as simple as selecting one or more files then right-clicking to display the context menu. From this menu, you can select which type of file hash you want to generate by selecting the sub-menu option. You will then be presented with a window containing the file name, the hash that you selected, plus the full path to the file(s) that you selected. This DataGridView table allows for selecting of the desired values and copying to the clipboard if you need to publish the hash value. It's that easy!

..."

While I have a number of MD5 file hashing utilities, this one looks like the easiest to use (hard to beat a right-click)... Plus it's cool that it is written in .Net. :)

1 comment:

OneLiner said...

Hmmm, I take it that his loads the CLR into explorer.exe right? Don't like that ...

Don't do Shell Extension Handlers in .NET
http://blogs.msdn.com/junfeng/archive/2005/11/18/494572.aspx