Пример #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);
 }
Пример #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);
 }
Пример #3
0
 public static byte[] KeyEncryptionKey(byte[] ephemeralSharedSecret, byte[] salt)
 {
     byte[] keyEncryptionKey = Blake2.KeyDerivation(ephemeralSharedSecret, salt, Constants.EncryptionKeyLength);
     Utilities.ZeroArray(ephemeralSharedSecret);
     return(keyEncryptionKey);
 }
Пример #4
0
 public static byte[] KeyEncryptionKey(byte[] ephemeralSharedSecret, byte[] salt)
 {
     byte[] keyEncryptionKey = Blake2.KeyDerivation(ephemeralSharedSecret, salt, Constants.EncryptionKeyLength);
     CryptographicOperations.ZeroMemory(ephemeralSharedSecret);
     return(keyEncryptionKey);
 }