Closure Library API Documentation
Go to class or file:
crypt.Cbc
Extends
Implements the CBC mode for block ciphers. See
http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation #Cipher-block_chaining_.28CBC.29
Useful links
Source Code
Git
Inheritance
goog.crypt.Cbc
Constructor
goog.crypt.Cbc(
cipher
,
opt_blockSize
)
Parameters
cipher
:
!
goog.crypt.BlockCipher
The block cipher to use.
opt_blockSize
:
number=
The block size of the cipher in bytes. Defaults to 16 bytes.
Instance Methods
Public
Protected
Private
Defined in
goog.crypt.Cbc
decrypt
(
cipherText
,
initialVector
)
⇒
!
Array
.<
number
>
Decrypt a message.
Arguments:
cipherText
:
!
Array
.<
number
>
Message to decrypt. An array of bytes. The length should be a multiple of the block size.
initialVector
:
!
Array
.<
number
>
Initial vector for the CBC mode. An array of bytes with the same length as the block size.
Returns:
!
Array
.<
number
> Decrypted message.
code »
encrypt
(
plainText
,
initialVector
)
⇒
!
Array
.<
number
>
Encrypt a message.
Arguments:
plainText
:
!
Array
.<
number
>
Message to encrypt. An array of bytes. The length should be a multiple of the block size.
initialVector
:
!
Array
.<
number
>
Initial vector for the CBC mode. An array of bytes with the same length as the block size.
Returns:
!
Array
.<
number
> Encrypted message.
code »
Instance Properties
Defined in
goog.crypt.Cbc
blockSize_
:
Block size in bytes.
Code »
cipher_
:
goog.crypt.BlockCipher
Block cipher.
Code »
Package crypt
Package Reference