Class SCrypt
- Namespace
- Org.BouncyCastle.Crypto.Generators
- Assembly
- BouncyCastle.Cryptography.dll
Implementation of the scrypt a password-based key derivation function.
public class SCrypt
- Inheritance
-
SCrypt
- Inherited Members
Remarks
Scrypt was created by Colin Percival and is specified in draft-josefsson-scrypt-kd.
Methods
Generate(byte[], byte[], int, int, int, int)
Generate a key using the scrypt key derivation function.
public static byte[] Generate(byte[] P, byte[] S, int N, int r, int p, int dkLen)
Parameters
Pbyte[]the bytes of the pass phrase.
Sbyte[]the salt to use for this invocation.
NintCPU/Memory cost parameter. Must be larger than 1, a power of 2 and less than
.2^(128 * r / 8)rintthe block size, must be >= 1.
pintParallelization parameter. Must be a positive integer less than or equal to
.int.MaxValue / (128 * r * 8)dkLenintthe length of the key to generate.
Returns
- byte[]
the generated key.