CryptCipher

com.github.cloudfiles.crypt.alg.CryptCipher
trait CryptCipher

A trait defining a crypto operation that manipulates data (such as encryption or decryption).

Implementations of this trait are used to encrypt or decrypt data making use of a concrete algorithm. An instance can be viewed as a representation of a ''Cypher'' in the Java crypto API. The functions provided by this trait are derived from the life-cycle of such an object: it is initialized, chunks of data are passed to it for being transformed, and there is a notification of the end of the sequence to be transformed. The rather stateful nature of this trait is due to the interaction schemes used by the underlying Java API.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def complete(): ByteString

Notifies this object that all data has been processed. An implementation can yield a final chunk of data if there are remaining bytes which have not yet been output.

Notifies this object that all data has been processed. An implementation can yield a final chunk of data if there are remaining bytes which have not yet been output.

Attributes

Returns

the final chunk of data

def init(secRandom: SecureRandom, initChunk: ByteString): ByteString

Initializes this object for the current operation. This function is called with the first chunk of data to be processed and some helper objects typically required to correctly initialize a crypt operation.

Initializes this object for the current operation. This function is called with the first chunk of data to be processed and some helper objects typically required to correctly initialize a crypt operation.

Value parameters

initChunk

the first chunk of data

secRandom

the source of random data

Attributes

Returns

the next chunk to be passed downstream

def transform(chunk: ByteString): ByteString

Transforms the given chunk of data. This function is called repeatedly for all the data chunks to be transformed except for the first one (which is handled by ''init()''. Here the actual encryption/decryption work takes place.

Transforms the given chunk of data. This function is called repeatedly for all the data chunks to be transformed except for the first one (which is handled by ''init()''. Here the actual encryption/decryption work takes place.

Value parameters

chunk

the current chunk of data to be transformed

Attributes

Returns

the transformed chunk of data