SymmetricAlgorithm.TryEncryptCfbCore 方法

定義

在衍生類別中覆寫時,嘗試使用 CFB 模式搭配指定的填補模式和意見反應大小,將資料加密至指定的緩衝區。

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

參數

plaintext
ReadOnlySpan<Byte>

要加密的資料。

iv
ReadOnlySpan<Byte>

初始化向量。

destination
Span<Byte>

要接收加密文字資料的緩衝區。

paddingMode
PaddingMode

用來產生加密文字並在解密期間移除的填補模式。

feedbackSizeInBits
Int32

以位為單位指定的意見反應大小。

bytesWritten
Int32

當這個方法傳回時,包含寫入 至 destination 的位元組總數。

傳回

true 如果 destination 夠大,無法接收加密的資料,則為 ,否則為 false

例外狀況

衍生類別尚未提供實作。

備註

衍生類別必須覆寫這個,並提供實作。

這個方法的實作必須精確地撰寫GetCiphertextLengthCfb(plaintext.Length, paddingMode, feedbackSizeInBits) 位元組到 destination ,並透過 bytesWritten 回報。

適用於