CryptoSys PKI Pro Manual

Cipher.Unpad(Byte[], CipherAlgorithm, Padding) Method

Remove padding from an encryption block.

Syntax

[C#]
public static byte[] Unpad(
   byte[] input,
   CipherAlgorithm cipherAlg,
   Padding pad = Padding.Pkcs5 
)
[VB]
Public Shared Function Unpad (
   input As Byte(),
   cipherAlg As CipherAlgorithm,
   Optional pad As Padding = Padding.Pkcs5 
) As Byte()

Parameters

input  Byte
Padded data
cipherAlg  CipherAlgorithm
Block cipher being used
pad  Padding  (Optional)
Padding method to use (default is PKCS#5/#7)

Return Value

Byte
Unpadded data in byte array.

Remarks

Unless pad is NoPad, the unpadded output is always shorter than the padded input. An error is indicated by returning the original data. If the output length equals the input length, then error.

See Also

VB6/C equivalent: PAD_UnpadBytes

[Contents] [Index]

[PREV: Cipher.Pad(String, CipherAlgorithm, Padding) Method...]   [Contents]   [Index]   
   [NEXT: Cipher.Unpad(String, CipherAlgorithm, Padding) Method...]

Copyright © 2004-26 D.I. Management Services Pty Ltd t/a CryptoSys. All rights reserved. Generated 2026-09-21T05:59:39Z.