raw

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2016 License: BSD-3-Clause 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 RecommendedN = 16384

The current recommended N value for interactive logins.

View Source
const Recommendedp = 1

The current recommended p value for interactive logins.

View Source
const Recommendedr = 8

The current recommended r value for interactive logins.

Variables

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

Indicates that a password hash or stub is invalid.

Functions

func Parse

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

Parses an 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 implementing a sensible modular crypt interface.

password should be a UTF-8 plaintext password. salt should be a random salt value in binary form.

N, r and p are parameters to 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