SCrypt GetEffectivePbkdf2Salt Method CryptSharp
The SCrypt algorithm creates a salt which it then uses as a one-iteration PBKDF2 key stream with SHA256 HMAC. This method lets you retrieve this intermediate salt.

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

public static byte[] GetEffectivePbkdf2Salt(
	byte[] key,
	byte[] salt,
	int cost,
	int blockSize,
	int parallel,
	Nullable<int> maxThreads
)

Parameters

key
Type:  OnlineSystem Byte 
The key to derive from.
salt
Type:  OnlineSystem Byte 
The salt. A unique salt means a unique SCrypt stream, even if the original key is identical.
cost
Type: OnlineSystem Int32
The cost parameter, typically a fairly large number such as 262144. Memory usage and CPU time scale approximately linearly with this parameter.
blockSize
Type: OnlineSystem Int32
The mixing block size, typically 8. Memory usage and CPU time scale approximately linearly with this parameter.
parallel
Type: OnlineSystem Int32
The level of parallelism, typically 1. CPU time scales approximately linearly with this parameter.
maxThreads
Type: OnlineSystem Nullable OnlineInt32 
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.

Return Value

The effective salt.
See Also