SymmetricAlgorithm.EncryptCfb 方法

定義

多載

EncryptCfb(Byte[], Byte[], PaddingMode, Int32)

使用 CFB 模式與指定的填補模式和意見反應大小來加密資料。

EncryptCfb(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, PaddingMode, Int32)

使用 CFB 模式與指定的填補模式和意見反應大小來加密資料。

EncryptCfb(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32)

使用 CFB 模式搭配指定的填補模式和意見反應大小,將資料加密至指定的緩衝區。

EncryptCfb(Byte[], Byte[], PaddingMode, Int32)

來源:
SymmetricAlgorithm.cs
來源:
SymmetricAlgorithm.cs
來源:
SymmetricAlgorithm.cs

使用 CFB 模式與指定的填補模式和意見反應大小來加密資料。

public byte[] EncryptCfb (byte[] plaintext, byte[] iv, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.None, int feedbackSizeInBits = 8);
member this.EncryptCfb : byte[] * byte[] * System.Security.Cryptography.PaddingMode * int -> byte[]
Public Function EncryptCfb (plaintext As Byte(), iv As Byte(), Optional paddingMode As PaddingMode = System.Security.Cryptography.PaddingMode.None, Optional feedbackSizeInBits As Integer = 8) As Byte()

參數

plaintext
Byte[]

要加密的資料。

iv
Byte[]

初始化向量。

paddingMode
PaddingMode

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

feedbackSizeInBits
Int32

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

傳回

Byte[]

加密的加密文字資料。

例外狀況

plaintextivnull

paddingMode 不是有效的填補模式。

-或-

feedbackSizeInBits 不是正數或表示整數位節。

iv 是不正確的長度。 呼叫端預期會傳遞完全 BlockSize 長度的初始化向量,並轉換成位元組 (BlockSize / 8) 。

無法成功加密純文字。

-或-

意見反應大小對演算法無效。

備註

這個方法的行為是由 TryEncryptCfbCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32, Int32) 定義。

適用於

EncryptCfb(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, PaddingMode, Int32)

來源:
SymmetricAlgorithm.cs
來源:
SymmetricAlgorithm.cs
來源:
SymmetricAlgorithm.cs

使用 CFB 模式與指定的填補模式和意見反應大小來加密資料。

public byte[] EncryptCfb (ReadOnlySpan<byte> plaintext, ReadOnlySpan<byte> iv, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.None, int feedbackSizeInBits = 8);
member this.EncryptCfb : ReadOnlySpan<byte> * ReadOnlySpan<byte> * System.Security.Cryptography.PaddingMode * int -> byte[]
Public Function EncryptCfb (plaintext As ReadOnlySpan(Of Byte), iv As ReadOnlySpan(Of Byte), Optional paddingMode As PaddingMode = System.Security.Cryptography.PaddingMode.None, Optional feedbackSizeInBits As Integer = 8) As Byte()

參數

plaintext
ReadOnlySpan<Byte>

要加密的資料。

iv
ReadOnlySpan<Byte>

初始化向量。

paddingMode
PaddingMode

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

feedbackSizeInBits
Int32

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

傳回

Byte[]

加密的加密文字資料。

例外狀況

paddingMode 不是有效的填補模式。

-或-

feedbackSizeInBits 不是正數或表示整數位節。

iv 是不正確的長度。 呼叫端預期會傳遞完全 BlockSize 長度的初始化向量,並轉換成位元組 (BlockSize / 8) 。

無法成功加密純文字。

-或-

意見反應大小對演算法無效。

備註

這個方法的行為是由 TryEncryptCfbCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32, Int32) 定義。

適用於

EncryptCfb(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32)

來源:
SymmetricAlgorithm.cs
來源:
SymmetricAlgorithm.cs
來源:
SymmetricAlgorithm.cs

使用 CFB 模式搭配指定的填補模式和意見反應大小,將資料加密至指定的緩衝區。

public int EncryptCfb (ReadOnlySpan<byte> plaintext, ReadOnlySpan<byte> iv, Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.None, int feedbackSizeInBits = 8);
member this.EncryptCfb : ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.PaddingMode * int -> int
Public Function EncryptCfb (plaintext As ReadOnlySpan(Of Byte), iv As ReadOnlySpan(Of Byte), destination As Span(Of Byte), Optional paddingMode As PaddingMode = System.Security.Cryptography.PaddingMode.None, Optional feedbackSizeInBits As Integer = 8) As Integer

參數

plaintext
ReadOnlySpan<Byte>

要加密的資料。

iv
ReadOnlySpan<Byte>

初始化向量。

destination
Span<Byte>

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

paddingMode
PaddingMode

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

feedbackSizeInBits
Int32

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

傳回

寫入 destination 的總位元組數。

例外狀況

paddingMode 不是有效的填補模式。

-或-

feedbackSizeInBits 不是正數或表示整數位節。

iv 是不正確的長度。 呼叫端預期會傳遞完全 BlockSize 長度的初始化向量,並轉換成位元組 (BlockSize / 8) 。

無法成功加密純文字。

-或-

意見反應大小對演算法無效。

備註

這個方法的行為是由 TryEncryptCfbCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32, Int32) 定義。

適用於