edu.vt.middleware.crypt.symmetric
Class Serpent

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.Serpent
All Implemented Interfaces:
Algorithm, EncryptionAlgorithm

public class Serpent
extends SymmetricAlgorithm

Provider of symmetric encryption/decryption operations using Serpent cipher.

Version:
$Revision: 2744 $
Author:
Middleware Services

Field Summary
static String ALGORITHM
          Algorithm name.
static int[] KEY_LENGTHS
          Available key lengths in bits.
 
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
Serpent()
          Creates a default Serpent symmetric encryption algorithm using CBC mode and PKCS5 padding.
Serpent(String mode, String padding)
          Creates a default Serpent symmetric encryption algorithm using the given mode and padding style.
 
Method Summary
 int[] getAllowedKeyLengths()
          Gets an array of key lengths that are acceptable for the cipher algorithm.
 
Methods inherited from class edu.vt.middleware.crypt.symmetric.SymmetricAlgorithm
clone, getAlgorithmParameterSpec, 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

KEY_LENGTHS

public static final int[] KEY_LENGTHS
Available key lengths in bits.

Constructor Detail

Serpent

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


Serpent

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

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

getAllowedKeyLengths

public int[] getAllowedKeyLengths()
Gets an array of key lengths that are acceptable for the cipher algorithm. By convention the lengths are returned in descending sort order from longest to shortest. There are some ciphers (e.g. Blowfish) that allow key sizes to be any integral value in a range; in those cases only key sizes that are multiple of the cipher block length are returned. Thus this method always returns lengths that are acceptable, but not necessarily all possible lengths.

Overrides:
getAllowedKeyLengths in class SymmetricAlgorithm
Returns:
Array of key lengths in bits.


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