summaryrefslogtreecommitdiffstats
path: root/common/passwd.h
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-03-21 23:18:58 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-03-21 23:18:58 +0100
commit062a3c92343a5fa371f8637f8bca88aacca14cc4 (patch)
tree2c5e024321104521279bc106ab382714c50c5c7d /common/passwd.h
parent1c210fcaa962f2771ab1c1cf5f60dbb7dd458ce5 (diff)
downloadeurephia-062a3c92343a5fa371f8637f8bca88aacca14cc4.tar.gz
eurephia-062a3c92343a5fa371f8637f8bca88aacca14cc4.tar.xz
eurephia-062a3c92343a5fa371f8637f8bca88aacca14cc4.zip
Added new password hashing function with proper SHA512 hashing
This new function, eurephia_pwd_crypt(...) implements a modified SHA512 hashing algorithm based on the SHA512 crypt implementation proposed by Ulrich Drepper for glibc. The original implementation adds support for variable hashing rounds. The eurephia version implements dynamic hashing rounds, controlled by minimum and maximum rounds set in the configuration. If not set, it will minimum use 5000 rounds and maximum 7500 rounds. The amount of rounds is supposed to be random. In addition to this, the salt information is now encoded into a hex value. In this value the salt length and the hash rounds are defined. This hex value is then encoded (quasi crypt) based on a modulus of the sum of the characters in the password + the password length. So if you give the wrong password, you will also get the wrong salt length and the wrong number of hashing rounds used. The default salt length is also increased to 32 bytes (256 bit)
Diffstat (limited to 'common/passwd.h')
-rw-r--r--common/passwd.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/passwd.h b/common/passwd.h
index 6c3b2b2..0f05228 100644
--- a/common/passwd.h
+++ b/common/passwd.h
@@ -23,6 +23,7 @@
typedef enum { pwdSHA512 } pwdHASH;
+char *eurephia_pwd_crypt(eurephiaCTX *ctx, const char *key, const char *salt);
char *passwdhash(pwdHASH algo, const char *salt, const char *pwd);
#endif