entry.IsEncrypted is false when a 7z file has an AesDecoderStream #419

Closed
opened 2026-01-29 22:11:38 +00:00 by claunia · 4 comments
Owner

Originally created by @Sicos1977 on GitHub (Oct 12, 2020).

Is it somehow possible to set the IsEncrypted to true when the 7z file has an AesDecoderStream?

I use the IsEncrypted flag to check is a file is password protected so in this case I would expect it to be true

    internal static Stream CreateDecoderStream(CMethodId id, Stream[] inStreams, byte[] info, IPasswordProvider pass,
                                               long limit)
    {
        switch (id._id)
        {
            case K_COPY:
                if (info != null)
                {
                    throw new NotSupportedException();
                }
                return inStreams.Single();
            case K_LZMA:
            case K_LZMA2:
                return new LzmaStream(info, inStreams.Single(), -1, limit);
            case CMethodId.K_AES_ID:
                return new AesDecoderStream(inStreams.Single(), info, pass, limit);
            case K_BCJ:
Originally created by @Sicos1977 on GitHub (Oct 12, 2020). Is it somehow possible to set the IsEncrypted to true when the 7z file has an AesDecoderStream? I use the IsEncrypted flag to check is a file is password protected so in this case I would expect it to be true internal static Stream CreateDecoderStream(CMethodId id, Stream[] inStreams, byte[] info, IPasswordProvider pass, long limit) { switch (id._id) { case K_COPY: if (info != null) { throw new NotSupportedException(); } return inStreams.Single(); case K_LZMA: case K_LZMA2: return new LzmaStream(info, inStreams.Single(), -1, limit); case CMethodId.K_AES_ID: return new AesDecoderStream(inStreams.Single(), info, pass, limit); case K_BCJ:
claunia added the bugup for grabs labels 2026-01-29 22:11:39 +00:00
Author
Owner

@Sicos1977 commented on GitHub (Oct 15, 2020):

Any updates on this?

@Sicos1977 commented on GitHub (Oct 15, 2020): Any updates on this?
Author
Owner

@Sicos1977 commented on GitHub (Oct 19, 2020):

Any updates?

@Sicos1977 commented on GitHub (Oct 19, 2020): Any updates?
Author
Owner

@adamhathcock commented on GitHub (Oct 19, 2020):

Happy to accept pull requests

@adamhathcock commented on GitHub (Oct 19, 2020): Happy to accept pull requests
Author
Owner

@Sicos1977 commented on GitHub (Oct 21, 2020):

If you can give me some ideas how to do this I would be happy to do it.

@Sicos1977 commented on GitHub (Oct 21, 2020): If you can give me some ideas how to do this I would be happy to do it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#419