flat assembler
Message board for the users of flat assembler.

Index > Windows > Someone have a MD5 implementation on fasm?

Author
Thread Post new topic Reply to topic
Piluex



Joined: 22 Jan 2005
Posts: 10
Piluex
Someone have a MD5 implementation on fasm?
Post 26 Jan 2005, 01:14
View user's profile Send private message Reply with quote
iklin



Joined: 20 Mar 2004
Posts: 120
Location: Russia, Siberia
iklin
There is MD5 mplementation on masm and it is not so hard to convert it into fasm.


Description: MD5 on MASM
Download
Filename: md5.rar
Filesize: 1.56 KB
Downloaded: 197 Time(s)

Post 26 Jan 2005, 02:20
View user's profile Send private message ICQ Number Reply with quote
Piluex



Joined: 22 Jan 2005
Posts: 10
Piluex
Thanks.
Post 27 Jan 2005, 15:30
View user's profile Send private message Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend
Here you have ready implementation made by a friend of mine. In fact he created MASM version (can't convince him to FASM Wink) and I adapted it to FASM.


Description: FASM MD5 Implementation
Download
Filename: stuff_rewolf_md5.zip
Filesize: 8.87 KB
Downloaded: 284 Time(s)

Post 02 Feb 2005, 21:26
View user's profile Send private message Visit poster's website Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi
This compiles ok, but certainly does not show up the correct hash... ive tried about everything already Sad


Code:
include '%fasminc%\win32ax.inc'
.code
include '%fasminc%\rewolf_md5.inc'
start:
        invoke  lstrlen,szString
        push    eax
        push    szString
        push    szMD5Hash
        call    _rwf_md5
        invoke  MessageBox,0,szMD5Hash,szMsgCaption,0
        invoke  ExitProcess,0

.data
        szString                db      "omg",0
        szMD5Hash               db      40      dup     (?)
        szMsgCaption    db      "MD5",0
.end start    


this is from rewolf_md5.inc about how it should be called,
push size of datablock
push offset datablock
push offset destHash
call _rwf_md5

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 27 Jan 2006, 18:46
View user's profile Send private message MSN Messenger Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
You need to convert 16-byte binary to 32-byte ASCII:
Code:
;outStr - where to put the ASCII
; inStr - where to take the 16-byte binary
Buf2Msg:
  mov     ecx,16
  mov     edi,outStr
.anotherchar:
  mov     al,byte[inStr+ecx-1]
  mov     ah,al
  and     ax, 0FF0h
  shr     al,4
  cmp     al,10
  jc      .num1
  add     al,7+20h ;Remove +20h to get uppercase
 .num1:
  add     al,30h
  cmp     ah,10
  jc      .num2
  add     ah,7+20h ;Remove +20h to get uppercase
 .num2:
  add     ah,30h
  mov     word[edi+ecx*2-2],ax
  loop    .anotherchar
  ret
    
Post 27 Jan 2006, 23:10
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi
thanks Madis731. Smile

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 28 Jan 2006, 03:54
View user's profile Send private message MSN Messenger Reply with quote
Crukko



Joined: 26 Nov 2005
Posts: 118
Crukko
Can someone explain me what MD5 is?
Thx Wink
Post 10 Feb 2006, 05:58
View user's profile Send private message Reply with quote
weiss



Joined: 03 Jan 2006
Posts: 25
weiss
Its pretty obvious you're winding me up again! Rolling Eyes
Post 10 Feb 2006, 14:11
View user's profile Send private message Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend
Crukko: md5 is a hash algorithm. It means that it computes for your data of any size a special number which is characteristic. Even if you change a bit in the source data the result will be much different. And that's the most needed function. If you download a file and know original file's md5 checksum you can check if you downloaded the correct file because as I said even a bit wrongly downloaded (or changed during transmission or whatever) changed md5. Also it's nearly impossible (that's the assumption of all hash algorithms) to get original data from md5 checksum.
md5(data) = checksum - easy thing
anti_md5(checksum) = data - impossible!
Post 10 Feb 2006, 17:06
View user's profile Send private message Visit poster's website Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi
but nowadays there is huuuge rainbow tables for "cracking" MD5... and collision(two different data produces same hash) are possible also...


http://en.wikipedia.org/wiki/MD5

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 10 Feb 2006, 17:47
View user's profile Send private message MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.