Package com.bj58.spat.gaea.server.secure

Examples of com.bj58.spat.gaea.server.secure.DESHelper.decrypt()


  public void testEncrypt() throws Exception {
    DESHelper desHelper = DESHelper.getInstance("abcdefgh");
    String src = "q3rgtasdfgqet83tseflgasdf^@$FSGaweg";
   
    byte[] destBuf = desHelper.encrypt(src.getBytes("utf-8"));
    byte[] srcBuf = desHelper.decrypt(destBuf);
    Assert.assertEquals(src, new String(srcBuf, "utf-8"));
  }
 

  @Test
View Full Code Here


  public void testDecrypt() throws Exception {
    DESHelper desHelper = DESHelper.getInstance("11111111");
    String src = "23ra阿豆腐花确认嘎斯大户带回去东风史蒂夫核污染格俄哇凤凰sdgfasdfwef--------------^@$FSGaweg";
   
    byte[] destBuf = desHelper.encrypt(src.getBytes("utf-8"));
    byte[] srcBuf = desHelper.decrypt(destBuf);
    Assert.assertEquals(src, new String(srcBuf, "utf-8"));
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.