Example usage for org.bouncycastle.crypto.engines CAST5Engine CAST5Engine

List of usage examples for org.bouncycastle.crypto.engines CAST5Engine CAST5Engine

Introduction

In this page you can find the example usage for org.bouncycastle.crypto.engines CAST5Engine CAST5Engine.

Prototype

public CAST5Engine() 

Source Link

Usage

From source file:org.cryptacular.spec.BlockCipherSpec.java

License:Open Source License

@Override
public BlockCipher newInstance() {
    BlockCipher cipher;/*from  www. j a va  2  s.  co  m*/
    if ("AES".equalsIgnoreCase(algorithm)) {
        cipher = new AESFastEngine();
    } else if ("Blowfish".equalsIgnoreCase(algorithm)) {
        cipher = new BlowfishEngine();
    } else if ("Camellia".equalsIgnoreCase(algorithm)) {
        cipher = new CamelliaEngine();
    } else if ("CAST5".equalsIgnoreCase(algorithm)) {
        cipher = new CAST5Engine();
    } else if ("CAST6".equalsIgnoreCase(algorithm)) {
        cipher = new CAST6Engine();
    } else if ("DES".equalsIgnoreCase(algorithm)) {
        cipher = new DESEngine();
    } else if ("DESede".equalsIgnoreCase(algorithm) || "DES3".equalsIgnoreCase(algorithm)) {
        cipher = new DESedeEngine();
    } else if ("GOST".equalsIgnoreCase(algorithm) || "GOST28147".equals(algorithm)) {
        cipher = new GOST28147Engine();
    } else if ("Noekeon".equalsIgnoreCase(algorithm)) {
        cipher = new NoekeonEngine();
    } else if ("RC2".equalsIgnoreCase(algorithm)) {
        cipher = new RC2Engine();
    } else if ("RC5".equalsIgnoreCase(algorithm)) {
        cipher = new RC564Engine();
    } else if ("RC6".equalsIgnoreCase(algorithm)) {
        cipher = new RC6Engine();
    } else if ("SEED".equalsIgnoreCase(algorithm)) {
        cipher = new SEEDEngine();
    } else if ("Serpent".equalsIgnoreCase(algorithm)) {
        cipher = new SerpentEngine();
    } else if ("Skipjack".equalsIgnoreCase(algorithm)) {
        cipher = new SkipjackEngine();
    } else if ("TEA".equalsIgnoreCase(algorithm)) {
        cipher = new TEAEngine();
    } else if ("Twofish".equalsIgnoreCase(algorithm)) {
        cipher = new TwofishEngine();
    } else if ("XTEA".equalsIgnoreCase(algorithm)) {
        cipher = new XTEAEngine();
    } else {
        throw new IllegalStateException("Unsupported cipher algorithm " + algorithm);
    }
    return cipher;
}

From source file:org.xwiki.crypto.cipher.internal.symmetric.factory.BcCast5CbcPaddedCipherFactory.java

License:Open Source License

@Override
protected BlockCipher getEngineInstance() {
    return new CAST5Engine();
}

From source file:org.xwiki.crypto.passwd.internal.CAST5PasswordCiphertext.java

License:Open Source License

/**
 * {@inheritDoc}/*from  w  w  w.j av a 2s.co  m*/
 *
 * @see org.xwiki.crypto.passwd.internal.AbstractPasswordCiphertext#newCipherInstance()
 */
@Override
protected PaddedBufferedBlockCipher newCipherInstance() {
    return new PaddedBufferedBlockCipher(new CBCBlockCipher(new CAST5Engine()));
}