Page 1 of 1

MD5 hash -- need help

Posted: Sat Aug 08, 2009 6:24 am
by shadowslash
How do I get the MD5 Hash of a file? Are there any PlugIns or externals to do just that? If I'm going to do it manually through mind breaking calculations, how do I do it?

NOTE:
I know that most of you will answer "Why not use the md5Digest function instead?" so here's my answer. I need to get the MD5 Hash, not the digest so that it returns a series of numbers and letters (e.g. 5d3325fe7c6b04981a6abfa9bfa94c58) and not a lot of mumbo jumbo characters. I need it to be this way so that the file structure of a program I'm making wouldn't be too complicated.

Posted: Sat Aug 08, 2009 9:16 am
by Mark
Dear shadowslash,

Digest and hash are the same. Usually they are presented in hex form, rather than mumbojumbo form. You can achieve that by means of the binaryDecodefunction.

Code: Select all

put url "file:<path to file>" into myData
put md5Digest(myData) into myMumboJumbo
get binarydecode("H*",myMumboJumbo,myHash)
put myHash --> 6d756d626f6a756d626f (sample)
Best,

Mark

Posted: Sun Aug 09, 2009 6:04 am
by shadowslash
That bit of code worked! Thanks.... Image

Re: MD5 hash -- need help

Posted: Sat Dec 06, 2014 9:37 pm
by alemrantareq
thanks Mark for the script; now I can encrypt a word with md5 hash. but how to decrypt the same thing? I tried to use binaryencode but it gives wrong report :(

Re: MD5 hash -- need help

Posted: Sat Dec 06, 2014 9:41 pm
by Mark
Hi,

Hashes work one way. You can't decode them. (But there are now lists for the md5 hash, which sometimes allow you to look up the original string of a hash).

Kind regards,

Mark

Re: MD5 hash -- need help

Posted: Sun Dec 07, 2014 1:31 pm
by alemrantareq
I see there are some online decoders available which can decode md5 hash...is it possible to bring it into rev script?

Re: MD5 hash -- need help

Posted: Sun Dec 07, 2014 2:24 pm
by Mark
Hi,

Since you cant decode md5, those decoders don't seem to do what you think they do, but if you give an example of what you want to do exactly, perhaps we can use them. Do you have a link to those decoders?

Kind regards,

Mark

Re: MD5 hash -- need help

Posted: Sun Dec 07, 2014 2:36 pm
by alemrantareq
http://www.hashkiller.co.uk/md5-decrypter.aspx

this is the decoder which can decode almost every md5 hashes perfectly. I tried to find the source. but seems it works with some external javscripts. here're some md5 hashes I've tried to decode:

Code: Select all

d99fe76e1e3b1cbfb029869b40f19887
f5a574a0fca7376241d045b16f677ae9
3c4dce9aea556c3f27b8b1dd2e8987ae
982966947a612364d45e1989d7940a4f
88c98f2e37be980d92f8aa1bd6d929e1
f5f50eed1a617882b2ddf6c48d514feb
5dc71b9d48aa35c03a9098bc7537fbb3

Re: MD5 hash -- need help

Posted: Sun Dec 07, 2014 2:43 pm
by Mark
That page doesn't decrypt anything. It has a database with hashes and source strings. When you enter a base64 encoded string, the website looks up the hash and returns the original string. Although there are billions of hashes in their databases, there are many more hashes that aren't.

The website has a forum, where you can ask if there is a command line tool or an API for e.g. PHP. If such a tool or API is available, then you can probably connect to it from within LiveCode.

Kind regards,

Mark

Re: MD5 hash -- need help

Posted: Sun Dec 07, 2014 2:48 pm
by alemrantareq
I better ask them for the API which gives me comfort in making such tool :)

Re: MD5 hash -- need help

Posted: Sun Dec 07, 2014 4:06 pm
by FourthWorld
May i ask your intended use for this?

Re: MD5 hash -- need help

Posted: Sun Dec 07, 2014 5:12 pm
by jacque
Richard's question is mine too. If you are looking for encryption there are other ways to do that which work both directions. md5 is usually just used to verify that a copy of a file or a string matches the original.