WinAES encryption

May 12, 2010 at 3:00 AM

Hi,

I am using Zip reduced version, and when I query the enum of EncryptionAlgorithm I can't find WinAES.

How do I enable WinAES algorithm?

Coordinator
May 12, 2010 at 3:23 AM

What version of the library are you using?

I just looked in v1.9.1.6, and the AES encryption is in there.

May 12, 2010 at 3:35 AM

version DotNetZip-src-v1.9.1.5

The class is like this

public enum EncryptionAlgorithm
    {
        None = 0,
        PkzipWeak,

#if AESCRYPTO
        WinZipAes128,
        WinZipAes256,
#endif
        Unsupported = 4,
    }

The AES is supported if only AESCRYPTO is defined, may I know how to turn this flag on? And with what condition?

Coordinator
May 12, 2010 at 4:59 PM

You turn it on when you compile the source.

It is by default, ON, when compiling the full library or the reduced library.   Off when compiling for the Compact Framework.  

Where did you get the DotNetZip binary you're using?  Did you compile the source?

 

May 13, 2010 at 5:20 AM

1. I get the source from http://dotnetzip.codeplex.com/releases/view/27890, download this file DotNetZip-src-v1.9.1.5.zip (the source)
2. Then I don't want a separate DLL, I create two folders in my library project, folder one is Zip Reduced, folder two is ZLib. Zip Reduced contains all files from reduced project, while ZLib contains all files from zlib project. Then I compile my library project.
3. Then using my dll, I am writing code like this :

            using (ZipFile zip = new ZipFile())
            {                
                zip.Encryption = EncryptionAlgorithm.PkzipWeak;
                zip.AddEntry(filename, bytes);
                zip.Save(response.OutputStream);
            }

When typing EncryptionAlgorithm + dot (the intellisense only shows None, PkzipWeak and Unsupported).
May I know what files contains code to turn AESCRYPTO off?

Coordinator
May 13, 2010 at 12:58 PM
innosia wrote:

When typing EncryptionAlgorithm + dot (the intellisense only shows None, PkzipWeak and Unsupported).
May I know what files contains code to turn AESCRYPTO off?

 Compile-time constants like AESCRYPTO are typically turned ON in the .csproj file.