edu.vt.middleware.crypt.symmetric.Rijndael Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vt-crypt Show documentation
Show all versions of vt-crypt Show documentation
Library for performing common cryptographic operations
/*
$Id$
Copyright (C) 2007-2010 Virginia Tech.
All rights reserved.
SEE LICENSE FOR MORE INFORMATION
Author: Middleware Services
Email: [email protected]
Version: $Revision$
Updated: $Date$
*/
package edu.vt.middleware.crypt.symmetric;
/**
* Provider of symmetric encryption/decryption operations using Rijndael cipher.
*
* @author Middleware Services
* @version $Revision: 3 $
*/
public class Rijndael extends SymmetricAlgorithm
{
/** Algorithm name. */
public static final String ALGORITHM = "Rijndael";
/** Default key size for this algorithm in bits. */
public static final int DEFAULT_KEY_LENGTH = 256;
/** Available key lengths in bits. */
public static final int[] KEY_LENGTHS = new int[] {
256,
224,
192,
160,
128,
};
/**
* Creates a default Rijndael symmetric encryption algorithm using CBC mode
* and PKCS5 padding.
*/
public Rijndael()
{
this(DEFAULT_MODE, DEFAULT_PADDING);
}
/**
* Creates a default Rijndael symmetric encryption algorithm using the given
* mode and padding style.
*
* @param mode Cipher mode name.
* @param padding Cipher padding style name.
*/
public Rijndael(final String mode, final String padding)
{
super(ALGORITHM, mode, padding);
}
/** {@inheritDoc} */
public int getDefaultKeyLength()
{
return DEFAULT_KEY_LENGTH;
}
/** {@inheritDoc} */
public int[] getAllowedKeyLengths()
{
return KEY_LENGTHS;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy