Documentation
¶
Overview ¶
Package md5_crypt implements the standard Unix MD5-Crypt algorithm created by Poul-Henning Kamp for FreeBSD.
Index ¶
Constants ¶
const ( CiscoSaltLen = 4 // Cisco IOS only allows salts of length 4. MagicPrefix = "$1$" RandomSalt = "" SaltLenMax = 8 SaltLenMin = 1 // Real minimum is 0, but that isn't useful. )
Variables ¶
This section is empty.
Functions ¶
func Crypt ¶
Crypt takes key and salt strings and performs the MD5-Crypt hashing algorithm on them, returning a full hash string suitable for storage and later password verification.
If the salt string is the value RandomSalt, a randomly-generated salt parameter string will be generated of length SaltLenMax.
func GenerateSalt ¶
Generate a random salt parameter string of a given length.
If the length is greater than SaltLenMax, a string of that length will be returned instead.
Similarly, if length is less than SaltLenMin, a string of that length will be returned instead.
Types ¶
This section is empty.