Question: We store database backups encrypted with **PGP Command Line 9.7.0**. Files look like **2009.bak.pgp**

Here's command line used to backup these files:

```
pgp --encrypt F:\2009.bak --recipient admin@company.mail --encrypt-to-self --input-cleanup off --temp-dir F:\TEMP\ -v    

```

All of these backups were restored just fine with this command

```
pgp --decrypt F:\2009.bak.pgp --passphrase "18_characters_password" --temp-dir F:\Temp -v --output F:\2009.bak

```

All of them, except one, which fails with this error:

```
Decoding file F:\2009.bak.pgp... 32% (2.1GB)   F:\2009.bak.pgp:decrypt (3090:operation failed, error decompressing data)
Wiping file F:\Temp\pgp-5532-0.tmp... 1%

```

I also tried to decrypt this file on Linux machine with this command:

```
gpg -v <2009.bak.pgp> 2009.bak

```

But it also fails with this error:

```
gpg: Fatal: zlib inflate problem: invalid block type

```

Is it somehow possible to recover this file? Maybe with HEX-editor or something like that? We really need to recover this file!

I appreciate any suggestions!

Answer: 
Decompression happens after decryption, so it's theoretically possible to get GPG to write out the compressed data stream. I'm not sure there's a stock option to do that-- you'll probably have to hack around in the source. 

Once you've got the corrupt data stream, though, I'm [not sure you're going to have much hope](https://stackoverflow.com/questions/5558371/is-it-possible-to-recover-corrupted-zlib-data-beyond-the-corrupted-section) for getting the data back. I'm seeing that zlib output with [full flush points](http://en.wikipedia.org/wiki/Zlib#Error_handling) can be partially recovered, but I'm not up on the technical details of how zlib compression is used in PGP. If I had to guess I'd say that you're out of luck.

Were this my data I'd try to hack GPG to write out the compressed stream, then get cozy with documentation for zlib and see what I could work out. 

It sounds like you didn't verify your backup could be restored when you made the backup. If nothing else, you're learning a valuable lesson about testing restores before you actually *need* them.
Contact a data recovery company, I've had great success with www.ESSDataRecovery.com (1.800.237.4200) and they give free estimates. They may be able to either recover the backup file or the original data, if you still have the media it was on. They've probably worked with corrupt PGP files before.

Also get in touch with Symantec (they now own PGP), they may require you purchase an up to date license/support contract before helping at least decrypt the file.