# How secure is file header encryption for large files?

I'm having trouble location information about whether or not encrypting a file's header is good enough. The files in question are media files that range in size from 500mb to 4GB.

If I had no performance or time constraints, I would simply encrypt the entirety with AES256. However, with my current implementation (in C#), it takes about 3 minutes to decrypt a 2GB file. This is about 2m45s beyond my time limits.

How vulnerable is that file's contents without the file header?

Apologies if this question is silly, this is my first foray into file security.

• 1) What are your security goals? Encrypting only part of the file will not be acceptable under most security goals. 2) A desktop computer should be able to get under 15s as long as IO keeps up. Jan 9, 2015 at 15:24
• Basic security to discourage attempts to use the file. It would be ideal if the entire file could be encrypted but the time to decrypt cannot exceed 15s, so I find myself limited. I also considered some sort of hybrid encryption - AES256 file header and something very fast (and less secure) for the remainder of the file. Jan 9, 2015 at 15:32
• 1) On my computer C#'s AesCryptoService provider takes about 15s for 2GB when using AES128. If you're willing to use native interop you should be able to speed that up a lot, especially if it uses AES-NI. 2) If performance matters, use AES-128 not AES-256. It's still very secure and about 1.4 times faster. Jan 9, 2015 at 15:45
• You might consider replacing your AES implementation with a better (faster) one; as CodesInChaos says, a fast AES implementation should be able to run a lot faster than > 1 minute per Gigabyte. Jan 9, 2015 at 15:45
• I expect disk I/O to be the limiting factor. I have tested 2 libraries (Bouncy Castle, SharpAesCrypt) and will now test with .NET AesCryptoProvider which is fully unmanaged and might provide better performance. Jan 9, 2015 at 15:48