-
Notifications
You must be signed in to change notification settings - Fork 3
Key Derivation
Chrono edited this page Dec 28, 2022
·
2 revisions
For detailed documentation, kindly refer to official libsodium.
Context accepts either 8 bytes of data or 8 ASCII character.
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());