@Andrew,
Thanks for the wicked fast reply. Here's how it goes:
User creates an encrypted file -> an sql dump is performed, that sql file is gzipped, and that gzipped file is encrypted using the following method:
$fh = fopen($filepath.$filename,'w');
fwrite($fh,$encryption->encrypt($theFile,$key));
The file is then downloaded using Content-Type: application/force-download and transfer encoding as binary. I'm thinking the problem occurs here because if the exact same sequence is performed but the file isn't downloaded, then decryption works perfect with the class as is. The decryption is performed the exact same way as the encryption (as shown in the code above) except using the decrypt method, obviously. If I try to decrypt a file that was initially downloaded and subsequently uploaded to the server, then it fails at the line where the mac needs to be authenticated (boy did it take me a long time to find that out!).
Any insight you can provide is fantastic. Do you think the problem really lies in application/octet-stream vs application/force-download?
Everything else regarding the encryption method is exactly as it was posted in the cryptastic class function, including no base64 encoding (as shown by my use of the encrypt method above).
Thanks again! I'm going to give the application/octet-stream a shot while I'm waiting to hear back from you.