private static void Encrypt(string fileName) { if (Path.GetExtension(fileName) == ".encrypt") return; Console.WriteLine($">>>>>Encrypting '{ fileName }'."); Cryptographer cryptographer = new Cryptographer(); File.Delete($"{fileName}.encrypt"); byte[] encryptedText = cryptographer.Encrypt(File.ReadAllBytes(fileName)); File.WriteAllBytes($"{fileName}.encrypt", encryptedText); Console.WriteLine($"<<<<<Finished encrypting '{ fileName}'."); }
private static string Encrypt(string item) { Cryptographer cryptographer = new Cryptographer(); return cryptographer.Encrypt(item); }