Exemple #1
0
            public byte[] decrypt(byte[] encryptedData)
            {
                int index = 0;

                byte[] key, iv;
                bool   isCompressed = getKeyIv(getHeaderData(encryptedData, ref index), out key, out iv);
                var    data         = DeobUtils.desDecrypt(encryptedData, index, encryptedData.Length - index, key, iv);

                if (isCompressed)
                {
                    data = DeobUtils.inflate(data, inflater);
                }
                return(data);
            }
Exemple #2
0
            public byte[] decrypt(byte[] encryptedData)
            {
                byte[] key, iv;
                var    reader       = new BinaryReader(new MemoryStream(encryptedData));
                bool   isCompressed = getHeaderData(reader, out key, out iv);
                var    data         = DeobUtils.desDecrypt(encryptedData,
                                                           (int)reader.BaseStream.Position,
                                                           (int)(reader.BaseStream.Length - reader.BaseStream.Position),
                                                           key, iv);

                if (isCompressed)
                {
                    data = DeobUtils.inflate(data, true);
                }
                return(data);
            }