SymmetricAlgorithm.EncryptCfb 方法

定義

多載

名稱 Description
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
來源:
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
來源:
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
來源:
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)

適用於