Example #1
0
func main() {
	// pw, salt, magic
	log.Printf(string(auth.MD5Crypt([]byte("hello"), []byte("J.w5a/.."), []byte("$apr1$"))))
}
Example #2
0
func GetMD5Hash(pass string) string {
	salt := []byte("dlPL2MqE")
	magic := []byte("$1$")
	return string(auth.MD5Crypt([]byte(pass), salt, magic))
}
Example #3
0
func Secret(user, realm string) string {
	if user == "john" {
		return string(auth.MD5Crypt([]byte("hello"), []byte("435345"), []byte("$1$")))
	}
	return ""
}
Example #4
0
func Secret(user, realm string) string {
	a := auth.MD5Crypt([]byte(adminPassword), []byte("gjnjVexnjNfr"), []byte("$1$"))
	return string(a)
}
func Secret(config tomlConfig, user, realm string) string {
	if user == config.WebServer.AuthUsername {
		return string(auth.MD5Crypt([]byte(config.WebServer.AuthPassword), []byte("J.w7a-.1"), []byte("$apr1$")))
	}
	return ""
}