MD5 in Natural?

Hallo all!

Has anybody written a real Natural-Implementation of the md5-Algorithm?(info: MD5 - Wikipedia )

I think: In C, Java, perl etc. it’s not that difficult. But Natural is not really good for this (no unsigned little endian integers, no bitwise OR/XOR).

Any ideas to solve this?

Thanks,

Matthias

You’re right. Natural is good for writing business applications, not scientific apps. Best would be to write the module in C or assembler, then call it from Natural.

I think it’s less scientific than it sounds. A few months ago I would have used it to store passwords (i.e. to store the hash of it). Now I would need it for data comparisons (i.e. compare checksums to find out, whether it has been changed or not).

Well, sounds like I got no choice.

Perhaps USR4011N would suffice.

Thank you. I did a search for “md5” in SYSEXT, so I didn’t find other algorithms :oops:

One little remark:

A zero length input results in hash = H’0000000’.

define data local
1 #b (B) dynamic
1 #b156 (B156)
1 #hash (B20)
end-define
callnat 'USR4011N' 0 #b156 #b #hash
display #hash
end

That’s incorrect. Secure Hash Algorithm – Wikipedia says, that a null-String has the sha1-hash H’da39a3ee5e6b4b0d3255bfef95601890afd80709’