Namespace: cbc

sjcl.mode.cbc

Dangerous: CBC mode with PKCS#5 padding.
Author:
  • Emily Stark
  • Mike Hamburg
  • Dan Boneh
Source:

Members

(static, constant) name

The name of the mode.
Source:

Methods

(static) decrypt(prp, ciphertext, iv, adataopt)

Decrypt in CBC mode.
Parameters:
Name Type Attributes Default Description
prp Object The block cipher. It must have a block size of 16 bytes.
ciphertext bitArray The ciphertext data.
iv bitArray The initialization value.
adata bitArray <optional>
[] The authenticated data. It must be empty.
Source:
Throws:
Returns:
The decrypted data, an array of bytes.

(static) encrypt(prp, plaintext, iv, adataopt)

Encrypt in CBC mode with PKCS#5 padding.
Parameters:
Name Type Attributes Default Description
prp Object The block cipher. It must have a block size of 16 bytes.
plaintext bitArray The plaintext data.
iv bitArray The initialization value.
adata bitArray <optional>
[] The authenticated data. Must be empty.
Source:
Throws:
if the IV isn't exactly 128 bits, or if any adata is specified.
Type
sjcl.exception.invalid
Returns:
The encrypted data, an array of bytes.