示例#1
0
        /// <summary>
        /// Decrypts the contained data with the specific <see cref="CtrBlockCipher"/>.
        /// </summary>
        /// <param name="pb">The data to decrypt.</param>
        /// <param name="cipher">The cipher to use.</param>
        /// <returns>A new <see cref="ProtectedBinary"/> which contains the decrypted data.</returns>
        public static ProtectedBinary Decrypt(this ProtectedBinary pb, CtrBlockCipher cipher)
        {
            var data = pb.ReadData();

            cipher.Decrypt(data, 0, data.Length);

            var result = new ProtectedBinary(true, data);

            MemUtil.ZeroByteArray(data);

            return(result);
        }
示例#2
0
 public void Decrypt(byte[] DataBlock, int Offset, int Count)
 {
     m_Cipher.Decrypt(DataBlock, Offset, Count);
 }