SymmetricAlgorithm.DecryptCbc 方法

定義

多載

DecryptCbc(Byte[], Byte[], PaddingMode)

使用 CBC 模式解密具有指定填補模式的資料。

DecryptCbc(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, PaddingMode)

使用 CBC 模式解密具有指定填補模式的資料。

DecryptCbc(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode)

使用 CBC 模式搭配指定的填補模式,將資料解密至指定的緩衝區。

DecryptCbc(Byte[], Byte[], PaddingMode)

來源:
SymmetricAlgorithm.cs
來源:
SymmetricAlgorithm.cs
來源:
SymmetricAlgorithm.cs

使用 CBC 模式解密具有指定填補模式的資料。

public byte[] DecryptCbc (byte[] ciphertext, byte[] iv, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.PKCS7);
member this.DecryptCbc : byte[] * byte[] * System.Security.Cryptography.PaddingMode -> byte[]
Public Function DecryptCbc (ciphertext As Byte(), iv As Byte(), Optional paddingMode As PaddingMode = System.Security.Cryptography.PaddingMode.PKCS7) As Byte()

參數

ciphertext
Byte[]

要解密的資料。

iv
Byte[]

初始化向量。

paddingMode
PaddingMode

用來產生加密文字並在解密期間移除的填補模式。

傳回

Byte[]

解密的純文字資料。

例外狀況

ciphertextivnull

paddingMode 不是有效的填補模式。

iv 是不正確的長度。 呼叫端預期會傳遞完全 BlockSize 長度的初始化向量,並轉換成位元組 (BlockSize / 8) 。

無法成功解密加密文字。

備註

這個方法的行為是由 TryDecryptCbcCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32) 定義。

適用於

DecryptCbc(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, PaddingMode)

來源:
SymmetricAlgorithm.cs
來源:
SymmetricAlgorithm.cs
來源:
SymmetricAlgorithm.cs

使用 CBC 模式解密具有指定填補模式的資料。

public byte[] DecryptCbc (ReadOnlySpan<byte> ciphertext, ReadOnlySpan<byte> iv, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.PKCS7);
member this.DecryptCbc : ReadOnlySpan<byte> * ReadOnlySpan<byte> * System.Security.Cryptography.PaddingMode -> byte[]
Public Function DecryptCbc (ciphertext As ReadOnlySpan(Of Byte), iv As ReadOnlySpan(Of Byte), Optional paddingMode As PaddingMode = System.Security.Cryptography.PaddingMode.PKCS7) As Byte()

參數

ciphertext
ReadOnlySpan<Byte>

要解密的資料。

iv
ReadOnlySpan<Byte>

初始化向量。

paddingMode
PaddingMode

用來產生加密文字並在解密期間移除的填補模式。

傳回

Byte[]

解密的純文字資料。

例外狀況

paddingMode 不是有效的填補模式。

iv 是不正確的長度。 呼叫端預期會傳遞完全 BlockSize 長度的初始化向量,並轉換成位元組 (BlockSize / 8) 。

無法成功解密加密文字。

備註

這個方法的行為是由 TryDecryptCbcCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32) 定義。

適用於

DecryptCbc(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode)

來源:
SymmetricAlgorithm.cs
來源:
SymmetricAlgorithm.cs
來源:
SymmetricAlgorithm.cs

使用 CBC 模式搭配指定的填補模式,將資料解密至指定的緩衝區。

public int DecryptCbc (ReadOnlySpan<byte> ciphertext, ReadOnlySpan<byte> iv, Span<byte> destination, System.Security.Cryptography.PaddingMode paddingMode = System.Security.Cryptography.PaddingMode.PKCS7);
member this.DecryptCbc : ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.PaddingMode -> int
Public Function DecryptCbc (ciphertext As ReadOnlySpan(Of Byte), iv As ReadOnlySpan(Of Byte), destination As Span(Of Byte), Optional paddingMode As PaddingMode = System.Security.Cryptography.PaddingMode.PKCS7) As Integer

參數

ciphertext
ReadOnlySpan<Byte>

要解密的資料。

iv
ReadOnlySpan<Byte>

初始化向量。

destination
Span<Byte>

要接收純文字資料的緩衝區。

paddingMode
PaddingMode

用來產生加密文字並在解密期間移除的填補模式。

傳回

寫入的位元組總數 destination

例外狀況

paddingMode 不是有效的填補模式。

iv 是不正確的長度。 呼叫端預期會傳遞完全 BlockSize 長度的初始化向量,並轉換成位元組 (BlockSize / 8) 。

無法成功解密加密文字。

中的 destination 緩衝區太小,無法保存純文字資料。

備註

這個方法的行為是由 TryDecryptCbcCore(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, PaddingMode, Int32) 定義。

適用於