IPWorks Encrypt 2020 Android Edition

Questions / Feedback?

CipherMode Property

The cipher mode of operation.

Syntax

public int getCipherMode();
public void setCipherMode(int cipherMode);

Enumerated values: public final static int acmCBC = 0; public final static int acmECB = 1; public final static int acmOFB = 2; public final static int acmCFB = 3; public final static int acmCTS = 4; public final static int acm8OFB = 5; public final static int acmGCM = 6; public final static int acm8CFB = 7; public final static int acmCTR = 8; public final static int acmXTS = 9;

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.
7 (cm8CFB) 8-bit Cipher Feedback (CFB) cipher mode.
6 (acmGCM) Galois/Counter (GCM) cipher mode.
8 (acmCTR) Counter (CTR) cipher mode.
9 (acmXTS) XEX Tweakable Block Cipher with Ciphertext Stealing (XTS) cipher mode.

GCM Notes

When setting this value to 6 (acmGCM) the following settings are also applicable:

GCM mode code example:

//Encrypt
aes.CipherMode = AesCipherModes.acmGCM;
aes.KeyPassword = "test";
aes.InputMessage = "input data";
aes.Config("AdditionalData=" + hex_aad); //Optional
aes.Encrypt();
string authTag = aes.Config("AuthTag");
byte[] outputMessage = aes.OutputMessageB;

//Decrypt
aes.CipherMode = AesCipherModes.acmGCM;
aes.KeyPassword = "test";
aes.InputMessageB = outputMessage;
aes.Config("AdditionalData=" + hex_aa);
aes.Config("AuthenticationTag=" + authTag);
aes.Decrypt();
XTS Notes

When setting this value to 9 (acmXTS) the following settings are also applicable:

PaddingMode has no effect when using acmXTS -- the InputMessage MUST be a multiple of XTSDataUnitLength.

Default Value

0

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Encrypt 2020 Android Edition - Version 20.0 [Build 8161]