{"modulePath":"code.cloudfoundry.org/cli-sapi","version":"v6.1.1+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package scrypt\n\nPackage scrypt implements the scrypt key derivation function as defined in Colin Percival's paper \"Stronger Key Derivation via Sequential Memory-Hard Functions\" ([http://www.tarsnap.com/scrypt/scrypt.pdf](http://www.tarsnap.com/scrypt/scrypt.pdf)).\n\n## Functions\n\n```go\nfunc Key(password, salt []byte, N, r, p, keyLen int) ([]byte, error)\n```\nKey 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\nN is a CPU/memory cost parameter, which must be a power of two greater than 1. r and p must satisfy r \\* p \\\u003c 2³⁰. If the parameters do not satisfy the limits, the function returns a nil byte slice and an error.\n\nFor example, you can get a derived key for e.g. AES-256 (which needs a 32-byte key) by doing:\n\n\tdk := scrypt.Key([]byte(\"some password\"), salt, 16384, 8, 1, 32)\n\nThe 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.\n\n","path":"code.cloudfoundry.org/cli-sapi/src/code.google.com/p/go.crypto/scrypt","name":"scrypt","synopsis":"Package scrypt implements the scrypt key derivation function as defined in Colin Percival's paper \"Stronger Key Derivation via Sequential Memory-Hard Functions\" (http://www.tarsnap.com/scrypt/scrypt.pdf).","isRedistributable":true}
