Bewerken

Delen via


SymmetricAlgorithm.GetCiphertextLengthCfb(Int32, PaddingMode, Int32) Method

Definition

Gets the length of a ciphertext with a given padding mode and plaintext length in CFB mode.

public int GetCiphertextLengthCfb (int plaintextLength, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.None, int feedbackSizeInBits = 8);
member this.GetCiphertextLengthCfb : int * System.Security.Cryptography.PaddingMode * int -> int
Public Function GetCiphertextLengthCfb (plaintextLength As Integer, Optional paddingMode As PaddingMode = System.Security.Cryptography.PaddingMode.None, Optional feedbackSizeInBits As Integer = 8) As Integer

Parameters

plaintextLength
Int32

The plaintext length, in bytes.

paddingMode
PaddingMode

The padding mode used to pad the plaintext to the feedback size.

feedbackSizeInBits
Int32

The feedback size, in bits.

Returns

The length, in bytes, of the ciphertext with padding.

Exceptions

feedbackSizeInBits is not a positive number.

-or-

plaintextLength is a negative number.

-or-

plaintextLength when padded is too large to represent as a signed 32-bit integer.

-or-

paddingMode is not a valid padding mode.

The padding mode None was used, but plaintextLength is not a whole number of blocks.

-or-

feedbackSizeInBits is not a whole number of bytes. It must be divisible by 8.

Remarks

feedbackSizeInBits accepts any value that is a valid feedback size, regardless if the algorithm supports the specified feedback size.

Applies to