SymmetricAlgorithm.EncryptCfb 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | 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)
使用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
反饋大小,以位元單位表示。
傳回
加密密文資料。
例外狀況
plaintext 或 iv 為 null。
iv 是錯誤的長度。 呼叫者預期會傳遞長度精確 BlockSize 的初始化向量,並轉換為位元組(BlockSize / 8)。
備註
此方法的行為定義為 TryEncryptCfbCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32, Int32)。
適用於
EncryptCfb(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, PaddingMode, Int32)
使用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
反饋大小,以位元單位表示。
傳回
加密密文資料。
例外狀況
iv 是錯誤的長度。 呼叫者預期會傳遞長度精確 BlockSize 的初始化向量,並轉換為位元組(BlockSize / 8)。
備註
此方法的行為定義為 TryEncryptCfbCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32, Int32)。
適用於
EncryptCfb(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32)
將資料加密到指定的緩衝區,使用 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>
初始化向量。
- paddingMode
- PaddingMode
填充模式用於產生密文並在解密時移除。
- feedbackSizeInBits
- Int32
反饋大小,以位元單位表示。
傳回
寫入 destination的總位元組數。
例外狀況
iv 是錯誤的長度。 呼叫者預期會傳遞長度精確 BlockSize 的初始化向量,並轉換為位元組(BlockSize / 8)。
備註
此方法的行為定義為 TryEncryptCfbCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32, Int32)。