Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-06

SHA1 implementation

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Does FPC contain a cross-platform SHA1 algorithm implementation? I used Lazarus IDE's "Search in files" feature across the whole FPC 2.2.5 and saw some references to the word sha1, but nothing that looks like the actual implementation.

Regards,
- Graeme -

________________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Paul Nicholls

"Graeme Geldenhuys"
wrote in message

Show quoted text 11 lines
Hi, Does FPC contain a cross-platform SHA1 algorithm implementation? I used Lazarus IDE's "Search in files" feature across the whole FPC 2.2.5 and saw some references to the word sha1, but nothing that looks like the actual implementation. Regards, - Graeme -

Hi Graeme,
Maybe this will help?

http://wiki.freepascal.org/DCPcrypt

cheers,
Paul

Graeme Geldenhuys
David Butler wrote
Have a look at Fundamentals 4's cHash unit: http://sourceforge.net/projects/fundementals/

Thanks, there are some interesting code in there... Cool. :)

In the end I did some more Google'ing and found a free implementation based on the FIPS 180-1 document. And it's all done in a single unit, which makes it nice and easy to use.

I wrote a few unit tests just to confirm that the implementation is correct - and it was. :-) The code is free of any license restrictions or platform specific code, so would FPC find a unit like this useful in the FCL? It makes no difference to me, but I thought I would ask.

Regards,
- Graeme -

_______________________________________________________ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Graeme Geldenhuys
to Paul Nicholls: "Graeme Geldenhuys" wrote in message Maybe this will help?…
Paul Nicholls wrote

Ah thanks, I already use the Blowfish implementation from that package, but for some reason never thought to look in there for the SHA1 implementation. In the end I got a nice lightweight (single unit) implementation that also passes all unit tests based on various documentation.

Regards,
- Graeme -

_______________________________________________________ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/