raw

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package raw provides a raw implementation of the modular-crypt-wrapped scrypt primitive.

Index

Constants

View Source
const (
	// The current recommended N value for interactive logins.
	RecommendedN = 16384
	// The current recommended r value for interactive logins.
	Recommendedr = 8
	// The current recommended p value for interactive logins.
	Recommendedp = 1
)

Variables

View Source
var ErrInvalidStub = fmt.Errorf("invalid scrypt password stub")

Functions

func Parse

func Parse(stub string) (salt, hash []byte, N, r, p int, err error)

Parse parses a scrypt modular hash or stub string. The format is as follows:

$s2$N$r$p$salt$hash    // hash
$s2$N$r$p$salt         // stub

func ScryptSHA256

func ScryptSHA256(password string, salt []byte, N, r, p int) string

Wrapper for golang.org/x/crypto/scrypt that implements a sensible modular crypt interface.

password must be a plaintext password in UTF-8 format. salt must be a random salt value in binary form. N, r, and p are parameters for scrypt.

Returns a modular crypt hash.

Types

This section is empty.

Jump to

Keyboard shortcuts

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