Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 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;
 }