SCryptGetEffectivePbkdf2Salt 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.1.0.0
Syntax
public static byte[] GetEffectivePbkdf2Salt( byte[] key, byte[] salt, int cost, int blockSize, int parallel, Nullable<int> maxThreads )
Public Shared Function GetEffectivePbkdf2Salt ( key As Byte(), salt As Byte(), cost As Integer, blockSize As Integer, parallel As Integer, maxThreads As Nullable(Of Integer) ) As Byte()
public: static array<unsigned char>^ GetEffectivePbkdf2Salt( array<unsigned char>^ key, array<unsigned char>^ salt, int cost, int blockSize, int parallel, Nullable<int> maxThreads )
static member GetEffectivePbkdf2Salt : key : byte[] * salt : byte[] * cost : int * blockSize : int * parallel : int * maxThreads : Nullable<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.
Return Value
Type: ByteThe effective salt.
See Also