Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MD5 32 bits encryption

Status
Not open for further replies.

OldSmelly

Programmer
Nov 22, 2001
70
NL
Hello,

I have created a secure website using php and Mysql where the passwords are encrypted with the MD5 hashing methode. In php this wil result in a 32 bits length key.
Now I whan't to upload data from foxpro into this table but foxpro hassn't got a MD5 hash. I have searched the net but only found examples of MD5 routines that result in a 16 bits key.

So my question is Does anyone know how to create a 32 bits md5 hash in visual foxpro
 
Hi OldSmelly,

I'm a bit confused by your post. The MD5 hash function produces a 128-bit (16 byte) message digest. There is no 256-bit (32 byte) MD5. There are 256-bit hash functions... RIPEMD256 and SHA256 for instance. In any event, anyone producing an MD5 message digest that consists of 32 bytes is no longer using true MD5.

The link that mm0000 gave you to my blog will give you the widest selection of hash functions you can get for Visual FoxPro using the vfpencryption.fll. However, the MD5 that is there is really MD5 and as such it produces 128-bit message digests.

boyd.gif

SweetPotato Software Website
My Blog
 
Thinking about it, I think I know what is happening here. The PHP MD5 is being returned as a hexadecimal string. In other words there are 2 hexadecimal characters for each byte.

Using the vfpencryption.fll with Visual FoxPro 9.0 you can produce these hexbinary strings like this...

lcHash = STRCONV(Hash("Some String",5), 15) && hexBinary

After this code runs, lcHash will contain the hex equivalent of the MD5 message digest... and thus it will be 256-bits (32 bytes) long.

boyd.gif

SweetPotato Software Website
My Blog
 
Thanks for all the answers

I will give the vfpencryption.fll a try

Hans
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top