CipherMode Property
The cipher mode of operation.
Syntax
cast.getCipherMode([callback]) cast.setCipherMode( cipherMode, [callback])
Possible Values
0 (cmCBC), 1 (cmECB), 2 (cmOFB), 3 (cmCFB), 4 (cmCTS), 5 (cm8OFB)
Default Value
0
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for the getCipherMode([callback]) method is defined as:
function(err, data){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'data' is the value returned by the method.
The callback for the setCipherMode([callback]) method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
The cipher mode of operation.
Possible values are:
0 (cmCBC - default) | The Cipher Block Chaining (CBC) is a mode of operation for a block cipher, one in which a sequence of bits is encrypted as a single unit or block with a cipher key applied to the entire block. |
1 (cmECB) | The Electronic Codebook (ECB) mode encrypts each block separately. Important: It is not recommend to use this model when encrypting more than one block because it may introduce security risks. |
2 (cmOFB) | The Output Feedback (n-bit, NOFB) mode makes a block cipher into a synchronous stream cipher. It has some similarities to CFB mode in that it permits encryption of differing block sizes, but has the key difference that the output of the encryption block function is the feedback (instead of the ciphertext). |
3 (cmCFB) | The Cipher Feedback (CFB) mode processes a small amount of incremental text into ciphertext, rather than processing a whole block at one time. |
4 (cmCTS) | The Cipher Text Stealing (CTS) mode handles any length of plain text and produces cipher text whose length matches the plain text length. This mode behaves like the CBC mode for all but the last two blocks of the plain text. |
5 (cm8OFB) | 8-bit Output Feedback (OFB) cipher mode. |
Data Type
Integer