Key Derivation - Chewhern/ASodium GitHub Wiki
For detailed documentation, kindly refer to official libsodium.
Context accepts either 8 bytes of data or 8 ASCII character.
Deriving multiple keys from a high entropy key
Initial Function
public static Byte[] KDFFunction(uint SubKeyLength, ulong SubKeyID, String Context, Byte[] MasterKey,Boolean ClearKey=false)
public static Byte[] KDFFunction(uint SubKeyLength,ulong SubKeyID,Byte[] Context,Byte[] MasterKey,Boolean ClearKey=false)
Example Code
Byte[] RandomLongKey = SodiumRNG.GetRandomBytes(128);
Byte[] SubKey = SodiumKDF.KDFFunction(32, 3, "For Demo", RandomLongKey);
MessageBox.Show("Derived Key = " + new System.Numerics.BigInteger(SubKey).ToString());