Difference between revisions of "Nssha1"

From AOLserver Wiki
Jump to navigation Jump to search
(Added salted example.)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
The nssha1 module provides the ns_sha1 function:
+
The nssha1 module provides the [[ns_sha1]] function.
  
Example:
+
'''Installation'''
  
<pre>
+
Debian users can install this module for aolserver4 with:
set sRawPassword "mypassword"
+
<pre>apt-get install aolserver4-nssha1</pre>
set sPassword [ns_sha1 $sRawPassword]
+
 
ns_adp_puts $sPassword
+
On FreeBSD and OS X nssha1 doesn't compile without editing nssha1.c.
# 04003622EB9D0F788CE7568C7EED23809534365A
+
Comment out the following 2 lines (lines 139-140):
</pre>
 
  
Usually this function is used with a salt, as without a salt it is succeptible to dictionary-based attacks.
+
// typedef unsigned int u_int32_t;
 +
// typedef unsigned char u_int8_t;
  
 +
'''Configuration'''
 
<pre>
 
<pre>
set sSalt "salty"
+
ns_section "ns/server/${servername}/modules"
set sRawPassword "mypassword"
+
ns_param  nssha1            nssha1.so
set sPassword [ns_sha1 ${sRawPassword}${sSalt}]
 
# B48FB74597C11FC609DBE912992085EB07847FB6
 
 
</pre>
 
</pre>
 
Debian users can install this module for aolserver4 with:
 
<pre>apt-get install aolserver4-nssha1</pre>
 

Latest revision as of 11:52, 31 January 2007

The nssha1 module provides the ns_sha1 function.

Installation

Debian users can install this module for aolserver4 with:

apt-get install aolserver4-nssha1

On FreeBSD and OS X nssha1 doesn't compile without editing nssha1.c. Comment out the following 2 lines (lines 139-140):

// typedef unsigned int u_int32_t;
// typedef unsigned char u_int8_t;

Configuration

ns_section "ns/server/${servername}/modules"
ns_param   nssha1             nssha1.so