Class: CBC

CBC

Implements CBC block cipher mode. Used internally during symmetric *cryption.

new CBC(data)

Creates a new CBC block cipher mode instance
Parameters:
Name Type Description
data Object Initialization options for the class, passed automatically into CBC#initialize
Source:

Extends

Requires

  • module:convert

Methods

decrypt_blocks(words) → {Array}

Decrypt blocks.
Parameters:
Name Type Description
words Array An array of 32-bit words whose length must be an integer multiple of CBC#get_words_per_block
Source:
Returns:
Decrypted blocks
Type
Array

encrypt_blocks(words) → {Array}

Encrypts blocks.
Parameters:
Name Type Description
words Array An array of 32-bit words whose length must be an integer multiple of CBC#get_words_per_block
Source:
Returns:
Encrypted blocks
Type
Array

get_words_per_block() → {number}

Convenience function to get the number of 32-bit words required for each block
Inherited From:
Source:
Returns:
Type
number

initialize(data) → {CBC}

Called automatically on class instantiation. Invokes BlockCipherMode#initialize before handling class-specific functionality.
Parameters:
Name Type Description
data Object See BlockCipherMode#initialize for a list of supported properties.
Source:
Returns:
Type
CBC