SCrypt.ComputeDerivedKey Method

CryptSharp

SCryptComputeDerivedKey Method CryptSharp
Computes a derived key.

Namespace: CryptSharp.Utility
Assembly: CryptSharp (in CryptSharp.dll) Version: 2.1.0.0
Syntax

public static byte[] ComputeDerivedKey(
	byte[] key,
	byte[] salt,
	int cost,
	int blockSize,
	int parallel,
	Nullable<int> maxThreads,
	int derivedKeyLength
)
Public Shared Function ComputeDerivedKey ( 
	key As Byte(),
	salt As Byte(),
	cost As Integer,
	blockSize As Integer,
	parallel As Integer,
	maxThreads As Nullable(Of Integer),
	derivedKeyLength As Integer
) As Byte()
public:
static array<unsigned char>^ ComputeDerivedKey(
	array<unsigned char>^ key, 
	array<unsigned char>^ salt, 
	int cost, 
	int blockSize, 
	int parallel, 
	Nullable<int> maxThreads, 
	int derivedKeyLength
)
static member ComputeDerivedKey : 
        key : byte[] * 
        salt : byte[] * 
        cost : int * 
        blockSize : int * 
        parallel : int * 
        maxThreads : Nullable<int> * 
        derivedKeyLength : int -> byte[] 

Parameters

key
Type: SystemByte
The key to derive from.
salt
Type: SystemByte
The salt. A unique salt means a unique SCrypt stream, even if the original key is identical.
cost
Type: SystemInt32
The cost parameter, typically a fairly large number such as 262144. Memory usage and CPU time scale approximately linearly with this parameter.
blockSize
Type: SystemInt32
The mixing block size, typically 8. Memory usage and CPU time scale approximately linearly with this parameter.
parallel
Type: SystemInt32
The level of parallelism, typically 1. CPU time scales approximately linearly with this parameter.
maxThreads
Type: SystemNullableInt32
The maximum number of threads to spawn to derive the key. This is limited by the parallel value. null will use as many threads as possible.
derivedKeyLength
Type: SystemInt32
The desired length of the derived key.

Return Value

Type: Byte
The derived key.
See Also

Reference