[Solved] AES encryption on file over 1GB
You are reading the entire file at the start of the method: byte[] bytesToBeEncrypted = File.ReadAllBytes(file); This is causing the OutOfMemoryException. Here’s an idea of how you’d do this: static void EncryptFile(string file, string password) { byte[] passwordBytes = Encoding.UTF8.GetBytes(password); byte[] salt = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }; … Read more