Cipher.Unpad Method (Byte[], CipherAlgorithm)
Remove padding from an encryption block (PKCS#5/#7 padding).
Syntax
[C#]
public static byte[] Unpad(
byte[] input,
CipherAlgorithm cipherAlg
)
[VB.NET]
Public Shared Function Unpad ( _
input As Byte(), _
cipherAlg As CipherAlgorithm _
) As Byte()
Parameters
- input
- padded data
- cipherAlg
- Type: CipherAlgorithm
Block cipher being used
Return Value
Unpadded data in byte array or unchanged data on error
Remarks
Padding is expected according to the convention in PKCS#5/#7. The unpadded output is always shorter than the padded input. An error is indicated by returning the original data. Check its length.
See Also
VB6/C equivalent: PAD_UnpadBytes
[Contents] [Index]