コード例 #1
0
ファイル: Encryption.cs プロジェクト: smalltsky/Kryptor
        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();
 }