private static void WriteDecryptedLinesToFile(string fileName, string targetFilepath, IEncryptor decryptor, System.Collections.Generic.IEnumerable <string> lines) { using (StreamWriter sw = File.CreateText(targetFilepath)) { sw.Write("Id,HT,FT" + Environment.NewLine); byte[] DecryptionKey = Encryptor.GetDecryptKey(Path.Combine(Environment.CurrentDirectory, @"keys.env")); foreach (string line in lines) { sw.Write(decryptor.Decrypted(line, DecryptionKey)); } } }