cryptutil

package
v0.0.0-...-9c21ab8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apr1Crypt

func Apr1Crypt(password string, salt string) string

This is the MD5 hashing function out of Apache's apr1 program. The algorithm is insane, but we have to match it. Mercifully I found a PHP variant of it at

http://stackoverflow.com/questions/2994637/how-to-edit-htpasswd-using-php

in an answer. That reads better than the original C, and is easy to instrument. We will eventually go back to the original apr_md5.c for inspiration when the PHP gets too weird. The algorithm makes more sense if you imagine the original authors in a pub, drinking beer and rolling dice as the fundamental design process. Note that this is the same algorithm used in md5Crypt except for the prefix in md5Crypt is $1$ while in apr1 it's $apr1$

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL