10.03.2011, 18:18
(
Последний раз редактировалось Teprey; 12.03.2011 в 10:56.
)
HASH plugin (v0.2)
I have decided to release my all-in-one Hashing and HMAC:ing solution.
It uses OpenSSL as cryptographic library.
It provides two new native functions:
native hhash(algid, input[], buffer[], buflen);
For calculating message digest (hash)
native hhash_hmac(algid, input[], key[], buffer[], buflen);
For calculating Hash based message authentication code (HMAC)
It has currently support for 6 hashing algorithms:
MD5, SHA-1, SHA-256, SHA-512, RIPEMD-160 and Whirlpool.
All of these algorithms can also be used in HMAC mode.
Example
outputs "9e107d9d372bb6826bd81d3542a419d6" which is correct MD5 hex string hash for that string
Updates
README contains essential information
ATTENTION! Currently compiled linux binary has whirlpool hash disabled because I wasnt able to install correct OpenSSL version with Whirlpool support into my compile machine. You can enable whirlpool support if you have correct OpenSSL by removing "#define HASH_WHIRLPOOL_ENABLED" line from "hash.cpp" and compiling again.
DOWNLOAD SOURCE + WINDOWS DLL + LINUX BINARY
I have decided to release my all-in-one Hashing and HMAC:ing solution.
It uses OpenSSL as cryptographic library.
It provides two new native functions:
native hhash(algid, input[], buffer[], buflen);
For calculating message digest (hash)
native hhash_hmac(algid, input[], key[], buffer[], buflen);
For calculating Hash based message authentication code (HMAC)
It has currently support for 6 hashing algorithms:
MD5, SHA-1, SHA-256, SHA-512, RIPEMD-160 and Whirlpool.
All of these algorithms can also be used in HMAC mode.
Example
pawn Код:
new str[H_MD5_LEN];
hhash(H_MD5, "The quick brown fox jumps over the lazy dog", str, H_MD5_LEN);
printf(str);
Updates
- 12.3.2011: Again tweaked hex string function for some speed gain
- 11.3.2011: Modified hex string function to more proper code style (old was able to cause crash, also now using alloca by default)
README contains essential information
ATTENTION! Currently compiled linux binary has whirlpool hash disabled because I wasnt able to install correct OpenSSL version with Whirlpool support into my compile machine. You can enable whirlpool support if you have correct OpenSSL by removing "#define HASH_WHIRLPOOL_ENABLED" line from "hash.cpp" and compiling again.
DOWNLOAD SOURCE + WINDOWS DLL + LINUX BINARY