# Method Nettle.BufferedCipher()->Buffer.State()->unpad()

Method unpad

  `string(8bit) unpad(string(8bit) data, void|int method)`

Description

  Decrypt and unpad a block of data. Neither the input or output data is not automatically memory scrubbed, unless String.secure has been called on the data.

  This performs the reverse operation of pad(). The padding will be verified to be correct, if possible. If not, zero is returned.

Parameter `method`

  The type of padding that was applied to the original buffer.

  `Crypto.PAD_SSL`
  `Crypto.PAD_TLS`
  `Crypto.PAD_ISO_10126`
  `Crypto.PAD_ANSI_X923`
  `Crypto.PAD_PKCS7`
  `Crypto.PAD_ZERO`

  Defaults to Crypto.PAD_SSL for compatibility reasons.

See also

  pad()