CryptoSys PKI Pro Manual

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]

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

Copyright © 2004-21 D.I. Management Services Pty Ltd. All rights reserved. Generated 2021-10-01T09:03:20Z.