Beispiel #1
0
        Stream GetExtractDecryptor(Stream input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            Stream input2;

            if (_Encryption_FromZipFile == EncryptionAlgorithm.PkzipWeak)
            {
                input2 = new ZipCipherStream(input, _zipCrypto_forExtract, CryptoMode.Decrypt);
            }

#if AESCRYPTO
            else if (_Encryption_FromZipFile == EncryptionAlgorithm.WinZipAes128 ||
                     _Encryption_FromZipFile == EncryptionAlgorithm.WinZipAes256)
            {
                input2 = new WinZipAesCipherStream(input, _aesCrypto_forExtract, _CompressedFileDataSize, CryptoMode.Decrypt);
            }
#endif

            else
            {
                input2 = input;
            }

            return(input2);
        }
        Stream GetExtractDecryptor(Stream input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            Stream input2;

            if (_Encryption_FromZipFile == EncryptionAlgorithm.PkzipWeak)
            {
                input2 = new ZipCipherStream(input, _zipCrypto_forExtract, CryptoMode.Decrypt);
            }



            else
            {
                input2 = input;
            }

            return(input2);
        }
        Stream GetExtractDecryptor(Stream input)
        {
            if (input == null) throw new ArgumentNullException("input");

            Stream input2;
            if (_Encryption_FromZipFile == EncryptionAlgorithm.PkzipWeak)
                input2 = new ZipCipherStream(input, _zipCrypto_forExtract, CryptoMode.Decrypt);

#if AESCRYPTO
            else if (_Encryption_FromZipFile == EncryptionAlgorithm.WinZipAes128 ||
                 _Encryption_FromZipFile == EncryptionAlgorithm.WinZipAes256)
                input2 = new WinZipAesCipherStream(input, _aesCrypto_forExtract, _CompressedFileDataSize, CryptoMode.Decrypt);
#endif

            else
                input2 = input;

            return input2;
        }