SecureBlackbox Lite 2020 Node.js Edition

Questions / Feedback?

Mode Property

Specifies the symmetric cipher mode of operation.

Syntax

 symmetriccrypto.getMode([callback])
 symmetriccrypto.setMode( mode, [callback])

Possible Values

  0 (scmDefault), 
  1 (scmECB), 
  2 (scmCBC), 
  3 (scmCTR), 
  4 (scmCFB8), 
  5 (scmGCM), 
  6 (scmCCM), 
  7 (scmPoly1305)

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 getMode([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 setMode([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

Use this property to specify the mode of operation as required by your environment. The defaultsetting is CBC.

scmDefault0The default mode in current circumstances.

scmECB1ECB (electronic code book) mode. This is insecure, unless you know how to use it right.

scmCBC2CBC (cipher block chaining mode)

scmCTR3Counter mode

scmCFB84Cipher feedback mode

scmGCM5Galois counter mode

scmCCM6CCM mode

Data Type

Integer

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox Lite 2020 Node.js Edition - Version 20.0 [Build 8166]