Esempio n. 1
0
 public static byte[] KeyEncryptionKey(byte[] sharedSecret, byte[] ephemeralSharedSecret, byte[] salt)
 {
     byte[] inputKeyingMaterial = Utilities.ConcatArrays(sharedSecret, ephemeralSharedSecret);
     byte[] keyEncryptionKey    = Blake2.KeyDerivation(inputKeyingMaterial, salt, Constants.EncryptionKeyLength);
     Utilities.ZeroArray(ephemeralSharedSecret);
     Utilities.ZeroArray(inputKeyingMaterial);
     return(keyEncryptionKey);
 }
Esempio n. 2
0
 public static byte[] KeyEncryptionKey(byte[] sharedSecret, byte[] ephemeralSharedSecret, byte[] salt)
 {
     byte[] inputKeyingMaterial = Arrays.Concat(sharedSecret, ephemeralSharedSecret);
     byte[] keyEncryptionKey    = Blake2.KeyDerivation(inputKeyingMaterial, salt, Constants.EncryptionKeyLength);
     CryptographicOperations.ZeroMemory(ephemeralSharedSecret);
     CryptographicOperations.ZeroMemory(inputKeyingMaterial);
     return(keyEncryptionKey);
 }
Esempio n. 3
0
 public static byte[] KeyEncryptionKey(byte[] ephemeralSharedSecret, byte[] salt)
 {
     byte[] keyEncryptionKey = Blake2.KeyDerivation(ephemeralSharedSecret, salt, Constants.EncryptionKeyLength);
     Utilities.ZeroArray(ephemeralSharedSecret);
     return(keyEncryptionKey);
 }
Esempio n. 4
0
 public static byte[] KeyEncryptionKey(byte[] ephemeralSharedSecret, byte[] salt)
 {
     byte[] keyEncryptionKey = Blake2.KeyDerivation(ephemeralSharedSecret, salt, Constants.EncryptionKeyLength);
     CryptographicOperations.ZeroMemory(ephemeralSharedSecret);
     return(keyEncryptionKey);
 }