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)

Source:
SymmetricAlgorithm.cs
Source:
SymmetricAlgorithm.cs
Source:
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)

Source:
SymmetricAlgorithm.cs
Source:
SymmetricAlgorithm.cs
Source:
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)

Source:
SymmetricAlgorithm.cs
Source:
SymmetricAlgorithm.cs
Source:
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)定义。

适用于