Documentation ¶
Overview ¶
Package md5 implements a Django compatible MD5 algorithm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrHashComponentMismatch = errors.New("unchained/md5: hashed password components mismatch") ErrAlgorithmMismatch = errors.New("unchained/md5: algorithm mismatch") ErrSaltContainsDollarSing = errors.New("unchained/md5: salt contains dollar sign ($)") ErrSaltIsEmpty = errors.New("unchained/md5: salt is empty") )
Errors returned by UnsaltedMD5PasswordHasher and/or MD5PasswordHasher.
Functions ¶
This section is empty.
Types ¶
type MD5PasswordHasher ¶
type MD5PasswordHasher struct { // Algorithm identifier. Algorithm string }
MD5PasswordHasher implements Salted MD5 password hasher.
func NewMD5PasswordHasher ¶
func NewMD5PasswordHasher() *MD5PasswordHasher
NewMD5PasswordHasher secures password hashing using Salted MD5 algorithm (not recommended).
type UnsaltedMD5PasswordHasher ¶
type UnsaltedMD5PasswordHasher struct { // Algorithm identifier. Algorithm string }
UnsaltedMD5PasswordHasher implements a simple MD5 password hasher.
func NewUnsaltedMD5PasswordHasher ¶
func NewUnsaltedMD5PasswordHasher() *UnsaltedMD5PasswordHasher
NewUnsaltedMD5PasswordHasher is an incredibly insecure algorithm that should never be used. It stores unsalted MD5 hashes without the algorithm prefix, also hashes with an empty salt.
This algorithm is implemented because Django used to store passwords this way and to accept such password hashes.
Click to show internal directories.
Click to hide internal directories.