/// <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); }
public void Encrypt(byte[] DataBlock, int Offset, int Count) { m_Cipher.Encrypt(DataBlock, Offset, Count); }