Skip to main content
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:31 AM UTC

Uniface 9: MD5 Character encoding

MD5 Character encoding

Author: amonserrat@sfa-durango.gob.mx (jr_naxera)

Hello,

A bit of a silly problem, I hope. I am using MD5 to create digest for passwords in a web application, at the front end I use Javascript and at the backend the MD5digest function included in uenc.dll. However, I have somre trouble, as the string produced by MD5digest seems to lack a few chars, its length oscillates between 14 and 16, instead of keeping at 16, so it is imposible to compare it to the incoming string.

14 replies

Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:31 AM UTC

MD5 Character encoding

Author: amonserrat@sfa-durango.gob.mx (jr_naxera)

Hello,

A bit of a silly problem, I hope. I am using MD5 to create digest for passwords in a web application, at the front end I use Javascript and at the backend the MD5digest function included in uenc.dll. However, I have somre trouble, as the string produced by MD5digest seems to lack a few chars, its length oscillates between 14 and 16, instead of keeping at 16, so it is imposible to compare it to the incoming string.

There is at least somebody (me) interested.

Success, Uli


Author: ulrich-merkel (ulrichmerkel@web.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:31 AM UTC

MD5 Character encoding

Author: amonserrat@sfa-durango.gob.mx (jr_naxera)

Hello,

A bit of a silly problem, I hope. I am using MD5 to create digest for passwords in a web application, at the front end I use Javascript and at the backend the MD5digest function included in uenc.dll. However, I have somre trouble, as the string produced by MD5digest seems to lack a few chars, its length oscillates between 14 and 16, instead of keeping at 16, so it is imposible to compare it to the incoming string.

Hi,

How do you "access" the MD5Digest function? Do you use a C call-out signature? I've done a couple of tests and I get "reliable" results when I use a C call-out signature where the return value (the parameter called Digest) is defined as RAW.

The only thing one has to keep in mind is that the data returned is not actually binary, but it is "encoded" in the Uniface Meta Format TRX. So there is a "small challenge" translating the TRX into HEX values. But the Proc (4GL) involved is only about 50 lines of code - probably wont win a "beauty contest", but it seems to work. If anybody is interested then I could post an export of the form with the mentioned code here.

Hope this helps.

Best regards,
Daniel


Author: diseli (daniel.iseli@uniface.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:31 AM UTC

MD5 Character encoding

Author: amonserrat@sfa-durango.gob.mx (jr_naxera)

Hello,

A bit of a silly problem, I hope. I am using MD5 to create digest for passwords in a web application, at the front end I use Javascript and at the backend the MD5digest function included in uenc.dll. However, I have somre trouble, as the string produced by MD5digest seems to lack a few chars, its length oscillates between 14 and 16, instead of keeping at 16, so it is imposible to compare it to the incoming string.

Hi larry,

thanks for your reply; was it easy to install and use?

Success, Uli

P.S. I have not found a file/string with this digest so far: but the scenario to test is:

will it return the correct digest even if it contains null byte(s). Like: 0100030405060708090A0B0C0D0E0FFF

 

 


Author: ulrich-merkel (ulrichmerkel@web.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:31 AM UTC

MD5 Character encoding

Author: amonserrat@sfa-durango.gob.mx (jr_naxera)

Hello,

A bit of a silly problem, I hope. I am using MD5 to create digest for passwords in a web application, at the front end I use Javascript and at the backend the MD5digest function included in uenc.dll. However, I have somre trouble, as the string produced by MD5digest seems to lack a few chars, its length oscillates between 14 and 16, instead of keeping at 16, so it is imposible to compare it to the incoming string.

I was able to run your example -- md5 (from string and file) of Hello World was consistently b10a8db164e0754105b7a99be72e3fe5.


Author: hoss (adkinsl@proware.com)