Share via


SymmetricAlgorithm.GetCiphertextLengthCbc(Int32, PaddingMode) 方法

定義

取得具有指定填補模式和 CBC 模式中純文字長度的加密文字長度。

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

參數

plaintextLength
Int32

純文本長度,以位元組為單位。

paddingMode
PaddingMode

用來將純文本填補到演算法區塊大小的填補模式。

傳回

具有填補之加密文字的長度,以位元組為單位。

例外狀況

plaintextLength 為負數。

-或-

plaintextLength 當填補太大而無法以帶正負號的32位整數表示時。

-或-

paddingMode 不是有效的填補模式。

BlockSize 不是正整數。

-或-

BlockSize 不是整數字節。 它必須由 8 區分。

已使用填補模式 None ,但 plaintextLength 不是整數區塊。

適用於