Table of Contents

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

P byte[]

the bytes of the pass phrase.

S byte[]

the salt to use for this invocation.

N int

CPU/Memory cost parameter. Must be larger than 1, a power of 2 and less than

2^(128 * r / 8)
.
r int

the block size, must be >= 1.

p int

Parallelization parameter. Must be a positive integer less than or equal to

int.MaxValue / (128 * r * 8)
.
dkLen int

the length of the key to generate.

Returns

byte[]

the generated key.