Go package scrypt implements the scrypt key derivation function as defined in Colin Percival's paper "Stronger Key Derivation via Sequential Memory-Hard Functions".
Go
Switch branches/tags
Nothing to show
Latest commit c4d8efe Jan 5, 2013 @dchest Make 2x faster.
Now uses uint32s instead of bytes for internal calculation.

benchmark       old ns/op    new ns/op    delta
BenchmarkKey    266430525    126657130  -52.46%

Also updated other code to go.crypto version.
Permalink
Failed to load latest commit information.
AUTHORS Make 2x faster. Jan 17, 2013
CONTRIBUTORS Make 2x faster. Jan 17, 2013
LICENSE Make 2x faster. Jan 17, 2013
README Make 2x faster. Jan 17, 2013
scrypt.go Make 2x faster. Jan 17, 2013
scrypt_test.go Make 2x faster. Jan 17, 2013

README

!!! NOTE !!!

Official go.crypto repository now includes scrypt implementation.
(http://code.google.com/p/go/source/detail?r=ad8a96e038bb&repo=crypto)
Please use it instead of this one, as it will be supported there.

Link: http://code.google.com/p/go/source/browse?repo=crypto

It is compatible with this implementation, so to switch to it,
just change the import path to "code.google.com/p/go.crypto/scrypt".

!!!

Go implementation of scrypt key derivation function.
(http://www.tarsnap.com/scrypt.html)

INSTALLATION

    $ go get github.com/dchest/scrypt

PACKAGE
    import "github.com/dchest/scrypt"

    Package scrypt implements the scrypt key derivation function as defined
    in Colin Percival's paper "Stronger Key Derivation via Sequential
    Memory-Hard Functions".

FUNCTIONS

func Key(password, salt []byte, N, r, p, keyLen int) ([]byte, error)

    Key derives a key from the password, salt and cost parameters, returning
    a byte slice of length keyLen that can be used as cryptographic key.

    N is a CPU/memory cost parameter, must be a power of two greater than 1.
    r and p must satisfy r * p < 2³⁰. If the parameters do not satisfy the
    limits, the function returns a nil byte slice and an error.

    For example, you can get a derived key for e.g. AES-256 (which needs a
    32-byte key) by doing:

        dk := scrypt.Key([]byte("some password"), salt, 16384, 8, 1, 32)

    The recommended parameters for interactive logins as of 2009 are N=16384,
    r=8, p=1. They should be increased as memory latency and CPU parallelism
    increases. Remember to get a good random salt.

KEYWORDS
   
    go, golang, scrypt, kdf