Abstract base stream cipher template.

interface StreamCipher {
    _DEV_XFORM_MODE: number;
    _ENC_XFORM_MODE: number;
    blockSize: number;
    ivSize: number;
    keySize: number;
    finalize(dataUpdate?: string | cryptojs.lib.WordArray): cryptojs.lib.WordArray;
    process(dataUpdate: string | cryptojs.lib.WordArray): cryptojs.lib.WordArray;
    reset(): void;
}

Hierarchy

  • Cipher
    • StreamCipher

Properties

_DEV_XFORM_MODE: number

A constant representing decryption mode.

_ENC_XFORM_MODE: number

A constant representing encryption mode.

blockSize: number

The number of 32-bit words this cipher operates on. Default: 1 (32 bits)

ivSize: number

This cipher's IV size. Default: 4 (128 bits)

keySize: number

This cipher's key size. Default: 4 (128 bits)

Methods

  • Finalizes the encryption or decryption process. Note that the finalize operation is effectively a destructive, read-once operation.

    Parameters

    Returns cryptojs.lib.WordArray

    The data after final processing.

    var encrypted = cipher.finalize();
    var encrypted = cipher.finalize('data');
    var encrypted = cipher.finalize(wordArray);
  • Adds data to be encrypted or decrypted.

    Parameters

    Returns cryptojs.lib.WordArray

    The data after processing.

    var encrypted = cipher.process('data');
    var encrypted = cipher.process(wordArray);
  • Resets this cipher to its initial state.

    Returns void

    cipher.reset();