Documentation
¶
Index ¶
- func Hashbyte(a ...[]byte) []byte
- func Hashstring(a ...string) string
- func MatchPassword(password string, phash PasswordHash) bool
- func Pbkdf2(password []byte, salt []byte, iterations int, hash func() hash.Hash, ...) (out []byte)
- func SessionKey(rawkey []byte, keylen int) []byte
- func Verifier(I, p []byte, bits int) (Ih, salt, v []byte, err error)
- type GoSrp
- type PasswordHash
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Hashstring ¶
func MatchPassword ¶
func MatchPassword(password string, phash PasswordHash) bool
func Pbkdf2 ¶
func Pbkdf2(password []byte, salt []byte, iterations int, hash func() hash.Hash, outlen int) (out []byte)
Calculate password hash with PKCS#5 PBKDF2 method using the given hash function as HMAC.
func SessionKey ¶
Generate a session key from the raw key
Types ¶
type GoSrp ¶
type GoSrp struct { State int Salt_s []byte Xv_s []byte Salt *big.Int Xv *big.Int XN *big.Int Xg *big.Int Xk *big.Int Key_s string Xb *big.Int Xb_s string XB *big.Int XB_s string Xa *big.Int Xa_s string XA *big.Int XA_s string XI_s []byte XS *big.Int XS_s string XM string XHAMK string Xu *big.Int Xu_s string Xavu *big.Int }
func (*GoSrp) CalculateA ¶
func (*GoSrp) IssueChallenge ¶
func (*GoSrp) TestDump1 ¶
func (gs *GoSrp) TestDump1()
echo "ST/bits= [{$this->ST}/{$this->bits}]\n\n"; echo "verifier= [{$this->verifier}]\n\n"; echo "salt= [{$this->salt}]\n\n"; echo "Nhex= [{$this->Nhex}]\n\n"; echo "g= [{$this->g}]\n\n"; echo "khex= [{$this->khex}]\n\n"; echo "vhex= [{$this->vhex}]\n\n"; echo "key= [{$this->key}]\n\n"; echo "bhex= [{$this->bhex}]\n\n"; echo "Bhex= [{$this->Bhex}]\n\n";
type PasswordHash ¶
func HashPassword ¶
func HashPassword(password string) (out PasswordHash)
Call Pbkdf2 password hash with reasonable defaults (9999 iterations + SHA1 + 64 bytes output).
func HashPasswordWith ¶
func HashPasswordWith(salt []byte, password string) (out PasswordHash)
Call Pbkdf2 with reasonable defaults (9999 iterations + SHA1 + 64 bytes output).