Decrypting gzip file

Hello

I am fetching an XML file form an external source which is encrypted using gzip, in my application

How can I decrypt it and extract the XMP out of it to parse it.

I am using .NET 3.5 with C#
jbajajAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kaylanreilorCommented:
You could try to use ZLib through a C++ DLL called from your .Net assembly : http://www.codeproject.com/KB/security/CryptoLibCP.aspx.

Or, probably could you do it in 2 step:
1. unzip with System.IO.Compression.GZipStream class
2. decrypt using System.Security.Cryptography.RijndaelManaged class
http://www.obviex.com/samples/Encryption.aspx

I'm not 100% sure the second solution would work (let's give a try) but the first will in any cases.
0
Mike_MozhaevCommented:
Hello,
Decompression can be performed by either GZipStream or DeflateStream classes depending on the format of compressed data.
As for extracting XMP you could load xml in XmlDocument and use SelectSingleNode() with XPath expression to find this node.
0
Amandeep Singh BhullarCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kaylanreilorCommented:
Wait a minute, I thought we were talking about files encrypted with gzip and not only compressed. Else of course, it is far more easier.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.