MSLx Fanboy Posted November 28, 2005 Share Posted November 28, 2005 (edited) Thanks to the code snippet that ter-pierre posted recently, I have converted a VBScript implementation of the MD5 algorithm into a simple AutoIt function.This version only allows for strings, I might get around to finding FileMD5 VBscript code...Surprisingly, with all of the &= operators in the function, it still executes fairly quicklyTest Code:#include <StringMD5.au3> For $x = 0 To 10 $cookie = TimerInit() MsgBox(0, MD5_String(Chr(Asc('a') + $x)), TimerDiff($cookie)/1000) NextThis script only works with the beta versions of autoit 3.1.1++ due to COM support and new operatorsStringMD5.au3 Edited November 28, 2005 by MSLx Fanboy Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
piccaso Posted November 29, 2005 Share Posted November 29, 2005 neat are there any reqirements? vb runtimes or something like that... CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted November 29, 2005 Author Share Posted November 29, 2005 As far as I know it will work with any windows system that has the vbscript runtime (or w/e its called) installed on the system. I would imagine that it will work without issue in 2000/XP. Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
erifash Posted November 29, 2005 Share Posted November 29, 2005 Hmmmm... This looks like something very familiar from a while ago:http://www.autoitscript.com/forum/index.ph...indpost&p=93362If you did not know about this then that is fine, but if you copied please give credits to the origional author: nakuribon. My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted November 29, 2005 Author Share Posted November 29, 2005 Hehe, oops, I never saw that. I know that when I needed MD5 hashing a while back (early Feb), nothing was available except through external DLLs. JSThePatriot has been working on either embedded functions or a plugin, either of which would be nice. Anyways, the only code I could ever find was either C, Java, or VBScript. Since the code snippet posted above, I went back to it. nakuribon's script is nice too, however, I believe there is too much overhead to have to "_UnHex()" the VBCode before adding it, why not just leave it as it is? Either way, it will allow scripters to be able to support MD5 Strings in autoit without requiring external files (one of the main reasons for AutoIt: no external files needed) Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
piccaso Posted November 29, 2005 Share Posted November 29, 2005 one of the main reasons for AutoIt: no external files neededFileInstall() ?... i like dll's CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted November 29, 2005 Author Share Posted November 29, 2005 I don't understand why an external DLL should be required to make sure that even one file has the correct MD5 or SHA-1 checksum. Being a portable automation program, I think that it should be able to natively check for data integrity. Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
erifash Posted November 30, 2005 Share Posted November 30, 2005 At the time I was playing around with unhex. I feel it's a neater way to store information, albeit slow. My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver Link to comment Share on other sites More sharing options...
jftuga Posted November 30, 2005 Share Posted November 30, 2005 (edited) Is there a UDF (with or without a .dll) to compute the md5 of a file? It didn't look like eriflash's nor this one would do files, just strings. -John Edited November 30, 2005 by jftuga Admin_Popup, show computer info or launch shellRemote Manager, facilitates connecting to RDP / VNCProc_Watch, reprioritize cpu intensive processesUDF: _ini_to_dict, transforms ini file entries into variablesUDF: monitor_resolutions, returns resolutions of multiple monitorsReport Computer Problem, for your IT help deskProfile Fixer, fixes a 'missing' AD user profile Link to comment Share on other sites More sharing options...
greenmachine Posted November 30, 2005 Share Posted November 30, 2005 Here's a link to one from Manus Magnus, which is on his MMBot site. http://perso.wanadoo.fr/manus-magnus/files/mm.MD5.Check.exe That should do what you need, but I have a question: what exactly would you use md5 for? I haven't dealt with hashing before, and I don't really get what it's for or how it's used. Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted December 1, 2005 Author Share Posted December 1, 2005 (edited) To verify that files or character data hasn't been modified. Many websites (including this one) use MD5 hashes for password protection, so as to protect the user's original password. If nothing is kept of the original, and it cannot be practically reversed, then the original is nearly impossible to guess. I have personally used it when sending files via email (in an automated script). By taking the MD5 of the file before encrypting and emailing it, I can make sure that it is the same file after it is received (any data loss during transit). Edited December 1, 2005 by MSLx Fanboy Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
mr.underperson Posted June 3, 2006 Share Posted June 3, 2006 For people arriving here from a forum search...http://www.autoitscript.com/forum/index.php?showtopic=21010There is also SHA1 available, check page five or thereabouts (it may be incorporated into the first post by the time you read this).-mu Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now