@Test public void testEncrypt() throws Exception { long start = System.nanoTime(); String result = encrypt("{\n" + "\t\"certificateNo\": \"110101198804011930\",\n" + "\t\"systemId\": \"INTG\",\n" + "\t\"certificateType\": \" ID\"\n" + "}"); long spend = System.nanoTime() - start; System.out.println(formatNS(spend) + "======" + result.length()); System.out.println("=============================="); start = System.nanoTime(); result = encrypt("{\"appNo\":\"1000\",\"caller\":\"ADI\",\"ip\":\"127.0.0.1\",\"pin\":\"EV_903347\",\"signature\":\"023977c8a81df660a7ab0c5a32d151c9\",\"sysBizType\":1,\"systemNo\":\"1\",\"token\":\"12345\"}"); spend = System.nanoTime() - start; System.out.println(formatNS(spend) + "======" + result.length()); System.out.println("=============================="); start = System.nanoTime(); result = encrypt("{\"customerVo\":{\"id\":56,\"customerId\":\"1511702198506123795\",\"name\":\"沈英杰\",\"credentialsType\":1,\"credentialsNo\":\"511702198506123795\",\"authStatus\":1,\"authType\":12,\"authTime\":\"2016-04-06 09:50:31\",\"level\":40,\"mobile\":\"123456789\",\"status\":0,\"systemNo\":1,\"sysBizType\":1,\"pin\":\"EV_903956\",\"validFlag\":1,\"encryptId\":\"f2f086df4d6931610698131870ebdd3f\",\"createTime\":\"2016-03-21 16:40:56\",\"updateTime\":\"2016-04-06 09:59:46\",\"remark\":\"WY-SYNC\"},\"userVo\":{\"userId\":\"1_1_EV_903347\",\"systemNo\":1,\"sysBizType\":1,\"pin\":\"EV_903347\",\"credentialsType\":1,\"credentialsNo\":\"511702198506123795\",\"secScore\":2,\"secLevel\":2,\"verifyMobile\":0,\"verifyEmail\":0,\"validFlag\":1,\"status\":1,\"createTime\":\"2016-03-21 16:44:43\",\"updateTime\":\"2016-03-24 16:08:42\",\"callertoken\":\"ADI_12345\"},\"success\":true,\"responseCode\":\"00000\",\"responseMessage\":\"成功\"}"); spend = System.nanoTime() - start; System.out.println(formatNS(spend) + "======" + result.length()); }
public static String encrypt(String txt) { try { return desEncrypter.get().encrypt(txt); } catch (Exception e) { LOG.info("Encrypt Error "); throw new RuntimeException(e); } }
DesCrypter { public static String encrypt(String txt) { try { return desEncrypter.get().encrypt(txt); } catch (Exception e) { LOG.info("Encrypt Error "); throw new RuntimeException(e); } } }
DesCrypter { public static String encrypt(String txt) { try { return desEncrypter.get().encrypt(txt); } catch (Exception e) { LOG.info("Encrypt Error "); throw new RuntimeException(e); } }  }
DesCrypter { public static String encrypt(String txt) { try { return desEncrypter.get().encrypt(txt); } catch (Exception e) { LOG.info("Encrypt Error "); throw new RuntimeException(e); } }  static String encrypt(String txt); static String decrypt(String txt); }
DesCrypter { public static String encrypt(String txt) { try { return desEncrypter.get().encrypt(txt); } catch (Exception e) { LOG.info("Encrypt Error "); throw new RuntimeException(e); } }  static String encrypt(String txt); static String decrypt(String txt);  }