List of usage examples for javax.crypto IllegalBlockSizeException printStackTrace
public void printStackTrace()
From source file:poisondog.security.EncryptMission.java
@Override public String execute(String input) throws NoSuchAlgorithmException, InvalidKeyException { SecretKeySpec skeySpec = new SecretKeySpec(mKey.getBytes(), mAlgorithm); try {/*w w w . j a va 2s. co m*/ Cipher cipher = Cipher.getInstance(mAlgorithm); cipher.init(Cipher.ENCRYPT_MODE, skeySpec); byte[] encrypted = cipher.doFinal(input.getBytes()); return Base64.encodeBase64String(encrypted); } catch (IllegalBlockSizeException e) { e.printStackTrace(); } catch (NoSuchPaddingException e) { e.printStackTrace(); } catch (BadPaddingException e) { e.printStackTrace(); } return null; }