Derives a key of any length from a password using the SCRYPT algorithm.
public static byte[] Scrypt( int dkLen, byte[] pwdBytes, byte[] salt, int N, int r, int p )
Public Shared Function Scrypt ( dkLen As Integer, pwdBytes As Byte(), salt As Byte(), N As Integer, r As Integer, p As Integer ) As Byte()
// Test vectors from [RFC7914] // scrypt (P="password", S="NaCl", N=1024, r=8, p=16, dkLen=64) int dkLen = 64; byte[] pwd = System.Text.Encoding.Default.GetBytes("password"); byte[] salt = System.Text.Encoding.Default.GetBytes("NaCl"); byte[] key = Pbe.Scrypt(dkLen, pwd, salt, 1024, 8, 16); Debug.Assert(key.Length > 0, "ERROR with Pbe.Scrypt"); Console.WriteLine("dk={0}", key.ToHex()); // FDBABE1C9D3472007856E7190D01E9FE7C6AD7CBC8237830E77376634B373162 // 2EAF30D92E22A3886FF109279D9830DAC727AFB94A83EE6D8360CBDFA2CC0640
VB6/C equivalent: PBE_Scrypt