Exemplo n.º 1
0
        /// <summary>
        /// Encrypts the contained data with the specific <see cref="CtrBlockCipher"/>.
        /// </summary>
        /// <param name="pb">The data to encrypt.</param>
        /// <param name="cipher">The cipher to use.</param>
        /// <returns>A new <see cref="ProtectedBinary"/> which contains the encrypted data.</returns>
        public static ProtectedBinary Encrypt(this ProtectedBinary pb, CtrBlockCipher cipher)
        {
            var data = pb.ReadData();

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

            var result = new ProtectedBinary(true, data);

            MemUtil.ZeroByteArray(data);

            return(result);
        }
Exemplo n.º 2
0
 public void Encrypt(byte[] DataBlock, int Offset, int Count)
 {
     m_Cipher.Encrypt(DataBlock, Offset, Count);
 }