Skip to content

IStaticDataSource with AES 256 Encryption #385

Closed

Description

@skhilliard

Steps to reproduce

  1. Define a simple data source that implements the IStaticDataSource interface:
public class CustomStaticDataSource : IStaticDataSource
{
	private Stream _stream;

	// Implement method from IStaticDataSource
	public Stream GetSource()
	{
		return _stream;
	}

	// Call this to provide the memorystream
	public void SetStream(Stream inputStream)
	{
		_stream = inputStream;
		_stream.Position = 0;
	}
}
  1. Use this data source to add a new ZIP entry to a ZipFile whose password is set using this method:

void Add(IStaticDataSource dataSource, ZipEntry entry);

Where the entry has the desired name and entry.AESKeySize is set to 256.

Expected behavior

Zip file is produced that is password protected using AES encryption.

Actual behavior

Zip file is produced, but using weaker ZipCrypto encryption.

Version of SharpZipLib

1.2.0 (for .NET Core)

Obtained from (only keep the relevant lines)

  • Package installed using NuGet

Activity

  1. Numpsy commented on Sep 26, 2019

    @Numpsy
    Contributor

    ZipFile is missing some pieces it needs to support AES encryption of entries (was it actually possible to request it to prior to 1.2.0?).

    I started looking at filling in the holes, but haven't had time to get it done.

  2. Numpsy commented on Feb 5, 2020

    @Numpsy
    Contributor

    @piksel As long as ZipFile doesn't support the creation of entries with AES encryption, would it be better if the (IStaticDataSource dataSource, ZipEntry entry) version of Add threw when you tried to add such an entry instead of silently not using AES?

  3. piksel commented on Feb 6, 2020

    @piksel
    Member

    Yeah, I agree.

  4. added
    zip
    on Feb 28, 2020
  5. piksel commented on Nov 10, 2020

    @piksel
    Member

    I am closing this as it should have been fixed by #420. Note that ZipFile still doesn't support AES, but at least now it won't silently use another encryption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    encryptionzip

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions