Quadcap Embeddable Database

com.quadcap.crypto.AbstractSymmetricKey Class Reference

Inheritance diagram for com.quadcap.crypto.AbstractSymmetricKey:

com.quadcap.crypto.SymmetricKey com.quadcap.crypto.Rijndael com.quadcap.crypto.Tea com.quadcap.crypto.Tea256 List of all members.

Detailed Description

Base class for symmetric ciphers.

Author:
Stan Bailes

Definition at line 50 of file AbstractSymmetricKey.java.

Public Member Functions

abstract void init (String s) throws Exception
 Initialize key from serialized representation.

abstract void init (Random r)
 Initialize: Create a random key.

abstract int getBlockSize ()
 The key's block size.

Key getEncryptionKey ()
 Return the key used for decryption.

abstract void encrypt (ByteBuffer plain, ByteBuffer code)
 Encrypt a buffer (must be multiple of 8 bytes).

Key getDecryptionKey ()
 Return the key used for encryption.

abstract void decrypt (ByteBuffer code, ByteBuffer plain)
 Decrypt a buffer (must be a multiple of 8 bytes).


Protected Attributes

EncryptionKey ekey = new EncryptionKey()
DecryptionKey dkey = new DecryptionKey(this)


Member Function Documentation

abstract void com.quadcap.crypto.AbstractSymmetricKey.decrypt ByteBuffer  code,
ByteBuffer  plain
[pure virtual]
 

Decrypt a buffer (must be a multiple of 8 bytes).

Implemented in com.quadcap.crypto.Rijndael, com.quadcap.crypto.Tea, and com.quadcap.crypto.Tea256.

Referenced by com.quadcap.crypto.AbstractSymmetricKey.DecryptionKey.f().

abstract void com.quadcap.crypto.AbstractSymmetricKey.encrypt ByteBuffer  plain,
ByteBuffer  code
[pure virtual]
 

Encrypt a buffer (must be multiple of 8 bytes).

Implemented in com.quadcap.crypto.Rijndael, com.quadcap.crypto.Tea, and com.quadcap.crypto.Tea256.

abstract int com.quadcap.crypto.AbstractSymmetricKey.getBlockSize  )  [pure virtual]
 

The key's block size.

Implemented in com.quadcap.crypto.Rijndael, com.quadcap.crypto.Tea, and com.quadcap.crypto.Tea256.

Referenced by com.quadcap.crypto.AbstractSymmetricKey.DecryptionKey.blockSize(), and com.quadcap.crypto.AbstractSymmetricKey.EncryptionKey.blockSize().

Key com.quadcap.crypto.AbstractSymmetricKey.getDecryptionKey  ) 
 

Return the key used for encryption.

Implements com.quadcap.crypto.SymmetricKey.

Definition at line 109 of file AbstractSymmetricKey.java.

References com.quadcap.crypto.AbstractSymmetricKey.dkey.

Key com.quadcap.crypto.AbstractSymmetricKey.getEncryptionKey  ) 
 

Return the key used for decryption.

Implements com.quadcap.crypto.SymmetricKey.

Definition at line 80 of file AbstractSymmetricKey.java.

References com.quadcap.crypto.AbstractSymmetricKey.ekey.

abstract void com.quadcap.crypto.AbstractSymmetricKey.init Random  r  )  [pure virtual]
 

Initialize: Create a random key.

Implements com.quadcap.crypto.SymmetricKey.

Implemented in com.quadcap.crypto.Rijndael, com.quadcap.crypto.Tea, and com.quadcap.crypto.Tea256.

abstract void com.quadcap.crypto.AbstractSymmetricKey.init String  s  )  throws Exception [pure virtual]
 

Initialize key from serialized representation.

Implements com.quadcap.crypto.SymmetricKey.

Implemented in com.quadcap.crypto.Rijndael, com.quadcap.crypto.Tea, and com.quadcap.crypto.Tea256.


Member Data Documentation

DecryptionKey com.quadcap.crypto.AbstractSymmetricKey.dkey = new DecryptionKey(this) [protected]
 

Definition at line 104 of file AbstractSymmetricKey.java.

Referenced by com.quadcap.crypto.AbstractSymmetricKey.getDecryptionKey().

EncryptionKey com.quadcap.crypto.AbstractSymmetricKey.ekey = new EncryptionKey() [protected]
 

Definition at line 75 of file AbstractSymmetricKey.java.

Referenced by com.quadcap.crypto.AbstractSymmetricKey.getEncryptionKey().