Page 1 of 3

Cryptographic Hash Functions Collection (IncludeFile)

Posted: Thu Aug 02, 2007 2:40 pm
by JCV
Cryptographic Hash Functions IncludeFile

Includes the following algorithms:
Whirlpool
RIPEMD160
MD2
MD4
MD5
HAVAL256
GOST
SHA
SHA1
SHA224
SHA256
SHA384
SHA512

Sample Use
Global string_sample.= "The quick brown fox jumps over the lazy dog"

Debug PureHash_WhirlpoolFingerprint(@string_sample, Len(string_sample))
Debug PureHash_RIPEMD160Fingerprint(@string_sample, Len(string_sample))
Debug PureHash_MD2Fingerprint(@string_sample, Len(string_sample))
Debug PureHash_MD4Fingerprint(@string_sample, Len(string_sample))
Debug PureHash_MD5Fingerprint(@string_sample, Len(string_sample))
Debug PureHash_HAVAL256Fingerprint(@string_sample, Len(string_sample))
Debug PureHash_GOSTFingerprint(@string_sample, Len(string_sample))
Debug PureHash_SHAFingerprint(@string_sample, Len(string_sample))
Debug PureHash_SHA1Fingerprint(@string_sample, Len(string_sample))
Debug PureHash_SHA224Fingerprint(@string_sample, Len(string_sample))
Debug PureHash_SHA256Fingerprint(@string_sample, Len(string_sample))
Debug PureHash_SHA384Fingerprint(@string_sample, Len(string_sample))
Debug PureHash_SHA512Fingerprint(@string_sample, Len(string_sample))
Debug PureHash_WhirlpoolFileFingerprint("C:\test.log")
Debug PureHash_RIPEMD160FileFingerprint("C:\test.log")
Debug PureHash_MD2FileFingerprint("C:\test.log")
Debug PureHash_MD4FileFingerprint("C:\test.log")
Debug PureHash_MD5FileFingerprint("C:\test.log")
Debug PureHash_GOSTFileFingerprint("C:\test.log")
Debug PureHash_SHAFileFingerprint("C:\test.log")
Debug PureHash_SHA1FileFingerprint("C:\test.log")
Debug PureHash_SHA224FileFingerprint("C:\test.log")
Debug PureHash_SHA256FileFingerprint("C:\test.log")
Debug PureHash_SHA384FileFingerprint("C:\test.log")
Debug PureHash_SHA512FileFingerprint("C:\test.log")
Download:
http://purebasic.jcvsite.com/v4/HashLib.zip

Use at your own risk. :wink:

Posted: Thu Aug 02, 2007 7:00 pm
by Inf0Byt3
Amazing! Thank you!

Posted: Thu Aug 02, 2007 9:28 pm
by srod
Looks very useful indeed, thank you very much. 8)

Posted: Thu Aug 02, 2007 9:43 pm
by Sebe
Your my personal hero of the month :D
All we need now are easy to use and good documented cipher functions for AES, Twofish, etc.

Posted: Fri Aug 03, 2007 3:37 am
by JCV
Updated:
-Now supports FileFingerprint
-Code cleanup

Supported FileFingerprint Functions:
Debug PureHash_WhirlpoolFileFingerprint("c:\data.rar")
Debug PureHash_RIPEMD160FileFingerprint("c:\data.rar")
Debug PureHash_MD2FileFingerprint("c:\data.rar")
Debug PureHash_MD4FileFingerprint("c:\data.rar")
Debug PureHash_MD5FileFingerprint("c:\data.rar")
Debug MD5FileFingerprint("c:\data.rar")
; Debug PureHash_HAVAL256FileFingerprint("c:\data.rar"); NOT YET WORKING
Debug PureHash_GOSTFileFingerprint("c:\data.rar")
Debug PureHash_SHAFileFingerprint("c:\data.rar")
Debug PureHash_SHA1FileFingerprint("c:\data.rar")
Debug PureHash_SHA224FileFingerprint("c:\data.rar")
Debug PureHash_SHA256FileFingerprint("c:\data.rar")
Debug PureHash_SHA384FileFingerprint("c:\data.rar")
Debug PureHash_SHA512FileFingerprint("c:\data.rar")
Not currently supported:
PureHash_HAVAL256FileFingerprint - I'm getting some invalid memory headaches. :?

I compared built-in MD5 in PB and PureHash_MD5 is 3X faster. :)

Posted: Fri Aug 03, 2007 4:00 am
by byo
Really really nice.

Posted: Fri Aug 03, 2007 11:59 am
by Inf0Byt3
@JCV

Can you make this lib support threadsafe? When I use it and enable the threadsafe flad in the compiler options, I get 'Unresolved external symbol _PB_StringBasePosition'.

Posted: Fri Aug 03, 2007 2:18 pm
by Joakim Christiansen
JCV wrote:I compared built-in MD5 in PB and PureHash_MD5 is 3X faster. :)
Wow, pretty good!

Posted: Fri Aug 03, 2007 2:47 pm
by JCV
Updated:
Added
-ThreadSafe PureLib
-Unicode PureLib
-Unicode ThreadSafe PureLib

Posted: Fri Aug 03, 2007 5:34 pm
by Inf0Byt3
Super! Thank you for the fast update :D.

Posted: Sat Aug 04, 2007 3:37 pm
by michaeled314
Why don't you release a help file too

Posted: Sun Aug 05, 2007 8:09 am
by JCV
michaeled314 wrote:Why don't you release a help file too
Do I really need to make? What only differs in built-in pb function is the algorithm used. (NAMEFileFingerprint and NAMEFingerprint) :?

Posted: Sun Aug 12, 2007 1:22 pm
by Jacobus
JCV wrote:
michaeled314 wrote:Why don't you release a help file too
Do I really need to make?
yes, or else, your great lib will be use only by the best programers. Isn't it a shame?. Would you make this help, for all cryptographic functions of your lib 8) please.

Thanks

Posted: Mon Aug 20, 2007 6:11 pm
by PBUser
Hi,

the Lib is great, but if i enable ThreadSafe, i get this error message:

Image

is that a bug in the library? i have copied all the files in the right directory. (The Lib in PureLibraries\UserLibraries and the SubSystem Files in Subsystem\[Directory])

i have to use TheadSafe, otherwise i get an IMA in my program. when i saw, that it does'nt work with PB4.10beta, i tried PB4.02, but there was the same error.

Can u help me please?

Posted: Tue Aug 21, 2007 7:42 am
by gnozal
PBUser wrote:Hi,
the Lib is great, but if i enable ThreadSafe, i get this error message: ...
Did you enable the 'UserLibThreadSafe' subsystem in the IDE ?