Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Documentation for crypto's setAutoPadding.
  • Loading branch information
KiNgMaR authored and piscisaureus committed Jan 18, 2012
1 parent b617ec8 commit 8b7d809
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/api/crypto.markdown
Expand Up @@ -120,6 +120,12 @@ Returns any remaining enciphered contents, with `output_encoding` being one of:

Note: `cipher` object can not be used after `final()` method been called.

### cipher.setAutoPadding(auto_padding=true)

You can disable automatic padding of the input data to block size. If `auto_padding` is false,
the length of the entire input data must be a multiple of the cipher's block size or `final` will fail.
Useful for non-standard padding, e.g. using `0x0` instead of PKCS padding. You must call this before `cipher.final`.


### crypto.createDecipher(algorithm, password)

Expand Down Expand Up @@ -147,6 +153,12 @@ Defaults to `'binary'`.

Note: `decipher` object can not be used after `final()` method been called.

### decipher.setAutoPadding(auto_padding=true)

You can disable auto padding if the data has been encrypted without standard block padding to prevent
`decipher.final` from checking and removing it. Can only work if the input data's length is a multiple of the
ciphers block size. You must call this before streaming data to `decipher.update`.


### crypto.createSign(algorithm)

Expand Down

0 comments on commit 8b7d809

Please sign in to comment.