use of org.bouncycastle.crypto.StreamBlockCipher 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;
}
use of org.bouncycastle.crypto.StreamBlockCipher in project rxlib by RockyLOMO.
the class AesCrypt method getCipher.
@Override
protected StreamBlockCipher getCipher(boolean isEncrypted) throws InvalidAlgorithmParameterException {
AESFastEngine engine = new AESFastEngine();
StreamBlockCipher cipher;
if (_name.equals(CIPHER_AES_128_CFB)) {
cipher = new CFBBlockCipher(engine, getIVLength() * 8);
} else if (_name.equals(CIPHER_AES_192_CFB)) {
cipher = new CFBBlockCipher(engine, getIVLength() * 8);
} else if (_name.equals(CIPHER_AES_256_CFB)) {
cipher = new CFBBlockCipher(engine, getIVLength() * 8);
} else if (_name.equals(CIPHER_AES_128_OFB)) {
cipher = new OFBBlockCipher(engine, getIVLength() * 8);
} else if (_name.equals(CIPHER_AES_192_OFB)) {
cipher = new OFBBlockCipher(engine, getIVLength() * 8);
} else if (_name.equals(CIPHER_AES_256_OFB)) {
cipher = new OFBBlockCipher(engine, getIVLength() * 8);
} else {
throw new InvalidAlgorithmParameterException(_name);
}
return cipher;
}
use of org.bouncycastle.crypto.StreamBlockCipher in project rxlib by RockyLOMO.
the class CamelliaCrypt method getCipher.
@Override
protected StreamBlockCipher getCipher(boolean isEncrypted) throws InvalidAlgorithmParameterException {
CamelliaEngine engine = new CamelliaEngine();
StreamBlockCipher cipher;
if (_name.equals(CIPHER_CAMELLIA_128_CFB)) {
cipher = new CFBBlockCipher(engine, getIVLength() * 8);
} else if (_name.equals(CIPHER_CAMELLIA_192_CFB)) {
cipher = new CFBBlockCipher(engine, getIVLength() * 8);
} else if (_name.equals(CIPHER_CAMELLIA_256_CFB)) {
cipher = new CFBBlockCipher(engine, getIVLength() * 8);
} else {
throw new InvalidAlgorithmParameterException(_name);
}
return cipher;
}
use of org.bouncycastle.crypto.StreamBlockCipher in project rxlib by RockyLOMO.
the class SeedCrypt method getCipher.
@Override
protected StreamBlockCipher getCipher(boolean isEncrypted) throws InvalidAlgorithmParameterException {
SEEDEngine engine = new SEEDEngine();
StreamBlockCipher cipher;
if (_name.equals(CIPHER_SEED_CFB)) {
cipher = new CFBBlockCipher(engine, getIVLength() * 8);
} else {
throw new InvalidAlgorithmParameterException(_name);
}
return cipher;
}
Aggregations