Muokkaa

Jaa


SymmetricAlgorithm.TryEncryptCfbCore Method

Definition

When overridden in a derived class, attempts to encrypt data into the specified buffer, using CFB mode with the specified padding mode and feedback size.

protected:
 virtual bool TryEncryptCfbCore(ReadOnlySpan<System::Byte> plaintext, ReadOnlySpan<System::Byte> iv, Span<System::Byte> destination, System::Security::Cryptography::PaddingMode paddingMode, int feedbackSizeInBits, [Runtime::InteropServices::Out] int % bytesWritten);
protected virtual bool TryEncryptCfbCore (ReadOnlySpan<byte> plaintext, ReadOnlySpan<byte> iv, Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode, int feedbackSizeInBits, out int bytesWritten);
abstract member TryEncryptCfbCore : ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.PaddingMode * int * int -> bool
override this.TryEncryptCfbCore : ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.PaddingMode * int * int -> bool
Protected Overridable Function TryEncryptCfbCore (plaintext As ReadOnlySpan(Of Byte), iv As ReadOnlySpan(Of Byte), destination As Span(Of Byte), paddingMode As PaddingMode, feedbackSizeInBits As Integer, ByRef bytesWritten As Integer) As Boolean

Parameters

plaintext
ReadOnlySpan<Byte>

The data to encrypt.

iv
ReadOnlySpan<Byte>

The initialization vector.

destination
Span<Byte>

The buffer to receive the ciphertext data.

paddingMode
PaddingMode

The padding mode used to produce the ciphertext and remove during decryption.

feedbackSizeInBits
Int32

The feedback size, specified in bits.

bytesWritten
Int32

When this method returns, contains the total number of bytes written to destination.

Returns

true if destination was large enough to receive the encrypted data; otherwise, false.

Exceptions

A derived class has not provided an implementation.

Remarks

Derived classes must override this and provide an implementation.

Implementations of this method must write precisely GetCiphertextLengthCfb(plaintext.Length, paddingMode, feedbackSizeInBits) bytes to destination and report that via bytesWritten.

Applies to