Maven module :un.api : api-encoding :
Class : un.impl.cryptography.modes.CTR
Extends/Implements : un.impl.cryptography.modes.CipherMode
Subclasses : -

Block cipher counter mode (CTR).
https://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Counter_.28CTR.29
author  Bertrand COTE


Variables : -
Functions : CTR, cipher, cipher, invCipher, invCipher, getNewCipher





public void CTR (byte[] key, CipherAlgorithm algorithm, Padding padding)


In CTR mode, the IV is prepended to the plaintext.
param  plainText the given plaintext with the IV prepended.
return  the ciphertext (First block is the IV)
public byte[] cipher (byte[] plainText)

public void cipher (ByteInputStream input, ByteOutputStream output)


param  cipherText
return  the plaintext without the IV.
throws  InvalidPadException WARNING: to avoid padding oracle
attacks
, do not let the user know the kind of exception thrown by
this method.
public byte[] invCipher (byte[] cipherText)

public void invCipher (ByteInputStream input, ByteOutputStream output)

public CipherMode getNewCipher (byte[] key, CipherAlgorithm algorithm, Padding padding)