Package com.wyn.rest.server.security

Examples of com.wyn.rest.server.security.SymetricEncryptionUtil.decrypt()


  public void test() throws Exception {
    SymetricEncryptionUtil util = SymetricEncryptionUtil.getInstance();
    byte[] encrypted = util.encrypt("test".getBytes(), "12345678", "AES/CBC/PKCS5Padding");
    System.out.println("Encrypted Text: "+new String(Base64.encodeBase64(encrypted)));
   
    byte[] decrypted = util.decrypt(encrypted, "12345678", "AES/CBC/PKCS5Padding");
    System.out.println("Plain Text: "+new String(decrypted));   
   
  }

}
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.