Le 6 oct. 08 à 19:09, Anthony Martinez a écrit :
> Searching the archives, I've read that Paul Guyot has implemented MD5
> for the Newton. However, he didn't split it out of APOP, and the
> source
> isn't available. Would you be amenable to releasing the source to
> APOP,
> Paul?
>
> The program I'm working on, by the by, is an OPIE aka S/Key
> calculator,
> which I haven't found on UNNA, and is the only thing that I'm missing
> from my Palm device.
>
> Failing finding an OPIE app that I've just overlooked, or an
> implementation of MD5, I suppose I can implement the algorithm myself,
> though it'd probably be fairly slow in NewtonScript...
I've just uploaded the source code of APOP here:
http://www.kallisys.com/files/newton/Utils/APOP-1.0-source.zip
You can directly include the APOP.ntkc binary file that is included
in this archive (with and without debug). It exports a function
called ComputeMD5Digest:
call APOP.ComputeMD5Digest with ( someString )
This returns a string with the md5 sum of the input string in
hexadecimal.
This function is fine for APOP and it should be fine for S/Key, but
please be aware that this project was literaly coded and built in
less than 2 hours. The limitations are the following (they're
mentioned in the comments, albeit in French) :
- the input is a Unicode String (UCS-2), but it is (virtually)
converted to ISO-8859-1. In other words, the high order 8 bits are
thrown out.
- you will only get the MD5 sum of the first 512 bytes.
If you have some knowledge of C, you might want to install Newton C++
Tools (APOP comes with a regular MPW Makefile) and work out on the
MD5 implementation to clean it up and optimize it. For example, it
might be interesting to work on a binary instead of working on a string.
Regards,
Paul
====================================================================
The NewtonTalk Mailing List - http://www.newtontalk.net/
The Official Newton FAQ - http://www.splorp.com/newton/faq/
The Newton Glossary - http://www.splorp.com/newton/glossary/
WikiWikiNewt - http://tools.unna.org/wikiwikinewt/
====================================================================
Received on Mon Oct 6 15:31:59 2008
This archive was generated by hypermail 2.1.8 : Mon Oct 06 2008 - 16:30:01 EDT