NaviServer - programmable web server
4.99  5.0

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

ns_crypt(n) 5.0.0a naviserver "NaviServer Built-in Commands"

Name

ns_crypt - Encrypt a string for use as a password

Table Of Contents

Synopsis

Description

This command encrypts the key using the salt and returns the encrypted string. It uses the same algorithm as the Unix crypt command. Normally, key is a password, of which the first 8 bytes are significant, and salt is one or two bytes used to encrypt the key. The string returned should always be 13 characters long and is usable as the password field in nscp and nsperm authentication. The algorithm used is a one-way cipher, which means that the original plain-text key cannot be derived knowing the encrypted string alone. However, since only up to the first 8 bytes of key are significant, only a 64-bit key is effectively used, which is reasonably attacked with modern computers with ordinary brute-force attacks today.

COMMANDS

ns_crypt key salt

EXAMPLES

 % ns_crypt password qy
 qyz8eIFW3uJoo

See Also

ns_base64, ns_hmac, ns_md, ns_md5, ns_sha1, nsd

Keywords

crypto, encoding, global built-in