public String decrypt(String str) { try { return new String(cipherDecrypt.doFinal(StringUtils.hex2byte(str)), "UTF8"); } catch (UnsupportedEncodingException e) { } catch (BadPaddingException e) { } catch (IllegalBlockSizeException e) { } return null; }
public String encrypt(String str) { try { return StringUtils.byte2hex(cipherEncrypt.doFinal(str.getBytes("UTF8"))); } catch (UnsupportedEncodingException e) { } catch (BadPaddingException e) { } catch (IllegalBlockSizeException e) { } return null; }