CryptoSys PKI Toolkit Manual

Cipher.Unpad Method (Byte[], CipherAlgorithm)

Removes the padding from an encryption block

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/CMS. 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]

[HOME]   [NEXT: Cipher.Unpad Method (String, CipherAlgorithm)...]

Copyright © 2004-12 D.I. Management Services Pty Ltd. All rights reserved.