예제 #1
0
        public static void InitializeEncryption(string filePath, byte[] passwordBytes, BackgroundWorker bgwEncryption)
        {
            string encryptedFilePath = GetEncryptedFilePath(filePath);

            byte[] salt = Generate.Salt();
            (byte[] encryptionKey, byte[] macKey) = KeyDerivation.DeriveKeys(passwordBytes, salt, Globals.Iterations, Globals.MemorySize);
            EncryptFile(filePath, encryptedFilePath, salt, encryptionKey, macKey, bgwEncryption);
        }
예제 #2
0
 private static void GetBenchmarkInputs(out byte[] passwordBytes, out byte[] salt)
 {
     char[] password = "******".ToCharArray();
     passwordBytes = FileEncryption.GetPasswordBytes(password);
     salt          = Generate.Salt();
 }