Search in sources :

Example 1 with BlowfishEngine

use of org.bouncycastle.crypto.engines.BlowfishEngine in project rxlib by RockyLOMO.

the class BlowFishCrypt method getCipher.

@Override
protected StreamBlockCipher getCipher(boolean isEncrypted) throws InvalidAlgorithmParameterException {
    BlowfishEngine engine = new BlowfishEngine();
    StreamBlockCipher cipher;
    if (_name.equals(CIPHER_BLOWFISH_CFB)) {
        cipher = new CFBBlockCipher(engine, getIVLength() * 8);
    } else {
        throw new InvalidAlgorithmParameterException(_name);
    }
    return cipher;
}
Also used : StreamBlockCipher(org.bouncycastle.crypto.StreamBlockCipher) CFBBlockCipher(org.bouncycastle.crypto.modes.CFBBlockCipher) InvalidAlgorithmParameterException(java.security.InvalidAlgorithmParameterException) BlowfishEngine(org.bouncycastle.crypto.engines.BlowfishEngine)

Aggregations

InvalidAlgorithmParameterException (java.security.InvalidAlgorithmParameterException)1 StreamBlockCipher (org.bouncycastle.crypto.StreamBlockCipher)1 BlowfishEngine (org.bouncycastle.crypto.engines.BlowfishEngine)1 CFBBlockCipher (org.bouncycastle.crypto.modes.CFBBlockCipher)1