edu.vt.middleware.crypt.symmetric
Class RC2

java.lang.Object
  extended by edu.vt.middleware.crypt.AbstractAlgorithm
      extended by edu.vt.middleware.crypt.AbstractEncryptionAlgorithm
          extended by edu.vt.middleware.crypt.symmetric.SymmetricAlgorithm
              extended by edu.vt.middleware.crypt.symmetric.RC2
All Implemented Interfaces:
Algorithm, EncryptionAlgorithm

public class RC2
extends SymmetricAlgorithm

Provider of symmetric encryption/decryption operations using RC2 cipher.

Version:
$Revision: 2744 $
Author:
Middleware Services

Field Summary
static String ALGORITHM
          Algorithm name.
 
Fields inherited from class edu.vt.middleware.crypt.symmetric.SymmetricAlgorithm
DEFAULT_MODE, DEFAULT_PADDING, iv, paramSpec
 
Fields inherited from class edu.vt.middleware.crypt.AbstractEncryptionAlgorithm
cipher, cipherMode, key, mode, padding
 
Fields inherited from class edu.vt.middleware.crypt.AbstractAlgorithm
algorithm, logger, randomByteSize, randomProvider
 
Constructor Summary
RC2()
          Creates a default RC2 symmetric encryption algorithm using CBC mode and PKCS5 padding.
RC2(String mode, String padding)
          Creates a default RC2 symmetric encryption algorithm using the given mode and padding style.
 
Method Summary
protected  AlgorithmParameterSpec getAlgorithmParameterSpec()
          Gets the algorithm parameter specification for this algorithm.
static int getEffectiveBits(int version)
          Gets the number of effective bits for a given RC2Version code.
 int getEffectiveKeyBits()
          Gets the effective key size in bits.
static int getVersion(int effectiveBits)
          Gets the RC2Version code for a given effective bits value.
 void setEffectiveKeyBits(int numBits)
          Sets the effective key size in bits.
 
Methods inherited from class edu.vt.middleware.crypt.symmetric.SymmetricAlgorithm
clone, getAllowedKeyLengths, getChunkSize, getMaxKeyLength, getMinKeyLength, getRandomIV, hasIV, isValidKeyLength, newInstance, newInstance, newInstance, newInstance, setIV
 
Methods inherited from class edu.vt.middleware.crypt.AbstractEncryptionAlgorithm
crypt, crypt, decrypt, decrypt, decrypt, encrypt, encrypt, encrypt, getBlockSize, getCipherMode, getMode, getPadding, init, initCipher, initDecrypt, initEncrypt, setKey, toString
 
Methods inherited from class edu.vt.middleware.crypt.AbstractAlgorithm
getAlgorithm, getRandomData, setRandomProvider
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.vt.middleware.crypt.Algorithm
getAlgorithm, getRandomData, setRandomProvider
 

Field Detail

ALGORITHM

public static final String ALGORITHM
Algorithm name.

See Also:
Constant Field Values
Constructor Detail

RC2

public RC2()
Creates a default RC2 symmetric encryption algorithm using CBC mode and PKCS5 padding.


RC2

public RC2(String mode,
           String padding)
Creates a default RC2 symmetric encryption algorithm using the given mode and padding style.

Parameters:
mode - Cipher mode name.
padding - Cipher padding style name.
Method Detail

getEffectiveBits

public static int getEffectiveBits(int version)
Gets the number of effective bits for a given RC2Version code.

Parameters:
version - RC2Version code.
Returns:
Number of effective bits for given version.

getVersion

public static int getVersion(int effectiveBits)
Gets the RC2Version code for a given effective bits value.

Parameters:
effectiveBits - Effective bits corresponding to a particular RC2Version encoded value.
Returns:
RC2Version code for given effective bits.

getEffectiveKeyBits

public int getEffectiveKeyBits()
Gets the effective key size in bits. This is a parameter specific to the RC2 cipher algorithm.

Returns:
Effective key size in bits.

setEffectiveKeyBits

public void setEffectiveKeyBits(int numBits)
Sets the effective key size in bits. This is a parameter specific to the RC2 cipher algorithm.

Parameters:
numBits - Effective key size in bits; MUST be positive integer.

getAlgorithmParameterSpec

protected AlgorithmParameterSpec getAlgorithmParameterSpec()
Gets the algorithm parameter specification for this algorithm.

Overrides:
getAlgorithmParameterSpec in class SymmetricAlgorithm
Returns:
Algorithm parameter specification specific to this algorithm.


Copyright © 2003-2013 Virginia Tech. All Rights Reserved.