throw new IllegalArgumentException("unable to initialize cipher for algorithm " + algorithm, e);
}
try {
return cipher.doFinal(text);
} catch (GeneralSecurityException e) {
throw new EncryptionException("unable to encrypt data using algorithm " + algorithm, e);
}
}