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

            byte[] salt  = Generate.Salt();
            byte[] nonce = Generate.Nonce();
            var    keys  = KeyDerivation.DeriveKeys(passwordBytes, salt, Globals.Iterations, Globals.MemorySize);

            EncryptFile(filePath, encryptedFilePath, salt, nonce, keys, bgwEncryption);
        }
Beispiel #2
0
 private static void GetBenchmarkInputs(out byte[] passwordBytes, out byte[] salt)
 {
     char[] password = "******".ToCharArray();
     passwordBytes = FileEncryption.GetPasswordBytes(password);
     salt          = Generate.Salt();
 }